-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathudmJsonConvert.pas
More file actions
70 lines (58 loc) · 1.96 KB
/
udmJsonConvert.pas
File metadata and controls
70 lines (58 loc) · 1.96 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
unit udmJsonConvert;
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.VCLUI.Wait, FireDAC.Phys.SQLiteWrapper.Stat,
FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client;
type
TdmJsonConvert = class(TDataModule)
cnSqlite: TFDConnection;
FDPhysSQLiteDriverLink1: TFDPhysSQLiteDriverLink;
qryCustomers: TFDQuery;
qryCustomersCustomerId: TFDAutoIncField;
qryCustomersFirstName: TWideStringField;
qryCustomersLastName: TWideStringField;
qryCustomersCity: TWideStringField;
qryCustomersState: TWideStringField;
qryInvoices: TFDQuery;
qryInvoiceItems: TFDQuery;
srcCustomers: TDataSource;
srcInvoices: TDataSource;
qryInvoicesInvoiceId: TFDAutoIncField;
qryInvoicesCustomerId: TIntegerField;
qryInvoicesInvoiceDate: TDateTimeField;
qryInvoicesTotal: TBCDField;
qryInvoiceItemsInvoiceId: TIntegerField;
qryInvoiceItemsInvoiceLineId: TFDAutoIncField;
qryInvoiceItemsTrackId: TIntegerField;
qryInvoiceItemsUnitPrice: TBCDField;
qryInvoiceItemsQuantity: TIntegerField;
procedure DataModuleDestroy(Sender: TObject);
procedure DataModuleCreate(Sender: TObject);
public
procedure OpenTables;
end;
var
dmJsonConvert: TdmJsonConvert;
implementation
{%CLASSGROUP 'Vcl.Controls.TControl'}
{$R *.dfm}
uses
IOUtils;
procedure TdmJsonConvert.DataModuleCreate(Sender: TObject);
begin
cnSqlite.Params.Database := TPath.Combine(ExtractFilePath(ParamStr(0)), 'chinook.db');
cnSqlite.Open;
end;
procedure TdmJsonConvert.DataModuleDestroy(Sender: TObject);
begin
cnSqlite.Close;
end;
procedure TdmJsonConvert.OpenTables;
begin
qryCustomers.Open;
qryInvoices.Open;
qryInvoiceItems.Open;
end;
end.