Wizzard
Wizzard

Reputation: 12712

Embeded DB for Firemonkey apps

Creating a client application, want the whole DB to be embed in the software or in a single standalone dll (ie sqlite), not something like mysql.

Whats built into XE2 which would work 'out of the box' and not need thirdparty tools?

Other than TClientDataSet / xml files :)

Upvotes: 1

Views: 2494

Answers (3)

Mohammed Nasman
Mohammed Nasman

Reputation: 11070

Also you may look at NexusDB Embedded, which is native Delphi solution, and doesn't require any Dlls.

Upvotes: 1

Linas
Linas

Reputation: 5545

You can use my SQLite wrapper (also some more info in my blog) which supports multiple platforms. In Windows you'll need to deploy sqlite3.dll with your application, there is no need for this on OSX. You can get sources from the svn. Example usage:

uses
  SQLiteTable3,
  {$IFDEF DELPHI16_UP}
  System.SysUtils;
  {$ELSE}
  SysUtils;
  {$ENDIF}

procedure Demo;
var
  slDBpath: string;
  db: TSQLiteDatabase;
  pstm TSQLitePreparedStatement;
begin
  slDBpath := IncludeTrailingPathDelimiter(GetHomePath) + 'test.db';
  db := TSQLiteDatabase.Create(slDBpath);
  try
    if db.TableExists('testtable') then
    begin
      pstm := TSQLitePreparedStatement.Create(db,
        'insert into testtable (name,number) values (?,?)',  //sql statement
        ['NewRec', 99.99]); //parameter values
      try
        pstm.ExecSQL;
      finally
        pstm.Free;
      end;
    end;

  finally
    db.Free;
  end;
end;

Upvotes: 3

Whiler
Whiler

Reputation: 8086

Firebird is available with XE2... For a single user usage, you don't need to run a service to access it (but you'll need the firebird client and the vendor dll to access it).

Upvotes: 3

Related Questions