Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Help! adodb.recordset (0x800a0bcd)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Help! adodb.recordset (0x800a0bcd)

 Post Reply Post Reply
Author
Flapjacks View Drop Down
Newbie
Newbie


Joined: 19 October 2007
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Flapjacks Quote  Post ReplyReply Direct Link To This Post Topic: Help! adodb.recordset (0x800a0bcd)
    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
 
Back to Top
shakir View Drop Down
Groupie
Groupie


Joined: 08 November 2007
Location: Saudi Arabia
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote shakir Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2007 at 7:44am
change the cursor or lock type then try 
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.