This sample shows the use of FireDAC database connection using SQLite. Also, it shows how to use a TBindNavigator control.
Table of Contents
Location
You can find the FMGettingStarted project at:
- Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to:
- Object PascalDatabaseFireDACSamplesGetting Started FMXSQLite_Desktop
- Subversion Repository:
- You can find Delphi code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.
How to Use the Sample
- Navigate to the location given above and open FMGettingStarted.dproj.
- Press F9 or choose Run > Run.
- Click the Open button and the database’s data will appear in the grid.
- Choose a database and enter your password or use the default database which has no password.
- Navigate through the data using the TBindNavigator.
Files
File | Contains |
---|---|
FMGettingStarted.dproj | Contains the project itself. |
MainFrm.fmx | Contains the main form code. |
MainFrm.pas | contains the main form and the main code. |
Implementation
- The project uses a TFDConnection that establishes a connection with a database. In this case FDDemo.sdb which can be found at Samples > data > FDDemo.sdb. In order to navigate through the data, the project uses TFDQuery, TDataSource, TFDPhysSQLiteDriverLink, TFDGUIxLoginDialog, TFDGUIxWaitCursor and TBindNavigator.
- The TFDQuery executes a SELECT query against the Territories table.
- The application also uses a TStringGrid to display the database’s data.
If you would like to check the original post of Embarcadero, please visit the link below:
http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.SQLite_Desktop_Sample
Head over and check out all of the source code for the SQLite sample app for Windows in Delphi.