qcl0wn
asked on
VB Searching Random Access Data Files
Hello...
I have a type - what_done, that i have declared as cinfo.
I want to have a user type into text1, click Search (sv1) and then searches through a random access data file (data.vcr) and tries to find a record in the database so that cinfo.verb = text1.text.
I have heard about indexing and binary searching but I cant understand them very well...
Could someone help me with one of these?
PS: There will only be one result of the search.
I have a type - what_done, that i have declared as cinfo.
I want to have a user type into text1, click Search (sv1) and then searches through a random access data file (data.vcr) and tries to find a record in the database so that cinfo.verb = text1.text.
I have heard about indexing and binary searching but I cant understand them very well...
Could someone help me with one of these?
PS: There will only be one result of the search.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Approximately how many records are in your database?
Rather than reinventing the wheel, have you considered using a database system that already has this capability? They are optimized for this kind of searching and sorting.
I can certainly give you code on how to do this but I can guarantee that it won't be very optimized. Database systems are complex beasts...
Rather than reinventing the wheel, have you considered using a database system that already has this capability? They are optimized for this kind of searching and sorting.
I can certainly give you code on how to do this but I can guarantee that it won't be very optimized. Database systems are complex beasts...
ASKER
Actually, I found the example code in another place (your explanations helped so much!)...
I just need to know how I can load all records into a listbox (list1). Could you help me with this (get me a code)?
Thanks!
-q-
I just need to know how I can load all records into a listbox (list1). Could you help me with this (get me a code)?
Thanks!
-q-
ASKER
I have:
Private Type what_done
verb as string * 100
sub_act as string * 100
min as integer
End Type
and the database file is data.dat.