Embeded DB for Firemonkey apps

喜欢而已 提交于 2019-12-04 19:45:25

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;

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).

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!