Slow Database Deletes




I have been experimenting for the first time with the built in database
in RB2005. While adding lots of records (1000) at once seems very quick,
deleting all records (6000) takes about 30 seconds on my iBook 700MHz
G3. Is this fairly normal for databases?

here is the code I am using:

rs = MusicLib.SQLSelect("SELECT rowid, * FROM SONG")

while not rs.eof
rs.DeleteRecord
rs.MoveNext
Wend


I tried moving to the end of the record set and deleting backwards but
that was worse and eventually hung:

rs.MoveLast
while not rs.eof
rs.DeleteRecord
rs.MovePrevious
Wend

Also I didnt call Commit after deleting yet the data was all gone. Does
this mean Undoing record deletion is not really possible?

Maybe it would be better 'flag' the records as deleted then slowly
delete them in a thread?

thanks!
Peter

www.fracturedSoftware.com
zegsRuler - Add Rulers to your RB project in minutes!
Rondo - Midi made easy.
.



Relevant Pages

  • Re: Capture Users IP in Access
    ... ' The user roster is exposed as a provider-specific schema rowset ... Wend ... > 'Private Sub Detail_Format ... > 'Output the list of all users in the current database. ...
    (microsoft.public.access.security)
  • RE: Push Method - overwriting data
    ... If you are deleting records at the SqlCe Database, ... SQL Server and inserting the new records. ...
    (microsoft.public.sqlserver.ce)
  • Re: Subform not allowing edits?
    ... Creating and deleting fields. ... It's just possible that Name AutoCorrect is ... Make sure the boxes are unchecked under ... the database may be corrupting? ...
    (microsoft.public.access.forms)
  • Re: DoCmd.Close and DoCmd.DeleteObject
    ... Recreating the database does not make a difference unfortunately. ... be deleted was open when the second form was opened, ... I have no problems deleting the form manually! ... Danny ...
    (microsoft.public.access.formscoding)
  • Re: RE and Cascade Deletes
    ... all you get is a lousy message saying ... this database and delete the entire database ... working hard to prevent gaffs like this if a simple "Yes" sends you deleting ...
    (comp.databases.ms-access)