TCB4Table Info

TCB4Table is a wrapper around CodeBase that can be used as a BDE replacement for a TTable. The focus during developing this component is on keeping it as compatible as possible with Borland's TTable. Which has as major advantages that you can easily migrate to or from the BDE or an other BDE replacements.

Of course TCB4Table is a descendant of TDataSet so it can be used by any standard Delphi or third party control using a TDataSet. Or in other words: you can use it wherever you normally would use a TTable.

How compatible TCB4Table is with TTable follows:


Compatible with TTable

procedure ApplyRange;
function BookmarkValid(Bookmark: TBookmark): Boolean;
function
CompareBookmarks(Bookmark1, Bookmark2: TBookmark): Integer;
procedure
Cancel;
procedure CancelRange;
procedure CloseIndexFile(const IndexFileName: string);
function CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream;
procedure CreateTable;
procedure DeleteTable;
procedure EditKey;
procedure EditRangeEnd;
procedure EditRangeStart;
procedure EmptyTable;
function FindKey(const KeyValues: array of const): Boolean;
procedure FindNearest(const KeyValues: array of const);
function GetCurrentRecord(Buffer: PChar): Boolean;
procedure GetIndexInfo;
procedure GetIndexNames(List: TStrings);
procedure GotoCurrent(Table: TCB4Table);
function GotoKey: Boolean;
procedure GotoNearest;
function IsSequenced: Boolean;
procedure OpenIndexFile(const IndexName: string);
function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean;
function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant;
procedure Post;
procedure SetKey;
procedure SetRange(const StartValues, EndValues: array of const);
procedure SetRangeEnd;
procedure SetRangeStart;

property Active: Boolean;
property AfterCancel;
property AfterClose;
property AfterDelete;
property AfterEdit;
property AfterInsert;
property AfterOpen;
property AfterPost;
property AfterScroll;
property AutoCalcFields: Boolean;
property BeforeCancel;
property BeforeClose;
property BeforeDelete;
property BeforeEdit;
property BeforeInsert;
property BeforeOpen;
property BeforePost;
property BeforeScroll;
property
CacheBlobs: Boolean;
property CanModify: Boolean;
property Exclusive: Boolean;
property Exists: Boolean;
property
ExpIndex: Boolean;
property FieldDefs;
property Filtered;
property IndexDefs: TIndexDefs;
property IndexFieldCount: Integer
property IndexFieldNames: string
property IndexFields[Index: Integer]: TField
property IndexFiles: TStrings
property IndexName: string
property KeyExclusive: Boolean
property KeySize: Word
property MasterFields: string;
property MasterSource: TDataSource;
property ReadOnly: Boolean
property RecNo: Integer
property RecordCount: Integer
property Recordsize: Word
property StoreDefs: Boolean; // Delphi 4 only
property TableName: string

And ofcourse everything inherited form TDataSet

Different from TTable

property Database: TCB4Database; - type is TCB4Database i.s.o. TDatabase
property DatabaseName: string
property Filter - uses dBase Expressions

Extra in TCB4Table

property CBDATA4: DATA4; - Pointer to Codebase data
property IndexPaths[Index: Integer]: string; - the complete paths of the used indexfiles (-1 is productionindex)
property Options: TCB4TableOptions;
- toLockOnPost - Lock record on post not on edit (False)
- toShowDeletedRecords - Showdeleted records (False)
- toUseProductionIndex - Automatically open production index (True)
property TablePath: string; - Complete path of table

Not implemented (yet) in TCB4Table

procedure AddIndex(const Name, Fields: string; Options: TIndexOptions; const DescFields: string = '');
procedure ApplyUpdates;
function
BatchMove(ASource: TBDEDataSet; AMode: TBatchMode): Longint;
procedure CancelUpdates;
function
CheckOpen(Status: DBIResult): Boolean;
procedure CloseDatabase(Database: TDatabase);
procedure CommitUpdates;
function
ConstraintCallBack(Req: DsInfoReq; var ADataSources: DataSources): DBIResult;
function ConstraintsDisabled: Boolean;
procedure
DeleteIndex(const Name: string);
procedure DisableConstraints;
procedure EnableConstraints;
procedure FetchAll;
procedure FlushBuffers;
procedure GetDetailLinkFields(MasterFields, DetailFields: TList);
procedure GetProviderAttributes(List: TList);
procedure LockTable(LockType: TLockType);
function OpenDatabase: TDatabase;
procedure RenameTable(const NewTableName: string);
procedure RevertRecord;
procedure UnlockTable(LockType: TLockType);
function UpdateStatus: TUpdateStatus;
function Translate(Src, Dest: PChar; ToOem: Boolean): Integer;

property CachedUpdates: Boolean;
property DBHandle: HDBIDB;
property DBLocale: TLocale;
property DBSession: TSession;
property FilterOptions
property Handle: HDBICur;
property KeyFieldCount: Integer;
property Locale: TLocale;
property TableLevel: Integer;
property Constraints;
property DefaultIndex: Boolean;
property ObjectView;
property Provider;
property SessionName: string;
property TableType: TTableType;
property UpdateMode;
property UpdateObject;
property UpdatesPending: Boolean;
property UpdateRecordTypes;

property OnUpdateError;
property OnUpdateRecord;


© 1999 Tiriss