Erik Blake wrote:
> Now you only have to search for the patient (DmQueryNextInCategory) and
presto,
> you can get the teeth (with DmGetRecord or DmFindRecordByID).
Erik, if I knew how to search for the patient, I wouldn't be asking how to
search for the tooth! ;-)
I have the exact same problem with searching for the patient as I do with
searching for the tooth - every search seems to need to know something about
the item being searched for - the index or the ID - and I don't HAVE those
values.
Perhaps the answer is this: in order to find a record in a database, if you
don't know the index or unique ID of that record, you have to do a "brute
force" search - start at the top, read the record with index 0, and compare
a value in that record (such as a patient ID number) to the value you're
searching for, and iterate thru all the records, top to bottom (index 0 thru
DmNumRecords), until you find a match. Is that it?
I'm used to having DB files with searchable "keys" - in my example, the
patient ID would be a keyed field - so it's very easy to go right to a
record with a known key value. But I guess that's not possible in a Palm DB,
because it seems the DB is just a text file - no supporting "keys" for rapid
searching. Is that right?
Thanks,
Brian Smith
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/