-
Notifications
You must be signed in to change notification settings - Fork 0
/
SICovid.Dados.pas
51 lines (42 loc) · 1.32 KB
/
SICovid.Dados.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
unit SICovid.Dados;
interface
uses
System.SysUtils, System.Classes, FireDAC.Stan.Intf, FireDAC.Stan.Option,
FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def,
FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.SQLite,
FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs, FireDAC.Stan.Param,
FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, FireDAC.FMXUI.Wait,
FireDAC.Phys.SQLiteWrapper.Stat, FireDAC.Comp.UI, Data.DB,
FireDAC.Comp.DataSet, FireDAC.Comp.Client;
type
TDtmDados = class(TDataModule)
FDConexao: TFDConnection;
FDRegistroInsert: TFDQuery;
FDGUIxWaitCursor1: TFDGUIxWaitCursor;
FDPhysSQLiteDriverLink1: TFDPhysSQLiteDriverLink;
FDRegistroQuery: TFDQuery;
FDLoginQuery: TFDQuery;
procedure DataModuleCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
DtmDados: TDtmDados;
implementation
{%CLASSGROUP 'FMX.Controls.TControl'}
{$R *.dfm}
uses
System.IOUtils;
procedure TDtmDados.DataModuleCreate(Sender: TObject);
begin
{$IF Defined(ANDROID)}
FDConexao.Params.Values['Database'] := TPath.Combine(TPath.GetDocumentsPath,
'sicovid.db');
{$ELSEIF Defined(MSWINDOWS) or Defined(LINUX)}
FDConexao.Params.Values['Database'] := 'sicovid.db';
{$ENDIF}
FDConexao.Connected := true;
end;
end.