Quote:>Can anyone point me to C or other code to search for records in
>a dBASE IV .dbf file. It would need to return the record #.
>I want to do this to replace a Clipper
>function which is deathly slow on a large database file, so the
>C will be called from Clipper. Thanks.
John: You can find descriptions of the .DBF structure in a number of books
and can relatively easily write your own routines in C to access a .DBF file
which is (for all intents and purposes) a fixed-length data record with a
header record tacked on the front...
The important points however are : 1) it isn't a dBASE IV .DBF file but rather
a Clipper .DBF file. dBASE IV has a float datatype I believe (or whatever one
was added) and it might be represented differently in the .DBF file. 2) Clipper
permits "very long strings" because it usurps the decimal length field in the
header to maintain the length (there can't be a decimal place in a character
field).
Unless you're willing to do a lot of extra work your indexes will not be
maintained and you'd have to add record locking code and logic to handle the
contention problems (if this was ever networked).
In other words your routine would be likely to be deathly slow also if you
properly handled the delete flag, update the update flag in the header and
verify the disk writes.
You can write for the RDD guide from CA which would probably help you out in
developing something that enters through the front door...
tom
formerly of Nantucket but so formerly that it probably doesn't bear mentioning
at this late date