Jump to content

Error on ASP code


eyoung

Recommended Posts

Dear all,Please help me on this. Thank you in advance. I got this error :Error Type:ADODB.Recordset (0x800A0BCD)Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record./tutorial3/delete_entry.asp, line 39code for delete_entry.asp<%'Dimension variablesDim adoCon 'Holds the Database Connection ObjectDim rsDeleteEntry 'Holds the recordset for the record to be deletedDim strSQL 'Holds the SQL query for the databaseDim lngRecordNo 'Holds the record number to be deletedsvrpath = server.MapPath("/")'Read in the record number to be deletedlngRecordNo = CLng(Request.QueryString("Project Registration (BSLS)"))'Create an ADO connection odjectSet adoCon = Server.CreateObject("ADODB.Connection")adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & svrpath & "\tutorial3\database\guestbook.mdb;Persist Security Info=False"'Create an ADO recordset objectSet rsDeleteEntry = Server.CreateObject("ADODB.Recordset")'Initialise the strSQL variable with an SQL statement to query the databasestrSQL = "SELECT * FROM [Project Registration] WHERE [Project Registration (BSLS)]=" & lngRecordNo'Set the lock type so that the record is locked by ADO when it is deletedrsDeleteEntry.LockType = 3'Open the recordset with the SQL query rsDeleteEntry.Open strSQL, adoCon'Delete the record from the databasersDeleteEntry.Delete 'line 39'Reset server objectsrsDeleteEntry.CloseSet rsDeleteEntry = NothingSet adoCon = Nothing'Return to the delete select page incase another record needs deletingResponse.Redirect "delete_select.asp"%>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...