Flat-file database w/out BDE?
Quote:
>I want to write an app. in Delphi 1.0 which includes a fairly simple
>database structure, holding perhaps 500 - 1000 records and not
>requiring particularly sophisticated data editing/manipulation. It
>would be straightforward using the BDE, but that seems a bit like
>over-kill and adds a lot of unnecessary overheads.
>I've previously written similar apps using 'Typed' files, but these
>required only fixed length records. I now need to be able to save and
>retrieve records which include at least one variable-length ('blob')
>text field. I've struggled with the manuals and on-line help, but as
>a Pascal novice, I'm not making a lot of headway!
>Can anyone recommend the best way to go about this problem - perhaps
>with some sample code of file input/output procedures - or point me in
>the direction of some easily understood examples ? Many thanks in
>advance.
>--
>John Drewicz
>Cognitive Data Systems
If I remember correctly, you can define your record structure globally
and your file type as byte (this saves space and protects your data in
ways that ASCII files can't be...)
Since you won't be using the BDE to do searches and what not you'll
need to design your own indexing scheme (not hard, really) to locate
record info without doing hex string searches.
Use the WRITELN or Write functions to place the info into your binary
file and viola! Your own little database program.
For more indepth info on writing these, there are several books at
major book stores (Learn Delphi 2 Database Programming, Delphi 2
Database Developers Guids, etc)
Good Luck!
Bill