Delete method raises error
Posted on 2004-09-17
I am trying to call the Delete method of the ADOB/Recordset object (ADO 2.1) to delete all the records in the table.
I have tried every CursorType / LockType combination and nothing works. I have also tried changing the source property to "Select * From FTPFiles" to no avail. I also get this error when I modify a record and call the Update method.
Depending on the CursorType / LockType combination I get one of the following errors
1. Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
2. Operation is not allowed in this context.
Dim rstFTPFiles As ADODB.Recordset
Set rstFTPFiles = New ADODB.Recordset
Set .ActiveConnection = CurrentProject.Connection
.Source = "FTPFiles"
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
rstFTPFiles.Delete adAffectAllChapters <--- Error occurs here