Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Random Access files

Posted on 1998-06-29
2
Medium Priority
?
148 Views
Last Modified: 2010-05-03
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
Comment
Question by:showme
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
rayb earned 80 total points
ID: 1464537
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
 

Author Comment

by:showme
ID: 1464538
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question