Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help with deleting from a recordset

2 views
Skip to first unread message

ofer

unread,
Jul 6, 2004, 11:34:04 AM7/6/04
to

here's what i do in my code:

while not recordset.eof

recordset.delete
recordset.updatebatch
recordset.movenext

wend

all is fine until i get to the final record.
when i reach the final record, i get an error that says that the record has been
deleted or marked for deletion.

is there a way not to get this error?

Douglas Marquardt

unread,
Jul 6, 2004, 1:48:31 PM7/6/04
to
Hi ofer:

Try movenext then update,
or because you using updatebatch do all the deletes first, i.e.

Do While Not rs.EOF
rs.Delete
rs.MoveNext
Loop
rs.UpdateBatch

Hope this helps,

Doug.

"ofer" <of...@discussions.microsoft.com> wrote in message news:3D3D2334-C92A-4E15...@microsoft.com...

Unicorn

unread,
Jul 8, 2004, 11:16:52 PM7/8/04
to
Why use a loop to delete the contents of the recordset anyway. A simple
delete query will get the same result far more quickly and efficiently.

Matt


0 new messages