eyoung Posted April 3, 2008 Share Posted April 3, 2008 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 More sharing options...
justsomeguy Posted April 3, 2008 Share Posted April 3, 2008 The query did not return any results. You can check for EOF before you do the delete. Link to comment Share on other sites More sharing options...
eyoung Posted April 3, 2008 Author Share Posted April 3, 2008 The query did not return any results. You can check for EOF before you do the delete.Hi justsomeguy,Can u show me the code? I really dont have any idea. I am really new in ASP.. Thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted April 3, 2008 Share Posted April 3, 2008 if not rsDeleteEntry.EOF then rsDeleteEntry.Delete Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.