DbiGetProp

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

DbiGetProp

Return to chapter overview

C syntax

DBIResult DBIFN DbiGetProp (hObj, iProp, pPropValue, iMaxLen, piLen);

Delphi syntax

function DbiGetProp (hObj: hDBIObj; iProp: Longint; PropValue: Pointer; iMaxLen: Word; var iLen: Word): DBIResult stdcall;

Description

DbiGetProp retrieves the properties of an object. See Getting and Setting Properties.

Parameters

hObj                Type: hDBIObj                (Input)
Specifies the system, session, client, driver, database, cursor, or statement object.

iProp                Type: UINT32                (Input)
Specifies the property to retrieve.

pPropValue                Type: pVOID                (Output)
Pointer to the client variable that receives the value of the property. Optional. If NULL, validates iProp for retrieval.

iMaxLen                Type: UINT16                (Input)
Specifies the length of the pPropValue buffer.

piLen                Type: pUINT16                (Output)
Pointer to the client variable that receives the buffer length.

Usage

The specified object does not necessarily have to match the type of property as long as the object is associated with the object type of the property. For example, the property drvDRIVERTYPE assumes an object of type objDRIVER, but because a cursor is derived from a driver, a cursor handle (objCURSOR) could also be specified. See DbiGetObjFromObj for details about associated objects.

You can access the native connection, statement, and cursor handles by using DbiGetProp with the properties: dbNATIVEHNDL, dbNATIVEPASSTHRUHNDL, stmtNATIVEHNDL, and curNATIVEHNDL. This feature for retrieving native handles is useful for making direct native API calls when the necessary functionality is not available through BDE or in order to improve performance.

To inquire whether a driver supports stored procedures, use the property dbPROCEDURES.

To retrieve the server's default transaction isolation level use the property dbDEFAULTTXNISO.

Example

DBIPATH filename;

result=DbiGetProp (hCursor, curFILENAME, &filename, sizeof (DBIPATH), &length);

returns the file name associated with the cursor handle hCursor in filename and its length in length.

DbiResult

Meaning

DBIERR_NONE

The properties were retrieved successfully.

DBIERR_BUFFTOOSMALL

Required buffer length is bigger than iMaxLen.

DBIERR_NOTSUPPORTED

Property is not supported for this object.

See also

DbiSetProp, DbiGetCursorProps, DbiGetObjFromObj