Random Access files

I know how to open a file as random access and how to get, search, and save records to it; how do you delete a record, though?
showmeAsked:
Who is Participating?
 
raybCommented:
Sorry, but it's not as easy as those other operations.
The exact technique you employ is dependent upon your needs.  When I've needed to do this in the past, I marked the records by my own methods as ready to be deleted.  However you do this is up to you, maybe set the ID to a negative one.  Then implement your own compact method to compact the file.  The way I would handle this is to create a temporary file, copy in all the good records from the old file, close both files, delete the old one and replace it with the new one.

0
 
showmeAuthor Commented:
Do you know of any good VB books that cover random access files and the like?  And, thanks for the advice.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.