-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathFDConnectionConfigU.pas
More file actions
44 lines (36 loc) · 833 Bytes
/
Copy pathFDConnectionConfigU.pas
File metadata and controls
44 lines (36 loc) · 833 Bytes
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
unit FDConnectionConfigU;
interface
const
CON_DEF_NAME = 'MyConnX';
procedure CreateSqlitePrivateConnDef(AIsPooled: boolean);
implementation
uses
System.Classes,
System.IOUtils,
FireDAC.Comp.Client,
FireDAC.Stan.Intf;
procedure CreateSqlitePrivateConnDef(AIsPooled: boolean);
var
LParams: TStringList;
lFName: string;
begin
LParams := TStringList.Create;
try
lFName := TPath.Combine(TPath.GetDirectoryName(ParamStr(0)), 'todo.db');
LParams.Add('Database=' + lFName);
LParams.Add('StringFormat=Unicode');
if AIsPooled then
begin
LParams.Add('Pooled=True');
LParams.Add('POOL_MaximumItems=200');
end
else
begin
LParams.Add('Pooled=False');
end;
FDManager.AddConnectionDef(CON_DEF_NAME, 'SQLite', LParams);
finally
LParams.Free;
end;
end;
end.