Behind the Scenes

This samples uses one file: Counter.asp. This file uses the Recordset design-time control to create a connection to the Counter table in the Gallery database. After the recordset is open, a new record is added to the table and data is written into the appropriate fields:

function CounterRecordset_ondatasetcomplete(){
fieldsArray = new Array("Remote_Host","Path_Info","HTTP_User_Agent");
valuesArray = new Array(Request.ServerVariables("Remote_Addr"), Request.ServerVariables("Path_Info"), Request.ServerVariables("HTTP_User_Agent"));
CounterRecordset.addImmediate(fieldsArray, valuesArray);
}

Using a Label design-time control, the total number of records from the recordset is used to display the current count of hits to this page.