Skip to content

Commit 5db815c

Browse files
committed
Make sure the connection to SQL demo database is opened
1 parent cb3d637 commit 5db815c

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
object SampleData: TSampleData
2+
OnCreate = DataModuleCreate
23
Height = 337
34
Width = 267
45
object Sqlite_demoConnection: TFDConnection
56
Params.Strings = (
67
'ConnectionDef=SQLite_Demo')
78
LoginPrompt = False
8-
Left = 47
9+
Left = 111
910
Top = 22
1011
end
1112
object CustomersTable: TFDQuery
@@ -14,7 +15,7 @@ object SampleData: TSampleData
1415
FetchOptions.RecordCountMode = cmTotal
1516
SQL.Strings = (
1617
'SELECT * FROM Customers')
17-
Left = 47
18+
Left = 111
1819
Top = 85
1920
end
2021
object OrdersTable: TFDQuery
@@ -24,7 +25,7 @@ object SampleData: TSampleData
2425
SQL.Strings = (
2526
'SELECT * FROM Orders'
2627
'where CustomerID = :Cust')
27-
Left = 49
28+
Left = 105
2829
Top = 147
2930
ParamData = <
3031
item
@@ -33,7 +34,7 @@ object SampleData: TSampleData
3334
end>
3435
end
3536
object FDStanStorageBinLink1: TFDStanStorageBinLink
36-
Left = 120
37+
Left = 104
3738
Top = 216
3839
end
3940
end

demos/FireMonkey/Database/Master_Detail_FireDAC/Customer_Orders.pas

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ TSampleData = class(TDataModule)
1717
CustomersTable: TFDQuery;
1818
OrdersTable: TFDQuery;
1919
FDStanStorageBinLink1: TFDStanStorageBinLink;
20+
procedure DataModuleCreate(Sender: TObject);
2021
private
2122
{ Private declarations }
2223

@@ -36,6 +37,11 @@ implementation
3637

3738
{$R *.dfm}
3839

40+
procedure TSampleData.DataModuleCreate(Sender: TObject);
41+
begin
42+
Sqlite_demoConnection.Open;
43+
end;
44+
3945
function TSampleData.OrdersOfCustomer(const ARecNo:Integer):TDataSet;
4046

4147
// Return the CustomerID for row: ARow

0 commit comments

Comments
 (0)