Hmm now i'm having a problem with it saying it exists even if it doesn't.
Here's the code...
<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_check2 'Holds the SQL query to check the database
Dim IP
Dim ID
'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("ProjDatabase2.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_check2 = "SELECT COUNT(*) As Total FROM tblAll WHERE IP = '127.0.0.1' AND ID = 'Test1'"
sql_check2 = "SELECT COUNT(*) FROM tblAll WHERE IP = '127.0.0.1' and ID = 'Test1' "
'Open the recordset with the SQL query
rsProjDatabase.Open sql_check2, adoCon
If rsProjDatabase.EOF Then
Response.Write ("It doesn't exist!")
'Write the updated recordset to the database
rsProjDatabase2.Update
Else
Response.Write ("It exist!")
End If
'Reset server objects
rsProjDatabase.Close
Set rsProjDatabase = Nothing
Set adoCon = Nothing
%>
</body>
</html>