VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Arrays and Binary File Access

by Jim Hunt (3 Submissions)
Category: Data Structures
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (14 Votes)

This project demonstrates how to use a dynamic array to interact with database records and settings stored in a single binary file.
The example stores custom settings and the record count at the beginning of the binary file, then stores multiple database records. To retrieve the data, it gets the settings and record count, then loads the records into a dynamic array which can be interacted with on the form, much like a true database record. I needed a custom database format to store large, variable-length fields of data with a lot of symbol-type characters and still keep the packaged application smaller than 2Mb!



This code has been updated! I added a progress bar, streamlined the arrays (it's no longer using multidimensional arrays) and now it has progress bar support to show loading, saving and function progress. Any comments are welcome! I'm in the process of converting this project (with some major enhancements) to a class module to handle the routines. If you want to join this little project, post a message below. Depending on response, this may be developed into a complete flat-file database class (I'm getting tired of redistributing megabytes of DAO/ADO supports just to store a few dozen records). Don't forget to vote!

Assumes
This project was created in VB6 (SP5). I'm sure with very few modifications, it can be used in VB4&5.
Side Effects
This type of data access shouldn't be used for anything over 5,000 records or so. It just doesn't have the kind of performance (yet).

Rate Arrays and Binary File Access

Download Arrays and Binary File Access

Download Arrays and Binary File Access (14 KB)

Arrays and Binary File Access Comments

No comments have been posted about Arrays and Binary File Access. Why not be the first to post a comment about Arrays and Binary File Access.

Post your comment

Subject:
Message:
0/1000 characters