Database Methods
Chapter Updated 1/30/99
Method | Description |
---|---|
xbShort rc AppendRecord() | Append a new record to the end of an open database |
void AutoLockOn() | Turns on automatic record locking (see locking chapter) |
void AutoLockOff() | Turns off automatic record locking (see locking chapter) |
void BlankRecord() | Fill the current record buffer with blanks |
xbLong csum CalcCheckSum() | Calculate checksum on a data record |
xbShort rc CloseDatabase() | Close an open database |
xbShort rc CopyDbfStructure( char * NewFileName, xbShort OverlaySwitch ) | Copies the structure of a xbDbf file to a new file |
xbShort rc CreateDatabase( char * FileName, XbSchema *s, xbShort OverlaySwitch ) | Close an open database |
xbULong CurrentRecNo() | Returns the current record number |
xbShort rc DeleteAllRecords() | Mark all records for deletion |
xbShort rc DeleteRecord() | Mark a record for deletion |
xbShort rc DumpHeader(xbShort option) | Display information about a .DBF file header |
xbShort rc DumpRecord( xbULong RecNo) | Dump a record for a database |
xbLong cnt FieldCount() | Returns number of fields in database |
xbLong recno GetCurRecNo() | Returns current record number |
xbShort rc GetFirstRecord() | Get the first record in the database |
xbShort rc GetLastRecord() | Get the last record in the database |
xbShort rc GetNextRecord() | Get the next record in the database |
xbShort rc GetPrevRecord() | Get the previous record in the database |
xbShort rc GetRecord(xbLong RecNo) | Get a record by record number from an open database |
char * buf GetRecordBuf() | Returns a pointer to the record buffer |
xbLong RecCnt NoOfRecords() | Returns the number of records in an open database |
xbShort rc OpenDatabase(char * FileName) | Open an existing database |
xbShort rc PackDatabase( xbShort WaitOption) | Compress file and remove deleted records |
xbShort rc PutRecord(xbULong RecNo) | Put a record in an open database |
xbShort rc RebuildAllIndices() | Rebuilds all open indices |
xbShort dflag RecordDeleted() | Determine if a record has been deleted |
xbShort version SetVersion(xbShort Ver) | Set version to xbase III+ or IV style xbDbf files |
xbShort rc UndeleteAllRecords() | Unmark all deleted records |
xbShort rc UndeleteRecord() | Unmark a deleted record |
xbShort rc Zap(xbShort WaitOption) | Deletes all records from a database |
Return Code | Description |
---|---|
XB_LOCK_FAILED | Write lock not successful |
XB_NO_ERROR | If there is no error |
XB_WRITE_ERROR | Unsuccessful write operation |
Return Code | Description |
---|---|
XB_NO_ERROR | If there is no error |
XB_NOT_OPEN | If there is no error |
Return Code | Description |
---|---|
XB_NO_ERROR | If there is no error |
XB_FILE_EXISTS | If a file exists and OverLay switch = FALSE |
XB_OPEN_ERROR | Couldn't open the file |
XB_NO_MEMORY | Memory allocation error |
XB_WRITE_ERROR | Couldn't write to disk |
XB_SEEK_ERROR | Seek routine error |
Return Code | Description |
---|---|
XB_NO_ERROR | If there is no error |
XB_FILE_EXISTS | If a file exists and OverLay switch = FALSE |
XB_OPEN_ERROR | Couldn't open the file |
XB_NO_MEMORY | Memory allocation error |
XB_WRITE_ERROR | Couldn't write to disk |
Return Code | Description |
---|---|
XB_NO_ERROR | No error encountered |
XB_INVALID_RECORD | Could not mark record |
XB_NOT_OPEN | If the file is not open |
XB_SEEK_ERROR | Seek routine error |
XB_WRITE_ERROR | Write routine error |
Return Code | Description |
---|---|
XB_NO_ERROR | No error encountered |
XB_INVALID_RECORD | Could not mark record |
Option | Action |
---|---|
1 | Print Header Only |
2 | Field Data Only |
3 | Header and Field Data |
Return Code | Description |
---|---|
XB_INVALID_OPTION | Option must be 1,2 or 3 |
XB_NOT_OPEN | File is not open |
XB_NO_ERROR | No error encountered |
Return Code | Description |
---|---|
XB_NO_ERROR | No error encountered |
XB_INVALID_RECORD | Invalid record for RecNo parameter |
Return Code | Description |
---|---|
XB_NO_ERROR | If there is no error |
XB_INVALID_RECORD | Invalid record number |
XB_LOCK_FAILED | Unsuccessful lock operation |
XB_NOT_OPEN | If the file is not open |
XB_SEEK_ERROR | Seek routine error |
XB_WRITE_ERROR | Write routine error |
Return Code | Description |
---|---|
XB_LOCK_FAILED | Read lock not successful |
XB_NO_ERROR | If there is no error |
XB_EOF | At end of file |
XB_NOT_OPEN | If the file is not open |
XB_INVALID_RECORD | Invalid record number |
XB_SEEK_ERROR | Seek routine error |
XB_WRITE_ERROR | Write routine error |
Return Code | Description |
---|---|
XB_LOCK_FAILED | Read lock not successful |
XB_NO_ERROR | If there is no error |
XB_EOF | At end of file |
XB_NOT_OPEN | If the file is not open |
XB_INVALID_RECORD | Invalid record number |
XB_SEEK_ERROR | Seek routine error |
XB_WRITE_ERROR | Write routine error |
Return Code | Description |
---|---|
XB_LOCK_FAILED | Read lock not successful |
XB_NO_ERROR | If there is no error |
XB_BOF | At beginning of file |
XB_NOT_OPEN | If the file is not open |
XB_INVALID_RECORD | Invalid record number |
XB_SEEK_ERROR | Seek routine error |
XB_WRITE_ERROR | Write routine error |
Return Code | Description |
---|---|
XB_LOCK_FAILED | Read lock not successful |
XB_NO_ERROR | If there is no error |
XB_NOT_OPEN | If the file is not open |
XB_INVALID_RECORD | Invalid record number |
XB_SEEK_ERROR | Seek routine error |
XB_WRITE_ERROR | Write routine error |
Return Code | Description |
---|---|
XB_NO_ERROR | If there is no error |
XB_OPEN_ERROR | Couldn't open the file |
XB_NO_MEMORY | Memory allocation error |
XB_NOT_XBASE | Not an xbXBase type file |
Return Code | Description |
---|---|
XB_NO_ERROR | If there is no error |
XB_CLOSE_ERROR | If intermediate work file can not be closed |
XB_OPEN_ERROR | Could not open file |
XB_NO_MEMORY | Memory allocation error |
XB_WRITE_ERROR | Error writing to file |
XB_SEEK_ERROR | Seek error encountered |
XB_LOCK_FAILED | Can not lock file or index |
Return Code | Description |
---|---|
XB_LOCK_FAILED | Write lock not successful |
XB_NO_ERROR | If there is no error |
XB_NOT_OPEN | Database is not open |
XB_INVALID_RECORD | Invalid record number |
XB_SEEK_ERROR | Seek operation failed |
XB_WRITE_ERROR | Write operation failed |
Return Code | Description |
---|---|
XB_NO_ERROR | If there is no error |
XB_WRITE_ERROR | Error writing data |
XB_CLOSE_ERROR | Error closing work file |
Return Code | Description |
---|---|
TRUE (1) | Record is marked for deletion |
FALSE (0) | Record is not marked for deletion |
Return Code | Description |
---|---|
XB_NO_ERROR | Setting updated |
3 or 4 | If Vswitch = 0, it returns current version setting |
XB_INVALID_OPTION | Vswictch not one of 0,3 or 4 |
Return Code | Description |
---|---|
XB_NO_ERROR | No error encountered |
XB_INVALID_RECORD | Could not mark record |
XB_NOT_OPEN | If the file is not open |
XB_SEEK_ERROR | Seek routine error |
XB_WRITE_ERROR | Write routine error |
Return Code | Description |
---|---|
XB_NO_ERROR | No error encountered |
XB_INVALID_RECORD | Could not unmark record |
Return Code | Description |
---|---|
XB_NO_ERROR | No error encountered |
XB_LOCK_FAILED | Could not lock file |
XB_WRITE_ERROR | Could not write to file |
XB_OPEN_ERROR | Could not open temp database |