Problem with delete Record

  • Thread starter Thread starter Batman2
  • Start date Start date
B

Batman2

Guest
Hi,

I have a table with a few record and having an error at



stSQL = "Select * from [ours]"
Set rs= CreateObject("adodb.Recordset")
rs.open stSql, con, 1
rs.delete
rs.close

Can someone help me?

Greetz
 
Using the Delete method marks the current record or a group of records in a Recordset object for deletion. If the Recordset object doesn't allow record deletion, an error occurs. If you are in immediate update mode, deletions occur in the database immediately. Otherwise, the records are marked for deletion from the cache and the actual deletion happens when you call the UpdateBatch method
 
Not sure if my interpretation is correct or not, but it sounds like you are wanting to delete all the records from the table [ours]. If that is correct this works much easier and with less code:
Code:
CurrentDB.Execute("DELETE * FROM [ours]")

It should be noted that there is no warning message. It quietly executes and deletes all the records from the table.
 

Users who are viewing this thread

Back
Top Bottom