Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 150
  • Last Modified:

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?
0
showme
Asked:
showme
1 Solution
 
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now