-
have tried
----
strSQLOut = "select * from DAILY_RET"
rsTableOut.Open strSQLOut, cnDataBaseOut, adOpenKeyset, adLockOptimistic
While rsTableOut.RecordCount > 0
rsTableOut.Delete adAffectCurrent
Wend
rsTableOut.Close
----
which works in another program i`m maintaining, but not in this one! the error is in the line doing the deleting... .RecordCount is not null... error is `Errors occured` - number is 80040e21
any ideas?
-
um...despite the `helpful` error message, i`ve worked it out..the code i borrowed the subroutine about from only selected 1 record at a time...so when i changed my code to :
While rsTableOut.RecordCount > 0
rsTableOut.Move rsTableOut.RecordCount - 1, adBookmarkFirst
rsTableOut.Delete
Wend
it works fine! doh!
a.
-
That will be slow, compared to a simple SQL statement:
Delete from MyTable
If you are using SQL Server, you can perform this even faster using
Truncate table MyTable
this does not record each delete in the transaction log, so its very fast
HTH
Tom