Hello
I have an MS Access database with two fields: VisitorID and IPAddress (this latter is a text data field and accepts zero-length strings).
I have the following code in my <head></head> tags and do not get an error message.
The database table (called sIPAddresses) does increment by one in the VisitorID field each time a visitor clicks on the site, but it does NOT insert the IPAddress in the adjacent column.
Any ideas, please?
Many thanks.
Steve
<%
' Declare variablesDim sIPAddresssIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If sIPAddress="" Then sIPAddress = Request.ServerVariables("REMOTE_ADDR")
'Open MS Access database, store form field valuesset
conn=Server.CreateObject("ADODB.Connection")conn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=D:\business\nameofform.mdb;"
set rs = Server.CreateObject("ADODB.recordset")
SQL="INSERT INTO sIPAddresses (IPaddress) VALUES ('" & _IPaddress & "')"
rs.Open SQL,
connSet rs=Nothing
' Close the connection
conn.CloseSet conn=Nothing
%>
I have an MS Access database with two fields: VisitorID and IPAddress (this latter is a text data field and accepts zero-length strings).
I have the following code in my <head></head> tags and do not get an error message.
The database table (called sIPAddresses) does increment by one in the VisitorID field each time a visitor clicks on the site, but it does NOT insert the IPAddress in the adjacent column.
Any ideas, please?
Many thanks.
Steve
<%
' Declare variablesDim sIPAddresssIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If sIPAddress="" Then sIPAddress = Request.ServerVariables("REMOTE_ADDR")
'Open MS Access database, store form field valuesset
conn=Server.CreateObject("ADODB.Connection")conn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=D:\business\nameofform.mdb;"
set rs = Server.CreateObject("ADODB.recordset")
SQL="INSERT INTO sIPAddresses (IPaddress) VALUES ('" & _IPaddress & "')"
rs.Open SQL,
connSet rs=Nothing
' Close the connection
conn.CloseSet conn=Nothing
%>