Knowledge Base

DOC: "Site Hits Log" Documentation Sample Code is Incorrect

Article ID: 194020

Article Last Modified on 3/16/2005


APPLIES TO


This article was previously published under Q194020

SUMMARY

The code provided in the Microsoft Developer Network (MSDN) Help for the "Site Hits Log" sample is incorrect.

MORE INFORMATION

The code that is supplied in the documentation is as follows:

      function CounterRecordset_ondatasetcomplete(){
         CounterRecordset.addImmediate();
         CounterRecordset.fields.setValue("Remote_Host",
   Request.ServerVariables("Remote_Addr"));
         CounterRecordset.fields.setValue("Path_Info",
   Request.ServerVariables("Path_Info"));
         CounterRecordset.fields.setValue("HTTP_User_Agent",
   Request.ServerVariables("HTTP_User_Agent"));
         CounterRecordset.updateRecord();
      }
				


The correct code is as follows:

      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.addIddImmediate(fieldsArray, valuesArray);
      }
				

Keywords: kbdocfix KB194020