ADO Delete 
Author Message
 ADO Delete

I am trying to delete a record from a disconnected recordset, but I am not
having any luck.

m_rstTemp.Delete

any time I m_rsttemp.requery the data goes back to the original state.



Sat, 20 Dec 2003 05:20:05 GMT  
 ADO Delete
I think you have to update after
m_rsTemp.Update --> when you delete, the row is only marked for delete but
not deleted yet
hope this help


Quote:
> I am trying to delete a record from a disconnected recordset, but I am not
> having any luck.

> m_rstTemp.Delete

> any time I m_rsttemp.requery the data goes back to the original state.



Sat, 20 Dec 2003 16:21:58 GMT  
 ADO Delete
For disconnected recordset (CursorLocation = adUseClient;LockType =
adLockBatchOptimistic), after deleting a record, we need to restore the
connection and use the UpdateBatch function to make the changes in the
database. See sample here:

=======================
rsAuthors.Delete

'restore the connection and updatebatch:
With cnStateUBookstore
  .ConnectionString = "driver={SQL
Server};server=servername;uid=sa;pwd=;database=Pubs"
  .Open
End With

With rsAuthors
  .ActiveConnection = cnStateUBookstore
  .UpdateBatch
End With

=======================

Now when using requery function, the deleted record is not there.
Note: when using the Requery function, make sure the connection is restored.



Sat, 20 Dec 2003 18:58:46 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ADO delete bug???

2. ADO delete bug/mlml

3. ADO (Deleting all records in a table)

4. ADO deleting records

5. ADO Delete problem

6. ADO Delete Method!!!!

7. Foxpro/ADO deleted records showing

8. ADO delete bug?/mlml

9. Ado Delete Got Error....Help!

10. ado deleting and adding a record problem

11. ADO deleted record still in new recordset

12. ADO delete all

 

 
Powered by phpBB® Forum Software