Kevin123456
Technical User
Hi,
I'm using an Access 97 database and can read the records from it with no problems. I also have one set of statements that adds data with no problems. The statements are:
Dim LConnect, LResults, LReason, LError, LStamp
Set LConnect = Server.CreateObject ("ADODB.Connection"
LConnect.Open "UMS"
Set LResults = Server.CreateObject ("ADODB.Recordset"
LResults.Open "SELECT * FROM log WHERE Error = '" & Error & "'", LConnect, adOpenDynamic,adLockOptimistic
LResults.AddNew
LResults ("Reason"
= Reason
LResults ("Error"
= Error
LResults ("Stamp"
= Now()
LResults.Update
LResults.Close
Another set of statements to insert records into another table produce:
ADODB.Recordset error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
reg.asp, line 88
The code here is:
Dim UConnect, UResults, UReason, UError, UStamp
Set UConnect = Server.CreateObject ("ADODB.Connection"
UConnect.Open "UMS"
Set UResults = Server.CreateObject ("ADODB.Recordset"
UResults.Open "SELECT * FROM User", UConnect, adOpenDynamic,adLockOptimistic
UResults.AddNew
RESPONSE.WRITE("GOT HERE"
UResults ("Username"
= Results("Username"
Line 87 is the last line of the second set of statements and I see the 'Got Here' progress trap. I think the problem is in the query of the database that I'm using, I don't really understand why I need to use a query and not just specify the table I want to insert the data in. I understand that the error message concerns an empty recordset being returned (even though there are two records in the table). The first set of statements needn't necessarily return any data as it could be the first time that the error code has been written to the log table. There is an ID field that's the primary key which is an autonumber however I'm assuming that Access will automatically fill that in when it inserts the row and I'm using the include file adovbs.inc.
Any help very gratefully appreciated
Kevin
I'm using an Access 97 database and can read the records from it with no problems. I also have one set of statements that adds data with no problems. The statements are:
Dim LConnect, LResults, LReason, LError, LStamp
Set LConnect = Server.CreateObject ("ADODB.Connection"
LConnect.Open "UMS"
Set LResults = Server.CreateObject ("ADODB.Recordset"
LResults.Open "SELECT * FROM log WHERE Error = '" & Error & "'", LConnect, adOpenDynamic,adLockOptimistic
LResults.AddNew
LResults ("Reason"
LResults ("Error"
LResults ("Stamp"
LResults.Update
LResults.Close
Another set of statements to insert records into another table produce:
ADODB.Recordset error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
reg.asp, line 88
The code here is:
Dim UConnect, UResults, UReason, UError, UStamp
Set UConnect = Server.CreateObject ("ADODB.Connection"
UConnect.Open "UMS"
Set UResults = Server.CreateObject ("ADODB.Recordset"
UResults.Open "SELECT * FROM User", UConnect, adOpenDynamic,adLockOptimistic
UResults.AddNew
RESPONSE.WRITE("GOT HERE"
UResults ("Username"
Line 87 is the last line of the second set of statements and I see the 'Got Here' progress trap. I think the problem is in the query of the database that I'm using, I don't really understand why I need to use a query and not just specify the table I want to insert the data in. I understand that the error message concerns an empty recordset being returned (even though there are two records in the table). The first set of statements needn't necessarily return any data as it could be the first time that the error code has been written to the log table. There is an ID field that's the primary key which is an autonumber however I'm assuming that Access will automatically fill that in when it inserts the row and I'm using the include file adovbs.inc.
Any help very gratefully appreciated
Kevin