This is a discussion on "IP address into MS Access database" within the Classic ASP section. This forum, and the thread "IP address into MS Access database are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
IP address into MS Access database
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
IP address into MS Access database
Hello
I am trying to store visitors' IP addresses into an MS Access database. I have two fields (visitorID, which is my AutoNumber, and IPAddress which has a text data field and allows zero length values) in a table called sIPAddresses. I am using the following code: <% ' 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:\name\form.mdb;" set rs = Server.CreateObject("ADODB.recordset") SQL="INSERT INTO sIPAddresses (IPaddress) VALUES ('" & _ IPaddress & "')" rs.Open SQL, conn Set rs=Nothing ' Close the connection conn.Close Set conn=Nothing %> I do not get an qerror message, but I canot see that the databse is storing any IP addresses. Can anybody assist, please? Many thanks. Quetzal |
|
|
|
|||
|
Re: IP address into MS Access database
Try this (untested but is the normal way i do things like this)
Alex |
|
|||
|
Re: IP address into MS Access database
Hello Alex
Many thanks for your reply. Yes, it worked, thanks, and the IP addresses are now stored in the database. Thanks for your help. Quetzal |
![]() |
| Tags |
| ip address |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| using access database ? | saadi babar | Classic ASP | 13 | Mar 19th, 2008 09:45 |
| Access Database | benjamjon | Databases | 1 | Mar 8th, 2007 20:19 |
| Sending database record ID as a membership number t an email address | frinkky | PHP Forum | 3 | Nov 30th, 2006 02:45 |
| display web address with link from database! | Monie | Classic ASP | 3 | Aug 29th, 2004 13:39 |
| Access database on the Web | redkyna | Databases | 7 | Aug 2nd, 2004 20:25 |