TCustomBufDataset class
Ancestor class for a database-aware buffered dataset.
Declaration
TCustomBufDataset = class(TDBDataset)Inheritance
- TCustomBufDataset
- TDBDataset
- TDataSet
- TComponent
- TPersistent
- TObject
Descends from it: TBufDataset TCustomSQLQuery
Description
TCustomBufDataset is a
TDBDataset descendant that implements the ancestor class for a database-aware buffered dataset. TCustomBufDataset is an in-memory dataset that can be used as a local stand-alone dataset, or it can be used as a local buffer for updates applied to a remote dataset. TCustomBufDataset implements many features similar to those in TClientDataset in Delphi. However, it is
not meant to be code or function compatible with TClientDataset. It is designed to provide management of the buffers used to access record data, and is used as the ancestor for classes like
TSQLQuery and
TRESTBufDataset.
As a TDBDataset descendant, it offers access to many of the database features supported in the FCL DB package. As a TDataset descendant, it also offers access to familiar navigation and data handling methods in the ancestor class. TCustomBufDataset has features that allow local storage and retrieval of field definitions and record data. In addition, facilities are provided that allow local indexing of record data in the dataset. There is a comprehensive parser/expression evaluator available that allows complete support for Filters in the dataset.
Do not create instances of TCustomBufDataset. Use the TBufDataset descendant instead.
Additional information about using TBufDataset can be found on the Lazarus Wiki at: How to write in-memory database applications in Lazarus/FPC (TBufDataset).
See also
Properties
Refreshing | protected | Indicates if the Refresh method has been called but has not completed. |
ChangeCount | public | Number of pending changes for the dataset. |
MaxIndexesCount | public | Maximum number of indexes available in the dataset. |
ReadOnly | public | Indicates if records can be added, deleted, or modified in the dataset. |
ManualMergeChangeLog | public | Indicates if the update change log can be manually merged. |
FileName | published | File name on the local file system used to load or store the dataset. |
PacketRecords | published | Number of records allowed in a data packet handled by the packet reader. |
IndexDefs | published | Index definitions for the dataset. |
IndexName | published | Name of the selected index for the dataset. |
IndexFieldNames | published | Field names included in the custom index. |
UniDirectional | published | Indicates if the dataset is for uni-directional navigation only. |
Methods
DefaultReadFileFormat | protected | |
DefaultWriteFileFormat | protected | |
DefaultPacketClass | protected | |
CreateDefaultPacketReader | protected | |
SetPacketRecords | protected | Sets the value for the PacketRecords property. |
SetRecNo | protected | Sets the value for the RecNo property. |
GetRecNo | protected | Gets the value for the RecNo property. |
GetChangeCount | protected | Gets the value for the ChangeCount property. |
AllocRecordBuffer | protected | Allocates resources for a record buffer. |
FreeRecordBuffer | protected | Frees resources allocated for the specified record buffer. |
ClearCalcFields | protected | Clears calculated fields in the specified record buffer. |
InternalInitRecord | protected | Performs actions needed to initialize the buffer for a record in the dataset. |
GetCanModify | protected | Gets the value for the CanModify property. |
GetRecord | protected | Gets the record buffer for the record at the specified relative position. |
DoBeforeClose | protected | Performs actions needed prior to closing the dataset. |
InternalInitFieldDefs | protected | Performs actions needed to initialize field definitions for the dataset. |
InternalOpen | protected | Performs actions needed to open the dataset. |
InternalClose | protected | Performs actions needed to close the dataset. |
GetRecordSize | protected | Gets the value for the RecordSize property. |
InternalPost | protected | Performs actions needed to post a record to the dataset. |
InternalCancel | protected | Performs actions needed to cancel a pending update in the dataset. |
InternalDelete | protected | Performs actions needed to delete the current record in the dataset. |
InternalFirst | protected | Performs actions needed to move to the first record in the dataset. |
InternalLast | protected | Performs actions needed to move to the last record in the dataset. |
InternalSetToRecord | protected | Moves the dataset to the specified record buffer. |
InternalGotoBookmark | protected | Performs actions needed to move to the specified Bookmark in the dataset. |
SetBookmarkData | protected | Stores the specified Bookmark data to a record buffer. |
SetBookmarkFlag | protected | Stores the specified Bookmark flag value to a record buffer. |
GetBookmarkData | protected | Gets bookmark data from the specified record buffer. |
GetBookmarkFlag | protected | Gets Bookmark flag data from the specified record buffer. |
IsCursorOpen | protected | Indicates if the cursor for the dataset has been opened. |
GetRecordCount | protected | Gets the value for the RecordCount property. |
ApplyRecUpdate | protected | Raises an exception. ApplyRecUpdate is not supported in TCustomBufDataset and descendent classes. |
ApplyRecUpdateEx | protected | |
SetOnUpdateError | protected | Sets the value for the OnUpdateError property. |
SetFilterText | protected | Sets the value in the Filter property. |
SetFiltered | protected | Sets the value in the Filtered property. |
InternalRefresh | protected | Performs actions needed to refresh records in the dataset. |
DataEvent | protected | Triggers an event when the dataset or its data is modified. |
GetNewBlobBuffer | protected | Creates a new Blob buffer and adds it to the internal Blob buffers member. |
GetNewWriteBlobBuffer | protected | Creates a new Blob update buffer and adds it to the internal list. |
FreeBlobBuffer | protected | Frees resources allocated to the specified Blob buffer. |
InternalAddIndex | protected | Performs actions needed to add an index to the dataset. |
BeforeRefreshOpenCursor | protected | An empty implementation in TCustomBufDataset. |
DoFilterRecord | protected | Performs actions needed to filter records in the dataset. |
SetReadOnly | protected | Sets the value in the ReadOnly property. |
IsReadFromPacket | protected | Indicates if dataset content was read from a data packet reader or file. |
getnextpacket | protected | Reads and applies the next data packet from the data packet reader. |
GetPacketReader | protected | Gets a Data Packet Reader using the specified data format for the dataset. |
Fetch | protected | An empty implementation in TCustomBufDataset. |
LoadField | protected | An empty implementation in TCustomBufDataset. |
LoadBlobIntoBuffer | protected | Loads a Blob buffer for the specified field into the current record buffer. |
DoLocate | protected | |
Create | public | Constructor for the class instance. |
GetFieldData | public | Get the data for a field. |
SetFieldData | public | Store the data for a field. |
ApplyUpdates | public | Applies pending updates to the dataset. |
MergeChangeLog | public | Frees update buffers and Blob update buffer allocated for the dataset. |
RevertRecord | public | Reverts the current record to its original (un-edited) values. |
CancelUpdates | public | Cancels pending updates in the dataset. |
Destroy | public | Destructor for the class instance. |
Locate | public | Locates the first record with fields having the specified values. |
Lookup | public | Gets values from the first record with fields that match the search condition. |
UpdateStatus | public | Gets the update status for the current record in the dataset. |
CreateBlobStream | public | Creates a Blob stream for the specified field with the given permissions. |
AddIndex | public | Adds an index definition to the dataset. |
ClearIndexes | public | Clears index storage in the dataset. |
SetDatasetPacket | public | Retrieves and applies the data packet with the content for the dataset. |
GetDatasetPacket | public | Builds a data packet representing the content in the buffered dataset. |
LoadFromStream | public | Loads the dataset from the specified stream using the given data format. |
SaveToStream | public | Saves the dataset to the specified stream using the given data format. |
LoadFromFile | public | Loads the dataset from the specified file using the given format. |
SaveToFile | public | Saves the dataset to the specified file using the given data format. |
CreateDataset | public | Creates the dataset using its field definitions or bound fields. |
Clear | public | Clears the content in the dataset. |
BookmarkValid | public | Determines if the specified Bookmark is valid for the dataset. |
CompareBookmarks | public | Gets the relative sort order for the specified Bookmarks. |
CopyFromDataset | public | Loads field definitions and optional data from another dataset. |
Events
OnUpdateError | published | Event handler signalled when an error occurs while updating records. |
Inherited
From TDBDataset (5)
CheckDatabase DataBase SetDatabase SetTransaction Transaction
From TDataSet (206)
ActivateBuffers Active ActiveBuffer ActiveRecord AfterCancel AfterClose AfterDelete AfterEdit AfterInsert AfterOpen AfterPost AfterRefresh AfterScroll Append AppendRecord AutoCalcFields BeforeCancel BeforeClose BeforeDelete BeforeEdit BeforeInsert BeforeOpen BeforePost BeforeRefresh BeforeScroll BindFields BlobFieldCount BlockReadNext BlockReadSize BOF Bookmark BookmarkAvailable BookmarkSize BufferCount Buffers CalcBuffer CalcFieldsSize CalculateFields Cancel CanModify CheckActive CheckBiDirectional CheckBrowseMode CheckInactive ClearBuffers ClearFields Close CloseBlob CloseCursor Constraints ControlsDisabled CreateFields CurrentRecord CursorPosChanged DataConvert DataSource DefaultFields Delete DestroyFields DisableControls DoAfterCancel DoAfterClose DoAfterDelete DoAfterEdit DoAfterInsert DoAfterOpen DoAfterPost DoAfterRefresh DoAfterScroll DoBeforeCancel DoBeforeDelete DoBeforeEdit DoBeforeInsert DoBeforeOpen DoBeforePost DoBeforeRefresh DoBeforeScroll DoOnCalcFields DoOnNewRecord Edit EnableControls EOF FieldByName FieldByNumber FieldCount FieldDefs FieldDefsClass Fields FieldsClass FieldValues Filter Filtered FilterOptions FindField FindFirst FindLast FindNext FindPrior FindRecord First Found FreeBookmark FreeFieldBuffers GetBookmark GetBookmarkStr GetCalcFields GetChildren GetCurrentRecord GetDataSource GetDefaultBufferCount GetFieldClass GetfieldCount GetFieldList GetFieldNames GetFieldValues GetIndexDefs GetIsIndexField GetNextRecord GetNextRecords GetPriorRecord GetPriorRecords GotoBookmark InitFieldDefs InitFieldDefsFromFields InitRecord Insert InsertRecord InternalAddRecord InternalCalcFields InternalEdit InternalHandleException InternalInsert IsEmpty IsLinkedTo IsSequenced IsUniDirectional Last Loaded Modified MoveBy MyDataSourceCount MyDataSources Next OnCalcFields OnDeleteError OnEditError OnFilterRecord OnNewRecord OnPostError Open OpenCursor OpenCursorcomplete Post Prior PSEndTransaction PSExecute PSExecuteStatement PSGetAttributes PSGetCommandText PSGetCommandType PSGetDefaultOrder PSGetIndexDefs PSGetKeyFields PSGetParams PSGetQuoteChar PSGetTableName PSGetUpdateException PSInTransaction PSIsSQLBased PSIsSQLSupported PSReset PSSetCommandText PSSetParams PSStartTransaction PSUpdateRecord RecalcBufListSize RecNo RecordCount RecordSize Refresh RefreshInternalCalcFields RestoreState Resync SetActive SetBookmarkStr SetBufListSize SetChildOrder SetCurrentRecord SetDefaultFields SetFields SetFieldValues SetFilterOptions SetFound SetModified SetName SetOnFilterRecord SetState SetTempState SetUniDirectional SparseArrays State TempBuffer Translate UpdateCursorPos UpdateIndexDefs UpdateRecord
From TComponent (70)
_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loading Name Notification ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetDesigning SetDesignInstance SetInline SetParentComponent SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState
From TPersistent (5)
Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers
From TObject (37)
AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
