Hello
I have an MS Access database which includes two tables (one called 'users' and the other
sIPAddresses).
The 'users' table stores information which the user has input in an online form (name, email, etc),
while the sIPAddresses stores the users IP address.
If possible, I would like to introduce a 'date' field in each table without the user having to
input it anywhere.
In the 'users' table I have the following:
<%
' Declare variables
Dim fullname, email, business, country, message
'Open MS Access database, store form field values, and close
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=D:\business\form.mdb;"
set rs = Server.CreateObject("ADODB.recordset")
SQL="INSERT INTO users (fullname, email, business, country, message) VALUES ('" & _
fullname & "', '" & email & "', '" & business & "', '" & country & "', '" & message & "')"
rs.Open SQL, conn
Set rs=Nothing
conn.Close
Set conn=Nothing
%>
and in the 'sIPAddresses' table I have:
<%
' Declare variables
Dim sIPAddress
sIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If sIPAddress="" Then sIPAddress = Request.ServerVariables("REMOTE_ADDR")
'Open MS Access database, store form field values
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=D:\business\form.mdb;"
set rs = Server.CreateObject("ADODB.recordset")
SQL="INSERT INTO sIPAddresses (IPaddress) VALUES ('" & sIPaddress & "')"
rs.Open SQL, conn
Set rs=Nothing
' Close the connection
conn.Close
Set conn=Nothing
%>
Neither of these tables stores the date anywhere, so I am not able to recognise when a form
was submitted or the site accessed. Any advice, please?
Thanks
Steve
I have an MS Access database which includes two tables (one called 'users' and the other
sIPAddresses).
The 'users' table stores information which the user has input in an online form (name, email, etc),
while the sIPAddresses stores the users IP address.
If possible, I would like to introduce a 'date' field in each table without the user having to
input it anywhere.
In the 'users' table I have the following:
<%
' Declare variables
Dim fullname, email, business, country, message
'Open MS Access database, store form field values, and close
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=D:\business\form.mdb;"
set rs = Server.CreateObject("ADODB.recordset")
SQL="INSERT INTO users (fullname, email, business, country, message) VALUES ('" & _
fullname & "', '" & email & "', '" & business & "', '" & country & "', '" & message & "')"
rs.Open SQL, conn
Set rs=Nothing
conn.Close
Set conn=Nothing
%>
and in the 'sIPAddresses' table I have:
<%
' Declare variables
Dim sIPAddress
sIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If sIPAddress="" Then sIPAddress = Request.ServerVariables("REMOTE_ADDR")
'Open MS Access database, store form field values
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=D:\business\form.mdb;"
set rs = Server.CreateObject("ADODB.recordset")
SQL="INSERT INTO sIPAddresses (IPaddress) VALUES ('" & sIPaddress & "')"
rs.Open SQL, conn
Set rs=Nothing
' Close the connection
conn.Close
Set conn=Nothing
%>
Neither of these tables stores the date anywhere, so I am not able to recognise when a form
was submitted or the site accessed. Any advice, please?
Thanks
Steve