% 'HIT COUNTER 'Dimension variables Dim adoCon 'Holds the Database Connection Object Dim rsAccess 'Holds the recordset for the new record to be added to the database Dim strSQL 'Holds the SQL query for the database Dim counter 'Holds counter value from database Dim strCurrentPage 'Holds name of current web page strCurrentPage = "Index" 'Create an ADO connection odject Set adoCon = Server.CreateObject("ADODB.Connection") 'Set an active connection to the Connection object using a DSN-less connection adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("_private/Hits.mdb") 'Create an ADO recordset object Set rsAccess = Server.CreateObject("ADODB.Recordset") 'Initialise the strSQL variable with an SQL statement to query the database strSQL = "SELECT tblHits.Index, tblHits.Advertising, tblHits.Classifieds, tblHits.Commercial_Advertising, tblHits.Contact, tblHits.Contests, tblHits.Coupons, tblHits.Employment, tblHits.Events, tblHits.Fun_Links, tblHits.KIQX, tblHits.KIUP, tblHits.KKDC, tblHits.KRSJ, tblHits.Listen_Live, tblHits.Loyal_Listener_Registry, tblHits.News, tblHits.PSA, tblHits.Sports, tblHits.Weather FROM tblHits;" 'Set the cursor type we are using so we can navigate through the recordset rsAccess.CursorType = 2 'Set the lock type so that the record is locked by ADO when it is updated rsAccess.LockType = 3 'Open the tblComments table using the SQL query held in the strSQL varaiable rsAccess.Open strSQL, adoCon Set counter = rsAccess(strCurrentPage) counter = counter + 1 rsAccess.Fields(strCurrentPage) = counter rsAccess.Update adoCon.Close %>





