Class xbDbf, xbDbf3, xbDbf4
Chapter Updated 04/28/23
Method | Description | Parms |
---|---|---|
virtual xbInt16 Abort() | Cancel any updates not already committed to the table. | |
virtual xbInt16 AppendRecord() | Append the record buffer to the end of the table. | |
virtual xbInt16 BlankRecord() | Blank the current record buffer. | |
virtual xbInt16 Commit() | Commit any updates to the DBF file/table. | |
virtual xbInt16 Close() | Close the DBF file/table. | |
virtual xbInt16 CopyDbfStructure( xbDbf *dNewTable, const xbString &sTableName, const xbString &sTableAlias, xbInt16 iOverlay, xbInt16 iShareMode ) | Copy structure to new DBF file. |
dNewTable - Pointer to new xbDbf class sTableName - New Table name sTableAlias - Alias for new table iOverlay iShareMode |
virtual xbInt16 CreateTable( const xbString &sTableName, const xbString &sAlias, xbSchema *pSchema, xbInt16 iOverlay, xbInt16 iShareMode ) = 0 | Create new table / DBF file. |
sTableName - New Table name sAlias - Alias for new table pSchema - Pointer to field definition structure iOverlay iShareMode |
virtual xbInt16 DeleteTable() | Delete table / DBF file and all associated indices and memo files. | |
virtual xbInt16 DeleteAll( xbInt16 iOption ) | Set or remove delete flags for all records in the table. |
iOption |
virtual xbInt16 DeleteAllRecords() | Set delete flags for all records in the table. | |
virtual xbInt16 DeleteRecord() | Delete the current record. | |
virtual xbInt16 DumpHeader( xbInt16 iOption ) const | Dump DBF header information to the console. |
iOption |
virtual xbInt16 DumpRecord( xbUInt32 ulRecNo, xbInt16 iOutputDest = 0, xbInt16 iOutputFmt = 0 ) | Dump the contents of the specified record. |
ulRecNo - Record number of record to be dumped
iOutputDest iOutputFmt |
virtual xbInt16 GetAutoCommit() const | Get the Auto Commit status. | |
virtual xbInt16 GetAutoCommit( xbInt16 iOption ) const | Get the Auto Commit status. | iOption: 0 = Table Status 1 = System Status. |
virtual xbBool GetBof() | Returns true if beginning of file. | |
virtual xbUInt32 GetCurRecNo() const | Returns the current record number. | |
virtual xbInt16 GetDbfStatus() const | Returns Status |
|
virtual xbBool GetEof() | Returns true if end of file. | |
virtual xbInt32 GetFieldCnt() const | Returns the number of fields in the table. | |
virtual xbInt16 GetFirstRecord() | Retrieve the first active (not deleted) record in the table. | |
virtual xbInt16 GetFirstRecord( xbInt16 iOption ) | Retrieve the first record in the table. |
iOption |
virtual xbUInt16 GetHeaderLen() const | Returns the length of the header portion within the DBF file. | |
virtual xbInt16 GetLastRecord() | Retrieve the last active (not deleted) record in the table. | |
virtual xbInt16 GetLastRecord( xbInt16 iOption ) | Retrieve the last record in the table. |
iOption |
virtual xbInt16 GetNextRecord() | Retrieve the next active (not deleted) record in the table. | |
virtual xbInt16 GetNextRecord( xbInt16 iOption ) | Retrieve the next record in the table. |
iOption |
virtual xbInt16 GetNextRecord( xbInt16 iOption, xbUInt32 ulStartRec ) | Retrieve the next record in the table. |
iOption ulStartRec is the position to start from. |
virtual xbInt16 GetPrevRecord() | Retrieve the previous active (not deleted) record in the table. | |
virtual xbInt16 GetPrevRecord( xbInt16 iOption ) | Retrieve the previous record in the table. |
iOption |
virtual xbInt16 GetRecord( xbUInt32 ulRecNo ) | Retrieve record ulRecNo. | ulRecNo - Record number to retrieve |
virtual xbInt16 GetRecordCnt( xbUInt32 & ulRecCnt ) | Returns record count in ulRecCnt. | ulRecCnt - Output number of records in table |
virtual char * GetRecordBuf( xbInt16 iOpt = 0 ) const | Returns pointer to record buffer. |
iOpt |
virtual xbUInt16 GetRecordLen() const | Returns the record length | |
virtual const xbString &GetTblAlias() const | Returns the table alias. Aliases can be used to manage multiple instances of the same open table. | |
virtual xbInt16 GetVersion() const = 0 | Returns 3 for DBase III version files, returns 4 for DBase IV version files. | |
virtual xbXBase *GetXbasePtr() const | Returns the xbase pointer. | |
virtual xbBool MemoFieldsExist() const | Returns true if the table has any associated memo fields. | |
virtual xbInt16 Open( const xbString &sTableName ) | Open a table (DBF file). | sTableName - Table name |
virtual xbInt16 Open( const xbString &sTableName, const xbString &sAlias ) | Open a table (DBF file). |
sTableName - Table name sAlias - Alias name |
virtual xbInt16 Open( const xbString &sTableName, const xbString &sAlias, xbInt16 iOpenMode, xbInt16 iShareMode ) = 0 | Open a table (DBF file). |
sTableName - Table name sAlias - Alias name iOpenMode iShareMode |
virtual xbInt16 Pack() | Pack the table, physically remove any records flagged for deletion. | |
virtual xbInt16 Pack( xbUInt32 &ulDeletedRecCnt ) | Pack the table, physically remove any records flagged for deletion. |
ulDeletedRecordCnt - Output - number of deleted records. |
virtual xbInt16 PutRecord() | Write record buffer to current location | |
virtual xbInt16 PutRecord( xbUInt32 ulRecNo ) | Write record buffer to record position ulRecNo. | ulRecNo - Record number to write. |
virtual xbInt16 RecordDeleted( xbInt16 iOpt = 0 ) const | Returns true if currect record is flagged for deletion, otherwise returns false. |
iOpt |
virtual xbInt16 Rename( const xbString sNewName ) = 0 | Rename the table. | sNewName - New tablename. |
virtual xbInt16 SetAutoCommit( xbInt16 iAutoCommit ) | Set table specific auto commit setting. |
iAutoCommit |
virtual xbInt16 UndeleteAllRecords() | Undelete all records in table flagged for deletion. | |
virtual xbInt16 UndeleteRecord() | Undelete the current record. | |
virtual xbInt16 Zap() | Initialize the table. |
Method | Description | Parms |
---|---|---|
virtual xbInt16 GetField(xbInt16 iFieldNo, xbString &sFieldValue, xbInt16 iRecBufSw ) const | Get string field. |
iFieldNo Input - Field number to retrieve sFieldValue Output string iRecBufSw Record buffer to pull data from. |
virtual xbInt16 GetField(xbInt16 iFieldNo, xbString &sFieldValue) const | Get string field. |
iFieldNo Input - Field number to retrieve sFieldValue Output string |
virtual xbInt16 GetField(const xbString &sFieldName, xbString &sFieldValue) const | Get string field. |
sFieldName Input - Field name to retrieve sFieldValue Output string |
virtual xbInt16 GetFieldDecimal( xbInt16 iFieldNo, xbInt16 &iFieldDecimal ) const | Get decimal field. |
iFieldNo Input - Field number to retrieve iFieldDecimal Output - Number of decimals defined for field |
virtual xbInt16 GetFieldDecimal( const xbString &sFieldName, xbInt16 &iFieldDecimal ) const | Get decimal field. |
sFieldName Input - Field name to retrieve iFieldDecimal Output - Number of decimals defined for field |
virtual xbInt16 GetFieldLen( xbInt16 iFieldNo, xbInt16 &iFieldLen ) const | Get field length. |
iFieldNo Input - Field number to retrieve iFieldLen Output - Field length of field |
virtual xbInt16 GetFieldLen( const xbString &sFieldName, xbInt16 &iFieldLen ) const | Get field length. |
sFieldName Input - Field name to retrieve iFieldLen Output - Field length of field |
virtual xbInt16 GetFieldName( xbInt16 iFieldNo, xbString &sFieldName ) const | Get field name. |
iFieldNo Input - Field number to retrieve sFieldName Output - Field name |
virtual xbInt16 GetFieldNo( const xbString &sFieldName, xbInt16 &iFieldNo ) const | Get field number. |
sFieldName Input - Field name to retrieve iFieldNo Output - Field number |
virtual xbInt16 GetFieldNo( const xbString &sFieldName ) const | Returns a field number for a given field name. |
sFieldName Input - Field name to retrieve |
virtual xbInt16 GetFieldType( xbInt16 iFieldNo, char &cFieldType ) const | Get field type. |
iFieldNo Input - Field number to retrieve cFieldType Output - Field type |
virtual xbInt16 GetFieldType( const xbString &sFieldName, char &cFieldType ) const | Get field type. |
sFieldName Input - Field name to retrieve cFieldType Output - Field type |
virtual xbInt16 PutField( const xbString &sFieldName, const xbString &sFieldData ) | Put string field. |
sFieldName Input - Field name to update sFieldData Input - Update value |
virtual xbInt16 PutField( xbInt16 iFieldNo, const xbString &sFieldData ) | Put string field. |
sFieldNo Input - Field number to update sFieldData Input - Update value |
virtual xbInt16 PutLogicalField( xbInt16 iFieldNo, const xbString &sFieldData ) | Put logicial field. |
sFieldNo Input - Field number to update sFieldData Input - Update value |
virtual xbInt16 PutLogicalField( const xbString &sFieldName, const xbString &sFieldData ) | Put logical field. |
sFieldName Input - Field name to update sFieldData Input - Update value |
virtual xbInt16 GetLogicalField( xbInt16 iFieldNo, xbString &sFieldData ) const | Get logical field. |
iFieldNo Input - Field number to retrieve sFieldData Output - String name to put result |
virtual xbInt16 GetLogicalField( const xbString &sFieldName, xbString &sFieldData) const | Get logical field. |
sFieldName Input - Field name to retrieve sFieldData Output - String name to put result |
virtual xbInt16 PutLogicalField( xbInt16 iFieldNo, xbBool bFieldData ) | Put logical field. |
sFieldNo Input - Field number to update bFieldData Output - Bool value |
virtual xbInt16 PutLogicalField( const xbString &sFieldName, xbBool bFieldData ) | Put logical field. |
sFieldName Input - Field name to update bFieldData Output - Bool value |
virtual xbInt16 GetLogicalField( xbInt16 iFieldNo, xbBool &bFieldData ) const | Get logical field. |
iFieldNo Input - Field number to retrieve bFieldData Output - Bool value |
virtual xbInt16 GetLogicalField( xbInt16 iFieldNo, xbBool &bFieldData, xbInt16 iRecBufSw ) const | Get logical field. |
iFieldNo Input - Field number to retrieve bFieldData Output - Bool value iRecBufSw Record buffer to pull data from. |
virtual xbInt16 GetLogicalField( const xbString &sFieldName, xbBool &bFieldData) const | Get logical field. |
sFieldName Input - Field name to retrieve bFieldData Output - Bool value |
virtual xbInt16 GetLongField( xbInt16 iFieldNo, xbInt32 &lFieldValue ) const | Get long field. |
iFieldNo Input - Field number to retrieve lFieldValue Output - xbInt32 field to put result |
virtual xbInt16 GetLongField( const xbString &sFieldName, xbInt32 &lFieldValue ) const | Get long field. |
sFieldName Input - Field name to retrieve lFieldValue Output - xbInt32 field to put result |
virtual xbInt16 PutLongField( xbInt16 iFieldNo, xbInt32 lFieldValue ) | Put long field. |
sFieldNo Input - Field number to update lFieldValue Output - xbInt32 field to put result |
virtual xbInt16 PutLongField( const xbString &sFieldName, xbInt32 lFieldValue ) | Put long field. |
sFieldName Input - Field name to retrieve lFieldValue Output - xbInt32 update value |
virtual xbInt16 GetULongField( xbInt16 iFieldNo, xbUInt32 &lFieldValue ) const | Get unsigned long field. |
iFieldNo Input - Field number to retrieve ulFieldValue Output - xbUInt32 field to put result |
virtual xbInt16 GetULongField( const xbString &sFieldName, xbUInt32 &lFieldValue ) const | Get unsigned long field. |
sFieldName Input - Field name to retrieve ylFieldValue Output - xbUInt32 field to put result |
virtual xbInt16 PutULongField( xbInt16 iFieldNo, xbUInt32 lFieldValue ) | Put unsigned long field. |
sFieldNo Input - Field number to update lFieldValue Output - xbInt32 update value |
virtual xbInt16 PutULongField( const xbString &sFieldNo, xbUInt32 lFieldValue ) | Put unsigned long field. |
sFieldName Input - Field name to update lFieldValue Output - xbUInt32 update value |
virtual xbInt16 GetDoubleField( xbInt16 FieldNo, xbDouble &dFieldValue ) const | Get double field. |
iFieldNo Input - Field number to retrieve dFieldValue Output - xbDouble field to put result |
virtual xbInt16 GetDoubleField( xbInt16 FieldNo, xbDouble &dFieldValue, xbInt16 iRecBufSw ) const | Get double field. |
iFieldNo Input - Field number to retrieve dFieldValue Output - xbDouble field to put result |
virtual xbInt16 GetDoubleField( const xbString &sFieldName, xbDouble &dFieldValue ) const | Get double field. |
sFieldName Input - Field name to retrieve dFieldValue Output - xbDouble field to put result |
virtual xbInt16 PutDoubleField( xbInt16 FieldNo, xbDouble dFieldValue ) | Put double field. |
sFieldNo Input - Field number to update dFieldValue Output - xbDouble update value |
virtual xbInt16 PutDoubleField( const xbString &FieldName, xbDouble dFieldValue ) | Put double field. |
sFieldName Input - Field name to update dFieldValue Output - xbDouble update value |
virtual xbInt16 GetFloatField( xbInt16 iFieldNo, xbFloat &fFieldValue ) const | Get float field. |
iFieldNo Input - Field number to retrieve fFieldValue Output - xbFloat field to put result |
virtual xbInt16 GetFloatField( const xbString &sFieldName, xbFloat &fFieldValue ) const | Get float field. |
sFieldName Input - Field name to retrieve fFieldValue Output - xbFloat field to put result |
virtual xbInt16 PutFloatField( xbInt16 iFieldNo, xbFloat fFieldValue ) | Put float field. |
sFieldName Input - Field number to update fFieldValue Output - xbFloat update value |
virtual xbInt16 PutFloatField( const xbString &sFieldName, xbFloat fFieldValue ) | Put float field. |
sFieldName Input - Field name to update fFieldValue Output - xbFloat update value |
virtual xbInt16 GetDateField( xbInt16 iFieldNo, xbDate &dt ) const | Get date field. |
iFieldNo Input - Field number to retrieve dt Output - xbDate field to put result |
virtual xbInt16 GetDateField( const xbString &sFieldName, xbDate &dt ) const | Get date field. |
sFieldName Input - Field name to retrieve dt Output - xbDate field to put result |
virtual xbInt16 PutDateField( xbInt16 iFieldNo, const xbDate &dt ) | Put date field. |
sFieldName Input - Field number to update dt Output - xbDate update value |
virtual xbInt16 PutDateField( const xbString &sFieldName, const xbDate &dt ) | Put date field. |
sFieldName Input - Field name to update dt Output - xbDate update value |
virtual xbInt16 GetNullSts( xbInt16 iFieldNo, xbBool &bIsNull ) const virtual xbInt16 GetNullSts( const xbString &sFieldName, xbBool &bIsNull ) const virtual xbInt16 GetNullSts( xbInt16 iFieldNo, xbBool &bIsNull, xbInt16 iRecBufSw ) const |
Get Field Null Status |
sFieldName Input - Field name to check iFieldNo Input - Field no to check bIsNull Output - True if the field is null (all spaces). iRecBufSw Record buffer to pull data from. |
Method | Description | Parms |
---|---|---|
virtual xbInt16 GetMemoFieldCnt() const | Returns number of memo fields in the table. | |
virtual xbMemo *GetMemoPtr() | Returns a pointer to the associated memo file instance. | |
virtual xbUInt32 GetCreateMemoBlockSize() const | Returns the block size a new memo file will be created with. Block sizes are in 512 byte increments. | |
virtual xbInt16 GetMemoField( xbInt16 iFldNo, xbString &sMemoData ) | Get memo field data. |
iFldNo Input - Memo field number to retrieve sMemoData Output - xbString field to put result |
virtual xbInt16 GetMemoField( const xbString & sFldName, xbString &sMemoData ) | Get memo field data. |
iFldName Input - Memo field name to retrieve sMemoData Output - xbString field to put result |
virtual xbInt16 GetMemoFieldLen( xbInt16 iFldNo, xbUInt32 &ulMemoFieldLen ) | Get memo field length. |
iFldNo Input - Memo field number to retrieve ulMemoFieldLen Output - xbUInt32 field to put result |
virtual xbInt16 GetMemoFieldLen( const xbString & sFldName, xbUInt32 &ulMemoFieldLen ) | Get memo field length. |
iFldName Input - Memo field name to retrieve ulMemoFieldLen Output - xbUInt32 field to put result |
virtual xbBool MemoFieldExists( xbInt16 iFieldNo ) const | Returns xbTrue if memo field exists, else returns xbFalse. | iFieldNo Input - field number |
virtual xbBool MemoFieldExists( const xbString &sFieldName ) const | Returns xbTrue if memo field exists, else returns xbFalse. | sFieldName Input - field name |
virtual xbInt16 SetCreateMemoBlockSize( xbUInt32 ulBlockSize ) = 0 | Set the block size for the memo file. Must be called before memo file is created. | ulBlockSize Input - New block size in 512 byte increments |
virtual xbInt16 UpdateMemoField( xbInt16 iFldNo, const xbString &sMemoData ) | Update memo field. |
iFldNo Input - Memo field number to update sMemoData Input - Memo data to update |
virtual xbInt16 UpdateMemoField( const xbString & sFldName, const xbString &sMemoData ) | Update memo field. |
iFldName Input - Memo field name to update sMemoData Input - Memo data to update |
If auto locking is turned on (default setting), xbase64 handles locking automatically. If auto locking is turned off and application is running in a multi user environment, then locking functions will need to be handled by the application program. | ||
Method | Description | Parms |
---|---|---|
virtual xbInt16 LockTable( xbInt16 iLockFunction ) | Lock the table. |
LockFunction |
virtual xbInt16 LockRecord( xbInt16 iLockFunction, xbUInt32 ulRecNo ) | Lock record. |
iLockFunction ulRecNo - Record number to lock or unlock |
virtual xbInt16 LockAppend( xbInt16 iLockFunction ) | Lock append bytes for adding new record. |
iLockFunction |
virtual xbInt16 LockHeader( xbInt16 iLockFunction ) | Lock table header bytes for updating table. |
iLockFunction |
virtual xbInt16 LockMemo( xbInt16 iLockFunction ) | Lock memo table for update. |
iLockFunction |
virtual xbBool GetMemoLocked() const | Returns the memo lock status. | |
virtual xbInt16 LockIndices( xbInt16 iLockFunction ) | Lock indices for update. |
iLockFunction |
xbInt16 GetAutoLock() const | Retrieve current auto lock status. | |
void SetAutoLock( xbInt16 iAutoLock ) | Set autolock status for table |
iAutoLock |
xbInt16 GetLockFlavor() const | Always returns 1. Included for potential future alternative locking schemes. | |
void SetLockFlavor( xbInt16 iLockFlavor ) | For future use. Included for potential future alternative locking schemes. | |
xbBool GetTableLocked() const | Returns Table Locked status. | |
xbBool GetHeaderLocked() const | Returns Header Locked Status. | |
xbUInt32 GetAppendLocked() const | Returns Append Bytes locked status. | |
xbLinkListNode | Returns pointer to linked list of record locks. | |
void DumpTableLockStatus() const | Dumps all lock information for debugging purposes. |
Method | Description | Parms |
---|---|---|
virtual xbInt16 CheckTagIntegrity( xbInt16 iTagOpt, xbInt16 iOutputOpt ) | For debugging, check tag integrity. |
iTagOpt iOutputOpt |
virtual xbInt16 CloseIndexFile( xbIx *pIx ) | Close an index file. | pIx Pointer to index file instance. |
virtual xbInt16 CreateTag( const xbString &sIxType, const xbString &sName, const xbString &sKey, const xbString &sFilter, xbInt16 iDescending, xbInt16 iUnique, xbInt16 iOverLay, xbIx **xbIxOut, void **vpTagOut ) | Create index tag |
sIxType Input - MDX or NDX sName Input - Tag Name sKey Input - Key Expression sFilter Input - Filter Expression (MDX only) iDescending Input - xbTrue for descending, xbFalse ascending iUnique Input - xbTrue for unique, xbFalse not unique iOverlay Input - xbTrue to overlay if existing file exists **xbIxOut Output - Pointer to ix instance **vpTagOut Output - Pointer to tag |
virtual xbInt16 DeleteTag( const xbString &sIxType, const xbString &sName ) | Delete a tag. |
sIxType Input - MDX or NDX sName Input - Tag Name sKey Input - Key Expression |
virtual xbInt16 DeleteAllIndexFiles() | Delete all indices for table. | |
virtual xbInt16 Find( xbString &sKey ) | Find xbString key for current tag (assumes character index). | sKey - String search key |
virtual xbInt16 Find( xbDate &dtKey ) | Find xbDate key for current tag(assumes date index). | dtKey - Date search key |
virtual xbInt16 Find( xbDouble &dKey ) | Find numeric key for current tag (assumes numeric index). | dKey - Nueric search key |
virtual xbIx *GetCurIx() const | Returns pointer to current index file. | |
virtual void *GetCurTag() const | Returns pointer to current tag. | |
virtual xbInt16 GetFirstKey() | Get the first key for the current tag, reposition current record. | |
virtual xbInt16 GetNextKey() | Get the next key for the current tag, reposition current record. | |
virtual xbInt16 GetPrevKey() | Get the previous key for the current tag, reposition current record. | |
virtual xbInt16 GetLastKey() | Get the last key for the current tag, reposition current record. | |
virtual const xbString &GetCurIxType() const | Returns the current index type. | |
virtual const xbString &GetCurTagName() const | Returns the current tag name. | |
virtual xbIxList *GetIxList() const | Returns a pointer to list of open indices. | |
virtual xbInt32 GetPhysicalIxCnt () const | Returns the count of open index files for the table. | |
xbLinkListNode | Returns a pointer to a list of tags for the table. | |
virtual xbInt16 OpenIndex( const xbString &sIxType, const xbString &sIndexName ) | Open the index. MDX index files are opened automatically. NDX index files can be opened automatically. |
sIxType sIndexName - index file name |
virtual xbInt16 Reindex( xbInt16 iTagOpt ) | Reindex |
iTagOpt |
virtual xbInt16 SetCurTag( const xbString &sTagName ) | Set current tag. | sTagName Tag name |
virtual void SetCurTag( const xbString &sIxType, xbIx *pIx, void *vpTag ) | Set current tag. |
sIxType pIx - Pointer to index object vpTag - Pointer to tag object |
virtual xbInt16 AssociateIndex( const xbString &sType, const xbString &sName, xbInt16 iOption ) | Use this method to add an NDX index file name to an INF file. When a DBF file is opened, Xbase64 automatically opens NDX index files that are included in the appropriate INF file. This is also used for ODBC compatibility with other xbase type tools. |
sIxType Currently only NDX. Future versions can support additional non prod index types. sIxName The index name. iOpt |
xbLinkListNode | Returns list of INF file entries. |
Method | Description |
---|---|
xbInt16 DisableBlockReadProcessing() | Disable block read processing for table. |
xbInt16 EnableBlockReadProcessing() | Enable block read processing for table. This significantly speeds up processing speed if reading from the file sequentially. For random access, better performance will be achieved with block reading turned off. |
xbBool GetBlockReadStatus() const | Get block read status. |