|
-
May 14th, 2000, 09:11 PM
#1
Thread Starter
Hyperactive Member
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?
-
May 14th, 2000, 09:30 PM
#2
Thread Starter
Hyperactive Member
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.
-
May 15th, 2000, 12:47 AM
#3
Guru
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|