User's Guide for SqlitePass Database Components

Version 0.45 Last Revision 2009-10-04

The SqlitePass components project planes to provide a easy and fast access to sqlite databases. The Installation packages registers three components in the IDE :


At the moment, these components support reading from / writing to databases created with :



This project is open source, released under LGPL license.
Libraries and components are free and currently tested with Delphi 4 & 6 and Delphi 2009 - Lazarus 0.9.29 – FPC 2.2.4 From 0.45 version, the components should be "unicode friendly".

The library will not be considered as "stable" until the 1.0 release. Let me know in you want to use those components with other Delphi versions.


  1. Packages Installation
    1. Packages Installation for Delphi users
    2. Packages Installation for Lazarus users (>=0.9.20)
  2. Quick Start
    1. A Demo application : SqliteToolbox
    2. A simple application
  3. Packages Description - Content of /SQLitePass_x.xx Directory
    1. Content of /Demo Directory
    2. Content of /Documentation Directory
    3. Content of /Packages Directory
    4. Content of /Sources Directory
      1. Content of /Sources/DesignTimeEditors



Packages Installation

From version 0.28, SqlitePass uses a special Sqlite library version (sqlitepass3.dll or libsqlitepass3.so) as the default sqlite library

This library exports the following functions to get schema information from an sql statement :


The compiled win32 (sqlitepass3.dll) and the Linux-i386 (libsqlitepass3.so) versions of this library are included in ..\SQLitePass\SqliteLibrary. A tutorial on how to compile the library is available on the SqlitePass website. This file (sqlite3.dll or sqlite3.so) should be placed in a system directory, ..\Windows\system32 for example.
Note : From version 3.6.7, the official standard sqlite library already includes the required functions (tested with windows) and was just renamed to sqlitepass3.dll without any other changes.

Packages Installation for Delphi users

Delphi users (Delphi 4 example. Should apply for further Delphi versions) :

  1. Uninstall any previous version of SqlitePassDbo components : Choose [Components] [Install Packages] from IDE menu.

  2. Select the SqlitePass package and click Remove.

  3. Compile Runtime package : Choose [File] [Open] from the IDE menu and select ..\SQLitePass\Packages\Delphi4\D4_SqlitePassDbo_Runtime.dpk. Compile this package and move the resulting file from SQLitePass_vX.XX\Packages\Delphi4\D4_SqlitePassDbo_Runtime.bpl to a directory inluded in the Delphi search path (like ..\Delphi4\Bin or ..\Windows\system32 for example). Delete or overwrite any previous D4_SqlitePassDbo_Runtime.bpl.

  4. Compile and install Designtime package : Choose [File] [Open] from the IDE menu and select ..\SQLitePass\Packages\Delphi4\D4_SqlitePassDbo_Designtime.dpk. Compile this package, then choose install.

  5. Check installation : Select SqlitePassDbo on component palette pages and drop a SqlitePassDatabase and a SqlitePassDataset on a new form. Check the components versions are correct in object inspector.



Packages Installation for Lazarus users (>=0.9.20)

  1. Uninstall any previous version of SqlitePassDbo components : Choose [Components] [Configure Installed Packages] from IDE menu

  2. Select the Laz_SqlitePassDbo_Runtime and Laz_SqlitePassDbo_Designtime packages and click [Uninstall the selection] then [Save and quit the dialog].

  3. Compile and install Designtime package : Choose [File] [Open] from the IDE menu and select ..\SQLitePass\Packages\Lazarus\Laz_SqlitePassDbo_Designtime.lpk. In package dialog, Choose compile - this way, the Laz_SqlitePassDbo_Runtime will automatically be compiled. Then select install to rebuild the IDE.

  4. Check installation : Select SqlitePassDbo on Component palette pages and drop a SqlitePassDatabase and a SqlitePassDataset on a new form. Check the components versions are correct in object inspector.




Quick Start

A Demo application : SqliteToolbox

A demo application is available in ..\SQLitePass_x.xx\Demo\Sources.
This application was first developped as a simple test program for the SqlitePass components.

Du to many changes during developpement process and to avoid problems when changing properties behavior in IDE, the SqlitePassDatabase and SqlitePassDataset components are directly created by code at runtime.

This application tests also the designtime dialogs boxes used by the IDE Object Inspector. To do so, it links directly to *.pas | *.dfm | *.lfm files stored in ..\SQLitePass_x.xx\Sources\DesignTimeEditors directory.

The source code is (or will be) self documented and should cover the basic usage of the components.


A simple application

Another way is to describe a simple application using SqlitePass component.
It could look like this :

  1. Place a SqlitePassDatabase component on a form,

  2. Choose Database file the Database property (a database *.kexi file from ..\SQLitePass_x.xx\Demo\Databases for example),

  3. Set Connected property to True,

  4. Place a SqlitePassDataset component on the form

  5. Set Database property to the name of SqlitePassDatabase component (by default this is SqlitePassDatabase1),

  6. Select a dataset from the DatasetName property dialog editor,

  7. Set Active property to True.

  8. Place a standart Delphi or Lazarus DataSource component on the page,

  9. Set DataSet property to the name of the SqlitePassDataset component (by default this is SqlitePassDataset1)

  10. Place any DBAware component like DBGrid, DBNavigator...etc, on the form.

  11. Set DBGrid's, DBNavigator...etc, DataSource property to the name of DataSource component (by default this is DataSource1)

  12. This is it !




Packages Description - Content of /SQLitePass_x.xx Directory

Content of /Demo Directory

/Databases
Databases samples in Kexi or SqliteAdministrator format.

/Delphi4
Demo Project files for Delphi 4

/Lazarus
Demo Project files for Lazarus

/Sources
Source files for the demo project.



Content of /Documentation Directory

/UserGuide
The file you are reading...
Changes.odt or Changes.pdf Latest changes – Versions history


Content of /Packages Directory

Packages/Delphi4
D4_SqlitePassDbo_Runtime.dpk
Runtime package. Shoul be compiled first (see the installation section)

D4_SqlitePassDbo_Designtime.dpk
Designtime package, used to :



Packages/Delphi6
D6_SqlitePassDbo_Runtime.dpk
Runtime package. Shoul be compiled first (see the installation section)

D6_SqlitePassDbo_Designtime.dpk
Designtime package, used to :



Packages/Delphi7
D7_SqlitePassDbo_Runtime.dpk
Runtime package. Shoul be compiled first (see the installation section)

D7_SqlitePassDbo_Designtime.dpk
Designtime package, used to :



Packages/Packages/Lazarus
Laz_SqlitePassDbo_Runtime.dpk
Runtime package. Shoul be compiled first (see the installation section)

Laz_SqlitePassDbo_Designtime.dpk
Designtime package, used to :



Content of /Sources Directory

Components source files. Sources files are shared by Delphi and Lazarus
SqlitePassApi_v3.pas : Loads the external Sqlite engine library (sqlitepass3.dll or libsqlitepass3.so) and registers the sqlite functions to be used by the SqlitePass components. SqlitePassDbo.inc : Include file used to define compiler settings...etc
SqlitePassDbo.pas : SqlitePass Database Objects interfaces definitions. Implementations are stored in


SqlitePassDbo.lrs : Lazarus ressource file used to dipslay components icons in IDE. SqlitePassConst.pas : Constant definitions
SqlitePassErrorLang.pas : Ressource strings for language support. To translate this file :


Only English file is available so far. A French one will be done shortly. Translators are welcome !
SqlitePassKexiDef.pas : Kexi specific constants definitions SqlitePassUtils.pas : Implements a TObjectList (The code is just a copy from FCL) and other objects, mainly to provide code compatibility between Delphi 4 and Lazarus.

Content of /Sources/DesignTimeEditors

The ../Sources/DesignTimeEditors : Dialogs boxes to help you during design process in IDE.




Designtime Editors Files descriptions :

RegisterSqlitePassDbo.pas
Registers and displays components and property editors in IDE.

SqlitePassChooseDatasetDialog.pas
Used by TsqlitePassDataset.Dataset property. Displays an treeview of available dataset in the current database.

SqlitePassIndexesDialog.pas
Used by TsqlitepassDataset.Indexes property. Displays a dialog to manage tables indexes.

SqlitePassCustomFieldDefsDialog.pas
Used by TsqlitePassDatabase.DataTypeOptions.CustomFieldDefs property. Display a dialog to manage custom field definitions

SqlitePassFieldDefsDialog.pas
Used by TsqlitepassDataset.FieldDefsInfo property. Display a dialog showing field definitions of the currently selected dataset.

SqlitePassSortByDialog.pas
Used by TsqlitepassDataset.SortedBy property. Displays a dialog to select fields to be sorted .

SqlitePassDataTypesDialog.pas
Used by TsqlitePassDatabase.DataTypeOptions.TranslationRules property. Display a dialog to manage TranslationRules.

SqlitePassMasterDetailFieldsDialog.pas
Used by TsqlitepassDataset.MasterFields property. Displays a dialog to link Master and Detail fields.

SqlitePassDesignErrorLang.pas
Defines DesignTime error messages.

CreateNewIndex.pas
Used by the indexes dialog when creating new table index.

RenameItem.pas
Used by the indexes dialog when renaming a existing table index.


Generated by PasDoc 0.11.0 on 2009-10-08 22:34:52