User's Guide for SqlitePass Database Components

Version 0.55 - Last Revision 2010-09-10

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, Delphi 2009 & 2010 - Lazarus 0.9.29 – FPC 2.4.1.
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 /Documentation Directory
    2. Content of /Packages Directory
    3. Content of /Sources Directory
      1. Content of /Sources/DesignTimeEditors



Packages Installation

At first, you need to install the SQLite library.
From version 0.51, SqlitePass components don't need a special Sqlite library version anymore and use directly the one provided at http://www.sqlite.org/download.html



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 the Laz_SqlitePassDbo_Runtime package. Compile and install the 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 with source is available from http://source.online.free.fr
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 available on request, is 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 /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/Delphi2009
D2009_SqlitePassDbo_Runtime.dpk
Runtime package. Shoul be compiled first (see the installation section)

D2009_SqlitePassDbo_Designtime.dpk
Designtime package, used to :



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

D2010_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 (sqlite3.dll or libsqlite3.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 !
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.

ChooseDataset


SqlitePassIndexedByDialog.pas Used by TsqlitepassDataset.Indexes property. Displays a dialog to manage tables in memory indexes.

IndexedBy Editor


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

IndexesDefDialog


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

CustomFieldDefs


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

Fields definitions for dataset


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

SortByDialog


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

DataTypesMapping


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

MasterDetail


SqlitePassParamsDialog.pas
Used by TsqlitepassDataset.Params property. Displays a dialog to display and set query parameters.

Params


SqlitePassDesignErrorLang.pas
Defines DesignTime error messages.

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

Create a new index


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

Rename a database item



Generated by PasDoc 0.11.0 on 2010-09-10 15:54:38