Flat-file database w/out BDE? 
Author Message
 Flat-file database w/out BDE?

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



Wed, 06 Jan 1999 03:00:00 GMT  
 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

In Delphi32 there is a Tstringlist component where you can use the
Tstringlist.LoadFromFile to import your data to a stringlist where you
can access every single string (record). The result you can save with
the Tstringlist.SaveToFile. If you look at the Tstring component you
can also sort your records.
I do'nt know if this component is available in Delphi 1.0 if yes then
this will work fine

"a bad day camping is better than a good day at work"
regards

Wim Schreuders




Wed, 06 Jan 1999 03:00:00 GMT  
 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



Fri, 08 Jan 1999 03:00:00 GMT  
 Flat-file database w/out BDE?

Tstringlist is the way to go.  BP 7 had a collection object that did a
real good job of letting you have a file of objects whose size (and types)
could differ; however, it got lost in the transition to Delphi.  More or
less replaced by the streaming concept used on many Delphi Objects such as
Tstringlist.  The only real problem with using tStringList is the memory
limit:  Strings are max 256 characters, period.  You may also run into
64KB data segment problems, too, in Delphi 1.  

One option is SSI's Topaz, which I just sent back for a refund because it
doesn't support dBase IV .mdx production indexes, doesn't support graphics
fields, and it didn't come with a windows help/reference file.  Other than
that, I'd probably be using right now.   It is a replacement for the BDE
and compiles right into your exe -- but it does not have either than
features or the drawbacks of tsession, tdatabase, and the other headaches
and nice touches in the BDE.

Hope this helps,

Brandon Smith

http://members.aol.com/syanture



Sat, 16 Jan 1999 03:00:00 GMT  
 Flat-file database w/out BDE?

Quote:

> Tstringlist is the way to go.

And you can use TIniFile objects to get very fast,
easy storage of the stringlist contents.  We have even
used one stringlist to hold others to make a
'relational' storage system with INI files.
However, this option would not work on very
large files...

Joe

--

|** marketing a product or service? let us help! **|
try our software & workshops- http://www.thassoc.com



Mon, 18 Jan 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. I can't use my paradox database(flat-file) for multiuser

2. flat-file datasets

3. Midas flat-file indexes, help

4. Can FreePascal generate flat binary files?

5. TDataSet flat file implementation

6. how to make multiple read outs - help

7. how do you make multiple read outs?

8. Table jumps outs edit mode newby

9. Help please: non-BDE, non-ODBC database files

10. 16 &32 bit BDE on same database files

11. Debugging Flat Mode Code

12. Connect to a flat bed scanner?

 

 
Powered by phpBB® Forum Software