SqLite is now replaced with XE6 + intraweb v14.0.32 Ultimate for use with FireDAC (XE5 start support).
First copy the officially provided C:\USERS\PUBLIC\DOCUMENTS\EMBARCADERO\STUDIO\14.0\SAMPLES\DATA\FDDEMO.SDB to the program directory for testing.
To add a control on a blank form:
FDPhysSQLiteDriverLink1: TFDPhysSQLiteDriverLink;
FDGUIxWaitCursor1: TFDGUIxWaitCursor;
FDConnection1: TFDConnection;
DataSource1: TDataSource;
FDTable1: TFDTable;
IWDBGrid1: TIWDBGrid;
Write the code in the OnCreate event:
procedure TIWForm1.IWAppFormCreate (Sender: TObject);
begin
FDTable1.Connection: = FDConnection1;
DataSource1.DataSet: = FDTable1;
IWDBGrid1.DataSource: = DataSource1;
FDConnection1.DriverName: = ‘SQLite’;
FDConnection1.Params.Add (‘Database = FDDemo.sdb’); // If the test data is in another directory, such as: Database = C: \ Temp \ FDDemo.sdb; But if you really put it on the network, I am afraid there are permission restrictions
FDTable1.TableName: = ‘Orders’; // Orders is a table in FDDemo.sdb
FDTable1.Active: = True;
IWDBGrid1.Align: = alClient;
end;
:
Tfdquery instead of tfdtable re-test:
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
FDQuery1.Connection := FDConnection1;
DataSource1.DataSet := FDQuery1;
IWDBGrid1.DataSource := DataSource1;
FDConnection1.Open(‘DriverID=SQLite;Database=FDDemo.sdb‘);
FDQuery1.Open(‘SELECT * FROM Orders‘);
IWDBGrid1.Align := alClient;
end;