Class TSqlitePassDataset

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TSqlitePassDataset = class(TDataSet)

Description

The TSqlitePassDataset is a link between your application and the database content. TSqlitePassDataset enables you to access tables, queries or even to create direct SQL queries to read and write data from/to your database.

Hierarchy

Overview

Methods

Public Constructor Create(AOwner: TComponent); override;
Public Destructor Destroy; override;
Public Function BookmarkValid(Bookmark: TBookmark): Boolean; override;
Public Function CompareBookmarks(Bookmark1, Bookmark2: TBookmark): Integer; override;
Public Function CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; override;
Public Function GetFieldData(Field: TField; Buffer: Pointer): Boolean; override;
Public function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean; override;
Public function LocateFirst: Boolean;
Public function LocateLast: Boolean;
Public function LocateNext: Boolean;
Public function LocatePrior: Boolean;
Public function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant; override;
Public function LookupFirst: Variant;
Public function LookUpLast: Variant;
Public function LookupNext: Variant;
Public function LookupPrior: Variant;
Public Procedure ApplyChanges;
Public Procedure ApplyFilter;
Public Procedure CancelChanges;
Public procedure CloseBlob(Field: TField); override;
Public Procedure EmptyTable;
Public Procedure Sort;

Properties

Published property Active;
Published property AfterCancel;
Published property AfterClose;
Published property AfterDelete;
Published property AfterEdit;
Published property AfterInsert;
Published property AfterOpen;
Published property AfterPost;
Published property AfterScroll;
Published property AutoCalcFields;
Published property BeforeCancel;
Published property BeforeClose;
Published property BeforeDelete;
Published property BeforeEdit;
Published property BeforeInsert;
Published property BeforeOpen;
Published property BeforePost;
Published property BeforeScroll;
Published property Database: TSqlitePassDatabase Read GetFDatabase Write SetFDatabase;
Published property DatabaseAutoActivate: Boolean Read FDatabaseAutoActivate Write FDatabaseAutoActivate;
Published property DatasetName: String Read FDatasetName Write SetFDatasetName;
Public property DatasetType: TSqlitePassDatasetType Read FDatasetType;
Published property ExportMethod: TSqlitePassDatasetExportMethod Read FExportMethod Write FExportMethod;
Published property Filter;
Published property Filtered;
Published property FilterOptions;
Published property FilterRecordLowerLimit: Cardinal Read FFilterRecordLowerLimit Write SetFFilterRecordLowerLimit;
Published property FilterRecordUpperLimit: Cardinal Read FFilterRecordUpperLimit Write setFFilterRecordUpperLimit;
Published property IndexDefs: TSqlitePassDatasetIndexDefs Read FIndexDefs Write FIndexDefs;
Public property LocateMoveState: TGetResult read FLocateMoveState;
Public property LocateRecordCount: Integer Read GetLocateRecordCount;
Published property LocateSmartRefresh: Boolean Read FLocateSmartRefresh Write FLocateSmartRefresh;
Published property LookUpCache: Boolean Read FLookUpCache Write SetFLookUpCache;
Published property LookUpMaxRecordCount: Integer Read FLookUpMaxRecordCount Write FLookUpMaxRecordCount;
Published property LookUpOptions: TLocateOptions Read FLookUpOptions Write FLookUpOptions;
Published property LookUpSmartRefresh: Boolean Read FLookUpSmartRefresh Write FLookUpSmartRefresh;
Published property MasterFields: string read GetMasterFields write SetMasterFields;
Published property MasterSource: TDataSource read GetMasterDataSource write SetMasterDataSource;
Published property MasterSourceAutoActivate: Boolean read FMasterAutoActivate write FMasterAutoActivate;
Published property OnCalcFields;
Published property OnDeleteError;
Published property OnEditError;
Published property OnExportProgress: TSqlitePassDatasetExportProgressEvent Read FOnExportProgress Write FOnExportProgress;
Published property OnFilterRecord : TSqlitePassDatasetFilterRecordEvent read FOnFilterRecord write FOnFilterRecord;
Published property OnImportProgress: TSqlitePassDatasetImportProgressEvent Read FOnImportProgress Write FOnImportProgress;
Published property OnNewRecord;
Published property OnPostError;
Published property ParamCheck: Boolean Read FParamCheck Write FParamCheck;
Public property ParamCount: Integer read GetParamsCount;
Published property Params: TParams read FParams Write SetParamsList Stored False;
Published property ProcessMessages: Boolean Read FProcessMessages Write FProcessMessages;
Published property ReadOnly: Boolean Read GetFReadOnly Write SetFReadOnly default False;
Published property RecordsCacheCapacity: TSqlitePassRecordsCacheCapacity Read FRecordsCacheCapacity Write FRecordsCacheCapacity;
Published property SortCaclFields: Boolean Read FSortCalcFields Write SetFSortCalcFields;
Published property Sorted: Boolean Read FSorted Write SetFSorted;
Published property SortedBy: String Read FSortedBy Write SetFSortedBy;
Public property SortMode: TSqlitePassSortMode Read FSortMode Write SetFSortMode;
Published property SQL: TStringList Read FSQL Write SetFSQL;
Public property SQLSelectStmt: TSqlitePassSelectStmt Read FSQLSelectStmt;
Published property VersionInfo: TSqlitePassDatasetVersionInfo Read FVersionInfo Write FVersionInfo;
Published property WriteMode: TSqlitePassWriteMode Read FWriteMode Write SetFWriteMode;

Description

Methods

Public Constructor Create(AOwner: TComponent); override;

—– Constructor - Destructor —–

Public Destructor Destroy; override;
 
Public Function BookmarkValid(Bookmark: TBookmark): Boolean; override;

—– Bookmarks —–

Public Function CompareBookmarks(Bookmark1, Bookmark2: TBookmark): Integer; override;
 
Public Function CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; override;

—– Blobs —–

Public Function GetFieldData(Field: TField; Buffer: Pointer): Boolean; override;

—– —–

Public function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean; override;

—– Locate —–

Public function LocateFirst: Boolean;
 
Public function LocateLast: Boolean;
 
Public function LocateNext: Boolean;
 
Public function LocatePrior: Boolean;
 
Public function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant; override;

—– Lookup —–

Public function LookupFirst: Variant;
 
Public function LookUpLast: Variant;
 
Public function LookupNext: Variant;
 
Public function LookupPrior: Variant;
 
Public Procedure ApplyChanges;

—– Apply or Cancel records modification if WriteMode is wmPostpone —–

Public Procedure ApplyFilter;

—– —–

Public Procedure CancelChanges;
 
Public procedure CloseBlob(Field: TField); override;
 
Public Procedure EmptyTable;
 
Public Procedure Sort;
 

Properties

Published property Active;

Classic dataset behavior. When set to True, opens the dataset and displays data if dataware components are linked to the datasource. When set to False, closes the dataset and frees the memory used to store dataset records.

Published property AfterCancel;
 
Published property AfterClose;
 
Published property AfterDelete;
 
Published property AfterEdit;
 
Published property AfterInsert;
 
Published property AfterOpen;
 
Published property AfterPost;
 
Published property AfterScroll;
 
Published property AutoCalcFields;

Published property BeforeCancel;
 
Published property BeforeClose;
 
Published property BeforeDelete;
 
Published property BeforeEdit;
 
Published property BeforeInsert;
 
Published property BeforeOpen;

Published property BeforePost;
 
Published property BeforeScroll;
 
Published property Database: TSqlitePassDatabase Read GetFDatabase Write SetFDatabase;

Selects the TsqlitePassDatabase component you want to depend on.

Published property DatabaseAutoActivate: Boolean Read FDatabaseAutoActivate Write FDatabaseAutoActivate;

When set to True, opens automatically the database if needed.

Published property DatasetName: String Read FDatasetName Write SetFDatasetName;

Once you are connected to a database, enters a table name or a query name. At design time, a dialog will let you choose your dataset among all the available database datasets.

Public property DatasetType: TSqlitePassDatasetType Read FDatasetType;

This property is only read. It gives you information about the currently selected dataset and can be one of the following values :

dtUnkown : The dataset type could not be recognized or the DatasetName property is empty.

dtTable : The dataset is a table.

dtQuery : The dataset is a query.

dtView : The dataset is a view.

dtSqlDirect : The SQL property has been modified or you entered a new SQL query. When the SQL text is changed, the DatasetName will automatically be set to '' assuming that the DatasetName and SQL text don't match anymore.

Published property ExportMethod: TSqlitePassDatasetExportMethod Read FExportMethod Write FExportMethod;
 
Published property Filter;

Classic dataset filter behavior. The filter property takes a SQL WHERE clause but without the WHERE word at the begining. You can also use wildcard characters as discribed in the Sqlite help.

Example1 : country = 'France' Example1 : customer like '%cur%'

Published property Filtered;

Determines whether or not the different filters are activated. The TsqlitePassDataset component can handle three filter levels that will be applied in this priority order :

1 : MasterFields/DetailFields property 2 : Filter property 3 : RecordLowerLimit/RecordUpperLimit properties

Published property FilterOptions;
 
Published property FilterRecordLowerLimit: Cardinal Read FFilterRecordLowerLimit Write SetFFilterRecordLowerLimit;

FilterRecordLowerLimit is the lower limit of the range filter. If greater than 1, the -nth first records will not be retrieved. In other words, if FilterLowerLimit = 4, the fifth record will be the first one retrieved from the query.

Published property FilterRecordUpperLimit: Cardinal Read FFilterRecordUpperLimit Write setFFilterRecordUpperLimit;

FilterRecordUpperLimit is the upper limit of the range filter.

If greater than 1, the -nth first records will be retrieved. In other words, if FilterUpperLimit = 4 and FilterLowerLimit = 0 then only the four first records will be retrieved from the query.

If lesser than 0, the -nth last records will be retrieved. In other words, if FilterUpperLimit = -9 and FilterLowerLimit = 0 then only the nine last records will be retrieved from the query.

Published property IndexDefs: TSqlitePassDatasetIndexDefs Read FIndexDefs Write FIndexDefs;

The IndexDefs property gives you access to the indexes definitions for the selected table. Indexes are only available if the DatasetType is a 'dtTable' type.

Public property LocateMoveState: TGetResult read FLocateMoveState;
 
Public property LocateRecordCount: Integer Read GetLocateRecordCount;
 
Published property LocateSmartRefresh: Boolean Read FLocateSmartRefresh Write FLocateSmartRefresh;
 
Published property LookUpCache: Boolean Read FLookUpCache Write SetFLookUpCache;
 
Published property LookUpMaxRecordCount: Integer Read FLookUpMaxRecordCount Write FLookUpMaxRecordCount;
 
Published property LookUpOptions: TLocateOptions Read FLookUpOptions Write FLookUpOptions;
 
Published property LookUpSmartRefresh: Boolean Read FLookUpSmartRefresh Write FLookUpSmartRefresh;
 
Published property MasterFields: string read GetMasterFields write SetMasterFields;

Classic table MasterFields behavior.

At design time, a dialog will let you create or modify the relation between MasterFields and DetailFields.

A relation is defined like this : MasterFieldName=DetailFieldName If you want set several relations, they must be separated by a ';' MasterFieldName1=DetailFieldName1;MasterFieldName2=DetailFieldName2

Published property MasterSource: TDataSource read GetMasterDataSource write SetMasterDataSource;

Classic table MasterSource behavior.

Published property MasterSourceAutoActivate: Boolean read FMasterAutoActivate write FMasterAutoActivate;
 
Published property OnCalcFields;
 
Published property OnDeleteError;
 
Published property OnEditError;
 
Published property OnExportProgress: TSqlitePassDatasetExportProgressEvent Read FOnExportProgress Write FOnExportProgress;

Additionnal Events

Published property OnFilterRecord : TSqlitePassDatasetFilterRecordEvent read FOnFilterRecord write FOnFilterRecord;
 
Published property OnImportProgress: TSqlitePassDatasetImportProgressEvent Read FOnImportProgress Write FOnImportProgress;
 
Published property OnNewRecord;
 
Published property OnPostError;
 
Published property ParamCheck: Boolean Read FParamCheck Write FParamCheck;
 
Public property ParamCount: Integer read GetParamsCount;

—– Properties —–

Published property Params: TParams read FParams Write SetParamsList Stored False;
 
Published property ProcessMessages: Boolean Read FProcessMessages Write FProcessMessages;
 
Published property ReadOnly: Boolean Read GetFReadOnly Write SetFReadOnly default False;
 
Published property RecordsCacheCapacity: TSqlitePassRecordsCacheCapacity Read FRecordsCacheCapacity Write FRecordsCacheCapacity;
 
Published property SortCaclFields: Boolean Read FSortCalcFields Write SetFSortCalcFields;
 
Published property Sorted: Boolean Read FSorted Write SetFSorted;

Determines whether or not the sortedBy property is activated.

Published property SortedBy: String Read FSortedBy Write SetFSortedBy;

The SortedBy property takes a SQL ORDERBY clause but without the 'ORDER BY' expression at the begining. At design time, a dialog will let you create or modify the sort order.

Example : 'car_names ASC, car_types DESC'.

Public property SortMode: TSqlitePassSortMode Read FSortMode Write SetFSortMode;
 
Published property SQL: TStringList Read FSQL Write SetFSQL;

SQL represents the SQL statement used to retrieve data from the database.

For tables, it will automatically be set to :

SELECT * FROM TableName; if all fields need to be retrieved from the table, or to :

SELECT field1, field2... FROM TableName; if only some fields need to be retrieved from the table.

For queries, it will reflect the query SQL statement. You can also directly write your own SQL statement to fit your needs or to interact directly with the database. In this case, the datasetname propery will be set to '' (empty) and the datasetType will be set to dtDirectSql.

Public property SQLSelectStmt: TSqlitePassSelectStmt Read FSQLSelectStmt;
 
Published property VersionInfo: TSqlitePassDatasetVersionInfo Read FVersionInfo Write FVersionInfo;
 
Published property WriteMode: TSqlitePassWriteMode Read FWriteMode Write SetFWriteMode;
 

Generated by PasDoc 0.11.0 on 2009-01-11 21:18:00