Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 1 of 1 total |
RecordCount returns incorrect results after batch deletion |
Tue, Oct 25 2011 8:38 PM | Permanent Link |
Gregory Sebastian | It looks like there's an issue with RecordCount after programmatically doing
batch deletes. I started with 1067 records. The code below deleted 41 records but Table.RecordCount after the deletes was 1031. It was only after I did RepairTable after the deletes did the recordcount return the correct result of 1026. I tried repairing the table before the bulk delete but same problem. Only after Repairing the table after the deletes did record count return the correct result. Its not a bigdeal, I plan to pack the table after the batch deletes but I just thought I'd report it anyway. Regards Greg --------------------------------------------- DBISam : 4.30 Build 5 RecCount := tblRecipients.RecordCount; RecsDeleted := 0; LogAddLine(Format('Number of records to process : %d ',[RecCount]), False); ProgressBar.Max := RecCount; ProgressBar.Position := 0; tblRecipients.First; while Not tblRecipients.EOF do begin if RecipientInUse(tblRecipientsID.AsString) then begin //In use //LogAddLine(Format('Skipped : "%s". Record still active.',[tblRecipientsName.AsString]), false); tblRecipients.Next; end else begin //OK to delete LogAddLine(Format('Deleting : "%s"',[tblRecipientsName.AsString]), false); tblRecipients.Delete; RecsDeleted := RecsDeleted + 1; end; ProgressBar.Position := ProgressBar.Position + 1; end; PostTable(tblRecipients, False); LogAddLine(Format('Number of Records Deleted : %d',[RecsDeleted]), true); |
This web page was last updated on Wednesday, April 24, 2024 at 11:07 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |