What i'm trying to do is check if data, particularly the IP address that is accessing the page. If the address exists it pretty much does nothing so far. If it doesn't it adds it to the database.
<html>
<head>
<title>Check Page</title>
</head>
<body bgcolor="white" text="black">
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsProjDatabase 'Holds the recordset for the records in the database
Dim sql_check 'Holds the SQL query to check the database
'Dim sql_insert
Dim Address 'Hold IP Address
'Get ip address
Address= Request.ServerVariables("REMOTE_ADDR")
'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 "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("ProjDatabase.mdb")
'Create an ADO recordset object
Set rsProjDatabase = Server.CreateObject("ADODB.Recordset")
'Set the cursor type we are using so we can navigate through the recordset
rsProjDatabase.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated
rsProjDatabase.LockType = 3
'Initialise the strSQL variable with an SQL statement to query the database
sql_check = "Select IP from tblIP where IP = Address"
'Open the recordset with the SQL query
rsProjDatabase.Open sql_check, adoCon
If rsProjDatabase.EOF Then
'Tell the recordset we are adding a new record to it
rsProjDatabase.AddNew
'Add a new record to the recordset
rsProjDatabase.Fields("IP") = Address
'Write the updated recordset to the database
rsProjDatabase.Update
Else
Response.Write ("It exist")
End If
'Reset server objects
rsProjDatabase.Close
Set rsProjDatabase = Nothing
Set adoCon = Nothing
%>
</body>
</html>