Print Page | Close Window

Help! adodb.recordset (0x800a0bcd)

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=24667
Printed Date: 29 March 2026 at 12:51am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Help! adodb.recordset (0x800a0bcd)
Posted By: Flapjacks
Subject: Help! adodb.recordset (0x800a0bcd)
Date Posted: 19 October 2007 at 3:19pm
when I try to update a record, I get the following error message:
 

ADODB.Recordset error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

 

I can select the record, but not update it.  Here is the code:

'Dimension variables
Dim adoCon    'Holds the Database Connection Object
Dim rsUpdateEntry  'Holds the recordset for the record to be updated
Dim strSQL   'Holds the SQL query for the database
Dim lngRecordNo   'Holds the record number to be updated
'Read in the record number to be updated
lngRecordNo = CLng(Request.Form("ID"))
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("bosinventory.mdb")
'Set an active connection to the Connection object using DSN connection
'adoCon.Open "DSN=bosinventory"
'Create an ADO recordset object
Set rsUpdateEntry = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblComments.* FROM tblComments WHERE ID=" & lngRecordNo
'Set the cursor type we are using so we can navigate through the recordset
rsUpdateEntry.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated
rsUpdateEntry.LockType = 3
'Open the tblComments table using the SQL query held in the strSQL varaiable
rsUpdateEntry.Open strSQL, adoCon
'Update the record in the recordset
rsUpdateEntry.Fields("Name") = Request.Form("name")
rsUpdateEntry.Fields("Office") = Request.Form("office")
rsUpdateEntry.Fields("Floor") = Request.Form("Floor")
rsUpdateEntry.Fields("Ext") = Request.Form("Ext")
rsUpdateEntry.Fields("NetworkName") = Request.Form("NetworkName")
rsUpdateEntry.Fields("AssetTag") = Request.Form("AssetTag")
rsUpdateEntry.Fields("MAC") = Request.Form("MAC")
rsUpdateEntry.Fields("PC") = Request.Form("PC")
rsUpdateEntry.Fields("Serial") = Request.Form("Serial")
rsUpdateEntry.Fields("Monitor") = Request.Form("Monitor")
rsUpdateEntry.Fields("MonitorSerial") = Request.Form("MonitorSerial")
rsUpdateEntry.Fields("MonitorAssetTag") = Request.Form("MonitorAssetTag")
rsUpdateEntry.Fields("LocalPrinter") = Request.Form("LocalPrinter")
rsUpdateEntry.Fields("PrinterSerial") = Request.Form("PrinterSerial")
rsUpdateEntry.Fields("PrinterAssetTag") = Request.Form("PrinterAssetTag")
rsUpdateEntry.Fields("Phone") = Request.Form("Phone")
rsUpdateEntry.Fields("PhoneAssetTag") = Request.Form("PhoneAssetTag")
rsUpdateEntry.Fields("Peripheral1") = Request.Form("Peripheral1")
rsUpdateEntry.Fields("Peripheral1Serial") = Request.Form("Peripheral1Serial")
rsUpdateEntry.Fields("Peripheral1AssetTag") = Request.Form("Peripheral1AssetTag")
rsUpdateEntry.Fields("Peripheral2") = Request.Form("Peripheral2")
rsUpdateEntry.Fields("Peripheral2Serial") = Request.Form("Peripheral2Serial")
rsUpdateEntry.Fields("Peripheral2AssetTag") = Request.Form("Peripheral2AssetTag")
rsUpdateEntry.Fields("Comments") = Request.Form("Comments")
rsUpdateEntry.Fields("MoreComments") = Request.Form("MoreComments")

'Write the updated recordset to the database
rsUpdateEntry.Update
'Reset server objects
rsUpdateEntry.Close
Set rsUpdateEntry = Nothing
Set adoCon = Nothing
'Return to the update select page incase another record needs deleting
Response.Redirect "update_select.asp"
%>
 
Any help would be greatly appreciated
 



Replies:
Posted By: shakir
Date Posted: 18 November 2007 at 7:44am
change the cursor or lock type then try 


Posted By: MadDog
Date Posted: 18 November 2007 at 8:14am
Your not passing a value to the lngRecordNo variable when your updating. The error message tells you whats wrong... "Requested operation requires a current record."

Read the error message next time, it does wonders Tongue


-------------
http://www.iportalx.net" rel="nofollow">



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net