Link to home
Start Free TrialLog in
Avatar of mikeandbee
mikeandbee

asked on

deleting a record using form elements

Hi,  
I am trying to delete a record from a table in my database using a simple DELETE query:
delete from RIDER where ID = " &request("id"). Whenever I delete a record, I get a
ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
error.
I realise this is because the record I have deleted no longer exists and is unable to display the record which I have just deleted (the form posts to itself).
The page initially uses a SELECT query to select the record, but once deleted this query no longer works. How can I make this work ?
Avatar of jitganguly
jitganguly

You can check it like

Open recordset
....
If not (rs.bof or rs.eof)
...
...
end if
ASKER CERTIFIED SOLUTION
Avatar of jitganguly
jitganguly

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi mike,
    what i understood from ur question is, ur deleting a record in the table and then writting a select statement on the same table and then ur getting error.
What you can do is after executing the select statement u can write


sorry i pressed submit before completing my comment..
 continuation--

   if not rstemp is nothing then
       if not(rstemp.eof and rstemp.bof)
         while not rstemp.eof
         'do something
          Wend
       End if
   End if


you won't get any errors when
    -- due to some reason recordset is not created,
    -- recordset is created but there is no records in that
try this, i am not sure if this is ur requirement..  
Please award/close or advise what else is needed.
Moondancer
Community Support Moderator @ Experts Exchange
I think I deserve some points here. What do others think ?
YES I THINK YOU DESERVE POINTS, and I will return to close this for you.

ONE MORE REQUEST HERE AND ADDING ALL OPEN QUESTIONS, AND ADVISING ADMINISTRATION.

This question appears to have been abandoned, all your open questions are posted below.
Your options are:
1.  Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3.  Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4.  Delete the question. Again, you must tell the other participants why you wish to do this.
For special handling needs, please post a zero point question in the link below, include the question QID/link.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this Help Desk link for Member Guidelines, Member Agreement and the Question/Answer process:  Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues.
https://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:
 
Please leave any comments regarding this question here on closing recommendations if this item remains inactive another three days.
 
Thank you everyone.

Open Qs:
https://www.experts-exchange.com/jsp/qShow.jsp?qid=11677198
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20136244
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20138104
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20139384
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20141051
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20141266
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20147138
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20175597
https://www.experts-exchange.com/jsp/qShow.jsp?qid=11188236

Moondancer
Moderator @ Experts Exchange
 
P.S.  For year 2000 question, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.

Prior requests ignored in all Qs posted.  Finalized.