D2 TEKNIK KOMPUTER (BSI PROGRAMMER)
Tutorial Delphi Mobile Apps dengan Delphi XE5
Membuat koneksi database ke Android Apps dengan menggunakan FireDac (SQLite)
Berikut contoh direktori path dalam Android
procedure TDM.FDConnection1BeforeConnect(Sender: TObject);
begin
{$IFDEF ANDROID}
FDConnection1.Params.Values['Database']:= TPath.Combine(TPath.GetDocumentsPath, 'datainput.db3');
{$ELSE}
FDConnection1.Params.Values['Database']:= 'D:\Master HP 520\Delphi Component\BSI BORLAND DELPHI\Mobile\datainput.db3';
{$ENDIF}
end;
Open Connection Source Code
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
Datamodule.DM.FDQuery2.Close;
Datamodule.DM.FDQuery2.Open();
end;
Sumber : Youtube & KPPDI
Screenshut Program
begin
{$IFDEF ANDROID}
FDConnection1.Params.Values['Database']:= TPath.Combine(TPath.GetDocumentsPath, 'datainput.db3');
{$ELSE}
FDConnection1.Params.Values['Database']:= 'D:\Master HP 520\Delphi Component\BSI BORLAND DELPHI\Mobile\datainput.db3';
{$ENDIF}
end;
Open Connection Source Code
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
Datamodule.DM.FDQuery2.Close;
Datamodule.DM.FDQuery2.Open();
end;
Sumber : Youtube & KPPDI
Screenshut Program
Tags
BSI