r/visualbasic • u/PcCodex • Jun 03 '16
Understanding VB6 Database Files
This may be a tall order I'm requesting but here goes. In VB6 I can create a Random Access file in it's basic format example
 
Type Trip
 
Car as string * 50
 
Hotel as string * 90
 
end Type
 
What I don't understand is how to delete a Record
 
. I've tried understanding some programmers in the past but they seem to always say terms that aren't clear to. I've tried reading up on up but they to can't seem to convey an understanding like bring up an ISAM table and I'm supposed to understand what it's for and how to use it.
 
 
I've used VB6's feature for creating a binary file however that still
 
leaves me in the dark on ok how does it do what it's doing?
3
u/tweq Jun 04 '16 edited Jul 03 '23
1
1
u/EkriirkE VB 6 Master Jun 04 '16
The easiest way to manually manage your own DB format like this is to keep track if a record is in use or not - add a flag field, and recycle an unused record with new data when needed.
Otherwise you need to move/re-org all the data after a deleted record, and truncate the file everytime you delete something. Normally this is performed as a "compact database" function
0
Jun 06 '16
Simplest way to do this is using a listview. Steps: Load Listview, Make Changes To Listview, Reorder, Write to File
1
u/PcCodex Jun 04 '16
Well I Can Understand your procedure so thank you for that.
I've only been with Reddit about 3 days so if I knew how to up vote you I would.