Dbi CloseDatabase hDb

The database handle.

RETURNS: DBIResult closes the specified database and any associated cursors.

DbiCloseFieldXIt ( hXIt)

The field translation handle

RETURNS: DBIResult

The function DbiCloseFieldXlt closes a field translation object. DbiCloselndex ( hCursor, szlndexName, ilndexld )

hCursor szlndexName ilndexld hDBICur

PChar

UINTl6

The cursor handle. A pointer to the index name. Currently not used.

RETURNS: DBIResult

The function DbiCloselndex closes the specified index for the cursor.

DbiCloseSession (hSes)

The session handle

RETURNS: DBIResult

DbiCloseSession closes the session and frees all resources associated with it including database handles, cursor, table-level locks, and record-level locks.

DbiCompareBookMarks ( hCur, pBookMark I, pBookMarkl, pCmpBkmkResult)

hCur pBookMark I pBookMark2 pCmpBkmkResult hDBICur

PByte

PByte pCMPBkMkRsIt

The cursor handle.

Pointer to the first bookmark.

to the second bookmark. Pointer to the variable to receive the comparison result.

RESULTS: DBIResult

The function DbiCompareBookMarks is used to compare the relative positions of two bookmarks set on the same cursor.

310 ■ Part lll-The Well-Rounded Application

DbiCompareKeys ( hCursor, pKey I, pKey2, iFields, Len, piResult )

hCursor pKeyl pKey2

¡Fields iLen piResult hDBICur

PByte

PByte

UINTI 6

UINTI6 plNTI6

The cursor handle. Pointer to the first key value. Optional pointer to the second key value.

The number of fields to be included when a composite key is used. ¡Fields and iLen work together to determine how much of key is used in matching. The length of the key field to be used in matching.

Pointer to the variable to receive the comparison result.

RETURNS: DBIResult

The function DbiCompareKeys compares the values of two keys based on the current cursor index.

DbiCopyTable ( hDbt bOver Write, szSrcTableName, szSrcDriverType, pszDestTableName )

hDb bOverWrite szSrcTableName szSrcDriverType pszDestTableName hDBIDb

Boolean

PChar PChar PChar

The database handle.

When True, an existing destination table is overwritten. If False, an error is returned.

The source table name to be copied.

The driver type name.

The name of the destination table.

RETURNS: DBIResult

The function DbiCopyTable copies tables of the same driver type from a source table to a destination table.

DbiCreatelnMemTable ( hDb, szName, ¡Fields, pfldDesc, hCursor )

hDb szName

¡Fields pfldDesc hCursor hDBIDb The database handle.

PChar The table name.

UINT 16 The number of fields in the table.

pFLDDeSC Pointer to an array of field descriptor

(FLDDeSC) structures. The cursor handle.

Appendix A-BDE API Quick Reference

RETURNS: DBIResult

DbiCreatelnMemTable creates a temporary table in memory. The data types and capabilities supported for in-memory tables are very limited.

DbiCreateTable ( hDb, bOverWrite, crTblDsc )

hDb bOverWrite crTblDsc hDBIDb

Boolean pCRTblDesc

The database handle.

When True and there is an existing table, it will be overwritten. If False and the table already exists, an error will be returned.

A pointer to a table descriptor structure.

RESULTS: DBIResult

The function DbiCreateTable creates a table in the database pointed to by the handle.

DbiCreateTempTable ( hDb, pcrTblDsc, phCursor )

hDb hDBIDb pcrTblDsc pCRTblDesc phCursor phDBICur

RETURNS : DBIResult

The database handle. (If this parameter is NIL, all temp tables will be created in the working directory.) The table descriptor structure (CRTblDesc).

The cursor handle.

DbiCreateTempTable creates a temporary table that is deleted when the cursor is closed.

DbiDateDecode ( dateD, piMon, piDay,piYear )

dateD piMon piDay piYear

DBIDATE

pUINT 16

PÜINTI6 pINT I 6

The encoded date.

The variable that will receive the decoded month component.

The variable that will receive the decoded day component.

The variable that will receive the decoded year component.

RETURNS: DBIResult

The database handle.

When True and there is an existing table, it will be overwritten. If False and the table already exists, an error will be returned.

A pointer to a table descriptor structure.

The database handle. (If this parameter is NIL, all temp tables will be created in the working directory.) The table descriptor structure (CRTblDesc).

The cursor handle.

Part Ill-The Well-Rounded Application

DbiDateDecode decodes the data type DBIDATE in separate month, day, and year components.

iMon ¡Day ¡Year pdateD

UINTI6 The month value. Valid values range from I

through 12.

UINTl6 The day value. Valid values range from I

through 3 I.

The year value. Valid values range from -9999 to 9999.

pDBIDATE The variable that will receive the encoded date.

RETURNS: DBIResult

DbiDateEncode creates a data type DBIDATE from individual date components.

DbiDeactivateFilter ( hCursor: hDBICur; hFiiter: hDBIFilter )

hCursor hFiiter hDBICur hDBIFilter

The cursor handle.

The filter handle. NIL deactivates all filters.

RETURNS: DBIResult

DbiDeactivateFilter turns off a specified filter so that it will not affect the records displayed from a cursor.

DbiDeleteAlias ( hCfg, szAliasName )

hCfg hDBICfg szAliasName PChar

RETURNS: DBIResult

The configuration file to be used. This parameter must be NIL.

The alias name to be removed.

DbiDeleteAlias deletes an alias from the BDE configuration file.

DbiDeleteDriver ( hCfg, szDriverName, bSave )

hCfg szDriverName bSave hDBICfg PChar

Boolean

The configuration file to be used. This parameter must be NIL.

The name of the driver to be removed. When True, the changes to the configuration file are saved.

Appendix A—BDE API Quick Reference ■ 313

RETURNS: DBIResult

The function DbiDeleteDriver deletes a database driver from the BDE configuration file.

DbiDeletelndex ( hDb, hCursor, szTableName, szDriverType, szlndexName, szlndexTagName, ilndexld )

hDb hCursor szTableName szDriverType szlndexName szlndexTagName ilndexld

RETURNS : DBIResult

DbiDeletelndex is used to drop an index.

hDBIDb

The

database handle.

hDBICur

The

cursor handle.

PChar

The

table

name.

PChar

The

driver

type.

PChar

The

name

of the

index to

be dropped.

PChar

The

index

tag name. (Used only to identify

dB AS E MDX or

FoxPro .

indexes.)

UINT16

The

index

identifier, used

for Paradox only.

DbiDeleteRecord ( hCursor, pRecBuf )

hCursor pRecBuf hDBICur Byte

The cursor handle.

Pointer to the buffer that can receive the deleted record.

RETURNS: DBIResult

The function DbiDeleteRecord deletes the currently selected record of the provided cursor.

DbiDeleteTable ( hDb, szTableName, szDriverType )

hDb szTabieName szDriverType hDBIDb

PChar PChar

The database handle.

The name of the table to delete.

The driver type of the table being deleted.

RETURNS : DBIResult

DbiDeleteTable deletes a table from the database provided. The client application must have appropriate permissions to be able to lock the table for exclusive use.

314 ■ Part III—The Well-Rounded Application

DbiDllExit

No parameters

RETURNS: DBIResult is used to prepare the BDE to be disconnected from within a DLL only. The function is called immediately prior to calling DbiExit within the DLL.

DbiDoRestructure ( hDb, iTblDescCount, pTblDesc, szSaveAs, szKeyviolName, szProblemsName, bAnalyzeOnly )

hDb iTblDescCount pTblDesc szSaveAs szKeyviolName szProblemsName bAnalyzeOnly hDBIDb UINTI6

pCRTblDesc

PChar

PChar PChar Boolean

The database handle

The number of table descriptors. Must be I.

The CRTblDeSC structure that contains the changes to be applied. If not NIL, a restructured table with this name is created. The original remains unchanged.

The Key Violation table name. The Problems table name. Not currently used.

RETURNS: DBIResult

The function DbiDoRestructure has a wide range of uses. It performs modifications to tables such as modifying field types or sizes, adding or deleting fields, changing indexes and passwords, or packing Paradox tables.

DbiDropFilter ( hCursor, hFilter )

hCursor hFilter hDBICur hDBIFilter

The cursor handle The filter handle.

RETURNS: DBIResult

The function DbiDropFilter drops the filter specified and releases all associated resources.

DbiDropPassword ( szPassword )

PChar

The password to be dropped. If NIL, all passwords for the session are dropped.

Appendix A-BDE API Quick Reference ■ 3 I 5

RETURNS: DBIResult

DbiDropPassword removes a password from the current session. DbiEmptyTable ( hDb, hCursor, szTableName, szDriverType )

hDb hCursor szTableName szDriverType hDBIDb hDBICur PChar PChar

The database handle.

The cursor for the table.

The table name.

The driver type name.

RETURNS: DBIResult deletes all records from the specified table.

DbiEndDelayedUpdates ( phCursor )

The cached updates cursor handle.

RETURNS: DBIResult

The function DbiEndDelayedUpdates removes the cursor from cached updates mode and returns a new cursor handle.

DbiEndLinkMode (phCursor)

phCursor phDBICur

RETURNS: DBIResult

The linked cursor handle.

DbiEndLinkMode takes the cursor out of Link mode and returns a new cursor handle.

DbiEndTran ( hDb, hXact, eEnd )

HXact eEnd hDBIDb HDBIXact eXEnd

The database handle. The transaction handle. The transaction end type.

RETURNS: DBIResult

The function DbiEndTran ends a transaction on either a local table or a SQL server table.

Was this article helpful?

0 0

Post a comment