8

I need a SMALL/LIGHTWEIGHT DB control (maybe delivered as a single PAS file) that I can integrate directly into my application. I need to store relatively small amounts of data in a small number of tables and I want to access some columns fast. I know that Delphi 7 has that nice BDE but I don't want to trouble the user with the installation process.

I use Delphi 7.


EDIT:
I think I asked the wrong question. So, here is what I actually need:
How to store dynamic data (unknown number of fields) to a file?

Community
  • 1
  • 1
Gabriel
  • 20,797
  • 27
  • 159
  • 293
  • See the question: http://stackoverflow.com/questions/222699/which-embedded-database-to-use-in-a-delphi-application – lkessler Feb 07 '11 at 06:57
  • Hey! I'd narrow the question a bit with 1) as said, you need a storage engine only 2) since you want it statically linked, license matters 3) OK to multiple files or not. Personally i'd go either TClientDataSet or ADO/Jet – Free Consulting Feb 07 '11 at 10:47

10 Answers10

9

NexusDB offers a free embedded version. Here is an Example

Erwin
  • 1,896
  • 1
  • 11
  • 17
  • 1
    In what way do you consider it overkill? It fully compiles into your application without any external dependencies (and it's modular, if you e.g. don't need to use SQL, you don't need to compile SQL support into your application) and provides similar functionality to the BDE which you said in your original post you would use if it wasn't for the need to install it. – Thorsten Engler Feb 07 '11 at 02:11
  • @Engler. See PhilW's post. For the moment I am looking at TDBF. It is much smaller. It adds almost nothing to app size and especially to compilation time!!! – Gabriel Feb 07 '11 at 10:20
8

If you're committed to not include any more dependencies with your application, take a look at TClientDataSet.

I'd recommend some sort of "embedded" database. Example: In order to use Firebird as an embedded database, at a minimum, you only need to ship one DLL. You can put that DLL in your installer so the user doesn't need to install anything.

Cosmin Prund
  • 25,498
  • 2
  • 60
  • 104
  • 1
    Sqlite is another option (1 DLL too). – arthurprs Feb 06 '11 at 15:14
  • while I like the Nexus DB alternative, TClientDataSet is the best way to go in my opinion, not to mention that it's shipped with Delphi for so many versions. –  Feb 07 '11 at 16:54
7

As an alternative, how about the freeware TDbf database? It compiles directly into your application and is reliable for lightweight uses.

Also, if you are old enough to remember the days when DBase was the standard desktop database platform, then you probably know how to use it already. :-)

It's at http://tdbf.sourceforge.net

(If there doesn't seem to be a lot of recent activity then it is because it's been around for 10 years and is very stable).

Just a thought.

PhilW
  • 457
  • 6
  • 15
  • Thanks. I really like TDBF. I just installed it. I will experiment with it. I have to see if it supports binary fields. – Gabriel Feb 06 '11 at 21:45
  • 1
    re: no activity - thats because dBase (and all its forks) format is obsolete. – Free Consulting Feb 06 '11 at 23:59
  • Hi Worm. I have seen that. Sadly. The worst part is that the documentation is nonexistent. http://stackoverflow.com/questions/4920159/i-need-some-info-about-dbase-field-types – Gabriel Feb 07 '11 at 10:28
  • @Altar, at least being old means being very well-known too :-) – Free Consulting Feb 07 '11 at 10:52
  • Test TDBF is very stable. But you could have problems if you want later to upgrade your application to an Unicode version of Delphi (who knows the future of your success?). – Arnaud Bouchez Feb 07 '11 at 17:15
7

You could try SQLite. Its an excellent embedded database. Fast, reliable, and you cant beat the price (open source, public domain). There's a number of Delphi wrappers, or you can use the library directly if you want a light weight solution.

GrandmasterB
  • 3,396
  • 1
  • 23
  • 22
4

Two Open Source solutions (working from Delphi 6 up to XE):

  1. One ORM oriented solution, which can store data using SQLite or a pure Delphi storage. It can be either as stand-alone, either as Client/Server.

  2. One very fast pure Delphi NoSQL table storage engine. Sample benchmark was able to store 1,000,000 records with one integer and one text field in 800 ms (with automatic index creation). You create your own table columns, then access the fields content via Late-Binding.

Arnaud Bouchez
  • 42,305
  • 3
  • 71
  • 159
  • +1 I haven't had time to test the table, but I'm 100% sure that it's well written and reliable like all synopse products, cheers A. –  Feb 07 '11 at 16:57
3

If have some budget to spend, give AnyDAC a try. It provides native and embedded SQLite access, so you don't even have to ship an external DLL.

Leonardo Herrera
  • 8,388
  • 5
  • 36
  • 66
  • UniDac is so much better http://www.devart.com/unidac/ but that's my personal opinion... –  Feb 07 '11 at 16:55
  • Really? I would love to hear more about it. I'm using AnyDAC and I'm pleased with it, but I don't know much about UniDAC. – Leonardo Herrera Feb 07 '11 at 20:18
  • 1
    Huh ? I have backward experience with UniDac. Compare AnyDAC and UniDac SQLite drivers - AnyDAC is unbeatable. Static linking, encryption, their service components, documentation. – oodesigner Jul 03 '11 at 14:03
1

I have tried (arranged by lightweight):

  • NexusDB - commercial, too big for what I need; adds quite some overhead
  • DISQLite - seems powerful; difficult to use
  • kbmMemTable - commercial, UNDOCUMENTED FOR TRIAL USERS (it cannot be trialed unless you purchase the documentation, first which befits the purpose of the TRIAL concept)
  • TDBF - free but not maintained anymore; also it totally lacks of documentation
  • Synopse BigTable - seems to be the solution that I need. It consists in 2 PAS files only.

In some situations a custom system may fit better that a general one. So, for what I need, I will tailor my own system. Because I know the size/type of the data I can make fields that perfectly fit my data. The DB size will be smaller this way and faster (plus it is free). :)

Solution: How to store dynamic data (unknown number of fields) to a file?

Community
  • 1
  • 1
Gabriel
  • 20,797
  • 27
  • 159
  • 293
1

TurboPower FlashFiler

Jørn E. Angeltveit
  • 3,029
  • 3
  • 22
  • 53
  • That code hasn't been actively maintained since it was released in 2003. – Thorsten Engler Feb 07 '11 at 04:59
  • 1
    @Thorsen: I know, But I guess it will do for Delphi 7? – Jørn E. Angeltveit Feb 07 '11 at 06:36
  • 1
    Well, there were a number of bugs in the last released version of FlashFiler and as far as I'm aware there has been no work done on FF at all since it was open sourced. Also there are a number of fundamental design issues with it. That's one of the reasons why I developed NexusDB from scratch as spiritual successor to FlashFiler. I'm probably not really objective about it ;) but IMO, given the requirements of the questioner, the free embedded version of NexusDB would be a much better option than FlashFiler. – Thorsten Engler Feb 07 '11 at 10:35
  • @Thorsten (with both t's this time...:), I'm not familiar with NexusDB, but I know that you have done a great job on this project. Kudos! I don't doubt at all that NexusDB is better than FF, I just wanted OP to be aware of the project. – Jørn E. Angeltveit Feb 07 '11 at 11:17
0
  1. JvCSVDataSet and JvCSVBase from JVCL
  2. kbmMemTable
  3. Embedded Firebird server
  4. jbDBF
avra
  • 3,690
  • 19
  • 19
  • kbmMemTable really sucks. It cannot be trialed because the help file of this commercial component is not available unless you pay for it (separately). So, no manual = no chance to trial it. – Gabriel Feb 11 '11 at 17:17
-2

While the manual is paid for, the actual component is available for free, including a pretty extensive demo application showing lots of the features. In addition there are lots and lots of information on the internet about how to use it. Use www.codenewsfast.com or google.com to search for it.

best regards Kim Madsen kbm@components4developers.com