Wife/Girlfriend/Sister?
Pepper Spray &
Stun Gun Specials!
KEEP THEM SAFE.
 CoverYourASP --> Articles from database --> Part 2

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
35 active users
2090 visitors today
4759 pages today
(only part of today)
Tools I use

CoverYourASP
Copyright © 1999-2010 James Shaw.
All rights reserved.

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

Administering the Articles table

Also, when an article is updated or a new one added, the process is a lot simpler. I just upload the file and then use my administration page to add the article into the database, change title, category, description, hits, etc.

I could simplify this even further by adding upload capability to my administration form - then I could do (virtually) everything without an FTP program.

Counting the hits to the articles

As seen above, the Articles table contains the number of times each article is viewed. The code to increment this counter is in the IncrementArticleCounter( ) function in utils/Init.asp - as always, you can get the full source code and the database by clicking on the icon at the bottom of the page.

The important part of the code to do that is shown below:

// get the name of myself (the asp file)
var sPage = "" + Request.ServerVariables ( 'SCRIPT_NAME' );

// increment counter
oConnection.Execute( 'UPDATE Articles SET Hits=Hits+1 WHERE URL=\'' + sPage + '\';' );

So you get a new front page with articles listed by date, popularity and category, and I get to play with more and more fun ASP examples!

Featured sponsor
My favorite resources

Tiki Statues - Tiki Masks - Tiki Totems



I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...


Qualify for Free Trade Magazines

Free subscriptions to industry leading publications for those who qualify!