Sign in Join
FPDoc Onlineexperiment

DB unit

Database access layer.

The db unit provides the basis for all database access mechanisms. It introduces abstract classes, on which all database access mechanisms are based: TDataset representing a set of records from a database, TField which represents the contents of a field in a record, TDatasource which acts as an event distributor on behalf of a dataset and TParams which can be used to parameterize queries. The databases connections themselves are abstracted in the TDatabase class.

Classes and records

EDatabaseErrorclassBase class for all database-related errors.
EUpdateErrorclassError raised when updating data during a post operation.
IProviderSupportinterfaceInterface for Provider support.
TArrayFieldclass
TAutoIncFieldclassField for auto-incremental, 32-bit signed integer data.
TBCDFieldclassField class for Binary Coded Decimal (BCD) values.
TBinaryFieldclassField class for working with binary field data.
TBlobFieldclassBase class for BLOB field data.
TBooleanFieldclassBoolean field class type.
TByteFieldclassField class for 8-bit unsigned integer data.
TBytesFieldclassField class for fixed size byte array values.
TCheckConstraintclassRecord-level constraint definition.
TCheckConstraintsclassSet of record-level constraints.
TCurrencyFieldclassClass for currency fields.
TCustomConnectionclassAbstract class for connections to a server.
TDatabaseclassBase class for connecting a FreePascal application to an external Database engine.
TDataLinkclassData event handling agent for controls.
TDataSetclassBase class for records-based data-access.
TDataSetEnumeratorclassEnumerator for TDataset records.
TDataSourceclassComponent representing the link between a local (GUI) component and a dataset.
TDateFieldclassField class for date values.
TDateTimeFieldclassField class for date/time/Datetime values.
TDateTimeRecrecordDate/Time record.
TDBDatasetclassDataset connected to a database.
TDBTransactionclassEncapsulate a transaction.
TDefCollectionclassDefinition collection.
TDetailDataLinkclassRepresents the link between a detail data source and a master datasource.
TExtendedFieldclass
TFieldclassProvide access to the contents of a single field in a record.
TFieldDefclassClass to describe one field in a record in a dataset.
TFieldDefsclassCollection of TFieldDef instances.
TFieldsclassCollection of instances.
TFieldsEnumeratorclassDefault enumerator for the fields collection of a dataset.
TFloatFieldclassClass for floating point values.
TFMTBCDFieldclassFixed precision floating point data field.
TGraphicFieldclassField class for graphical BLOB field data.
TGuidFieldclassField class for native variant data.
TIndexDefclassIndex definition.
TIndexDefsclassA class to keep a list of index definitions.
TIntegerFieldclassAlias for TLongintField.
TLargeintFieldclassField class for 64-bit signed integer data.
TLongintFieldclassField class for 32-bit signed integer data.
TLongWordFieldclassField class for 32-bit unsigned integer data.
TLookupListclassClass to manage lookup list values.
TLookupListRecrecordRecord to store lookup results.
TMasterDataLinkclassDatalink for Master-Detail relationships between datasets.
TMasterParamsDataLinkclassClass to establish a master-detail relationship between dataset, based on parameters.
TMemoFieldclassBase class for MEMO (text BLOB) field data.
TNamedItemclassNamed collection item.
TNumericFieldclassBase class for all numerical data field classes.
TObjectFieldclass
TParamclassParameter description class.
TParamsclassA collection of parameter values for SQL-based datasets.
TParamsEnumeratorclassEnumerator for parameters.
TShortintFieldclassField class for 8-bit signed integer data.
TSingleFieldclass
TSmallintFieldclassField class for smallint (16-bit signed integer) data.
TStringFieldclassField class to handle ansistring fields.
TTimeFieldclassField class for time values.
TVarBytesFieldclassField class for variable size byte array values.
TVariantFieldclassField class for native variant data.
TWideMemoFieldclassField class for wide MEMO (widestring text BLOB) field data.
TWideStringFieldclassField class for widestring data.
TWordFieldclassField class for word (16-bit unsigned integer) data.

Procedures and functions

BuffersEqualfunctionCheck whether 2 memory buffers are equal.
DatabaseErrorprocedureRaise an EDatabaseError exception.
DatabaseErrorFmtprocedureRaise an EDatabaseError exception with a formatted message.
DateTimeRecToDateTimefunctionConvert TDateTimeRec record to a TDateTime value.
DateTimeToDateTimeRecfunctionConvert TDateTime value to a TDateTimeRec record.
DisposeMemprocedureDispose of a heap memory block and Nil the pointer (deprecated).
enumerator(TDataSet):TDataSetEnumeratoroperatorOperator to return dataset enumerator.
ExtractFieldNamefunctionExtract the field name at position.
SkipCommentsfunctionSkip SQL comments.

Types

LargeInttypeLarge (64-bit) integer.
PBookmarkFlagtypePointer to TBookmarkflag type.
PBufferListtypePointer to TBufferlist type.
PDateTimeRectypePointer to TDateTimeRec record.
PLargeInttypePointer to Large (64-bit) integer.
PLookupListRectypePointer to TLookupListRec record.
TBlobDatatypeAlias type to store blob data.
TBlobStreamModeenumerationMode used when creating a blob stream.
TBlobTypetypeValid BLOB fieldtypes.
TBookMarktypeBookmark type.
TBookmarkFlagenumerationBookmark flags.
TBookmarkStrtypeBookmark as string type - deprecated.
TBufferArraytypePointer to an array of buffers.
TBufferListtypeArray of PChar records.
TCloseErrorEventprocedure type
TDataActionenumerationAction to take when a data manipulation operation has failed.
TDatabaseClasstypeClass pointer for TDatabase.
TDataChangeEventprocedure typeEvent handler prototype when a field's data has changed.
TDataEventenumerationVarious events that are sent to datasources.
TDataOperationprocedure typeInternal callback type.
TDatasetClasstypeClass type for the TDataset class.
TDataSetErrorEventprocedure typeError handling callback.
TDataSetNotifyEventprocedure typeEvent handler prototype for dataset events.
TDataSetStateenumerationCurrent state of the dataset.
TDateTimeAliastypeAlias for TDateTime type.
TDBDatasetClasstypeClass of TDBDataset.
TFieldAttributeenumerationField attributes.
TFieldAttributessetSet of TFieldAttribute values.
TFieldCharssetSet of valid characters for the field contents.
TFieldClasstype
TFieldDefClasstypeClass of TFieldDef.
TFieldDefsClasstypeClass of TFieldDefs.
TFieldGetTextEventprocedure typeEvent handler to get field content.
TFieldKindenumerationKind of field.
TFieldKindssetSet of TFieldKind values.
TFieldMaptypeArray type with TFieldType as index type.
TFieldNotifyEventprocedure typeNotification handler prototype.
TFieldReftypePointer to a TField instance.
TFieldsClasstypeClass of TFields.
TFieldSetTextEventprocedure typeEvent handler to get field content.
TFieldTypeenumerationField data type description.
TFilterOptionenumerationAvailable filter options.
TFilterOptionssetSet of filter options to use.
TFilterRecordEventprocedure typeRecord filtering event handler prototype.
TGetModeenumerationGet new buffer mode.
TGetResultenumerationresult of the GetRecord operation.
TIndexOptionenumerationIndex description flags.
TIndexOptionssetSet of TIndexOption values.
TLocateOptionenumerationAvailable options when locating a record in a dataset.
TLocateOptionssetOptions to use when locating a record in a dataset.
TLoginEventprocedure typeLogin event handler.
TParamBindingtypeAuxiliary type, used when binding parameters.
TParamClasstypeClass of TParam.
TParamStyleenumerationStyle of parameter.
TParamTypeenumerationParameter type.
TParamTypessetSet of TParamType.
TProviderFlagenumerationWhat to do with fields when applying updates.
TProviderFlagssetSet of flags.
TPSCommandTypeenumerationType of SQL command.
TRecordBuffertypePointer type for record data buffer.
TRecordBufferBaseTypetypeOpaque base type for TRecordBuffer.
TResolverResponseenumerationResolver response code.
TResyncModesetInternal flag for resynchronisation.
TSQLParseOptionenumerationRepresents SQL parser options available to the TParams collection.
TSQLParseOptionssetSet type used to store value(s) from the TSQLParseOption enumeration.
TStringFieldBuffertypeType to access string field content buffers as an array of characters.
TUpdateActionenumerationAction to perform when an update operation fails.
TUpdateKindenumerationKind of update operation.
TUpdateModeenumerationUpdate mode.
TUpdateStatusenumerationRecord update status.
TUpdateStatusSetsetSet of update states.

Constants

DefaultFieldClassesconstantDefault field classes to use when creating a new TField instance.
dsEditModesconstantEdit modes.
dsMaxBufferCountconstantMaximum data buffers count for dataset.
dsMaxStringSizeconstantMaximum size of string fields.
dsWriteModesconstantField write modes.
FieldTypeNamesconstantHuman-readable names of field types.
FieldTypetoVariantMapconstantMap field types on variant types.
ftBlobTypesconstantConstant enumerating all blob types.
ObjectFieldTypesconstant
SQLDelimiterCharactersconstantSQL statement delimiter token characters.
YesNoCharsconstantArray of characters mapping a boolean to Y/N.

Variables

LoginDialogExProcvariableLogin dialog callback.

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.