Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Logging Access
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Logging Access

 Post Reply Post Reply
Author
Dazz View Drop Down
Newbie
Newbie
Avatar

Joined: 24 January 2003
Location: United Kingdom
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dazz Quote  Post ReplyReply Direct Link To This Post Topic: Logging Access
    Posted: 02 March 2003 at 10:45am

I want to use the following script to logg access to my pages however when i put in Request.ServerVariables("HTTP_USER_AGENT")
it stops working altogether does ayone have any idea why this is, your help would be greatly appreciated.
I have copyed the error message and put it at the bottom of this post

Regards

Daz

<%@ Language=VBScript %>
<%
'Dimension variables
Dim adoCon              'Holds the Database Connection Object
Dim rsAddinfo   'Holds the recordset for the new record to be added
Dim strSQL               'Holds the SQL query to query the database

'Create an ADO connection object
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("errorlogs.mdb")

'Create an ADO recordset object
Set rsAddinfo = Server.CreateObject("ADODB.Recordset")
 
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblInfo.IP, tblInfo.Date, tblInfo.Software FROM tblInfo;"
 
'Set the cursor type we are using so we can navigate through the recordset
rsAddInfo.CursorType = 2

'Set the lock type so that the record is locked by ADO when it is updated
rsAddInfo.LockType = 3
 
'Open the recordset with the SQL query
rsAddInfo.Open strSQL, adoCon

'Tell the recordset we are adding a new record to it
rsAddInfo.AddNew

'Add a new record to the recordset
rsAddInfo.Fields("IP") = Request.ServerVariables("REMOTE_ADDR")
rsAddInfo.Fields("Date") = FormatDateTime(NOW)
rsAddInfo.Fields("Software") = Request.ServerVariables("HTTP_USER_AGENT")

'Write the updated recordset to the database
rsAddInfo.Update

'Reset server objects
rsAddInfo.Close
Set rsAddInfo = Nothing
Set adoCon = Nothing
%>

This is the error that i get

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

/asp/errorlog.asp, line 35

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.