|
<< Click to Display Table of Contents >> DbiSetProp |
![]() ![]()
|
C syntax
DBIResult DBIFN DbiSetProp (hObj, iProp, iPropValue);
Delphi syntax
function DbiSetProp (hObj: hDBIObj; iProp: Longint; iPropValue: Longint): DBIResult stdcall;
Description
DbiSetProp sets the specified properties of an object to a given value. See Getting and Setting Properties.
Parameters
hObj Type: hDBIObj (Input)
Specifies the object handle to a system, client, session, driver, database, cursor, or statement object.
iProp Type: UINT32 (Input)
Specifies the property to set.
iPropValue Type: UINT32 (Input)
Specifies the value of the property.
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.
Example
To set the translation mode of a cursor to xltNONE (see DbiOpenTable), use:
| DbiSetProp (hCursor, curXLTMODE, (UINT32) xltNONE); |
For properties wider than 32-bits, pass a pointer to the property, and cast the pointer to (UINT32).
Example
The following example shows how you can use DbiSetProp to specify your preference for live or canned result sets during query execution. A canned result set is like a snapshot or a copy of the original data selected by the query. In contrast, a live result set is a view of the original data; specifically, if you modify a live result set, the changes are reflected in the original data.
| DbiSetProp(hSt, stmtLIVENESS, (UINT32) wantLIVE); |
DbiResult |
Meaning |
DBIERR_NONE |
The property of the object was successfully set. |
DBIERR_NOTSUPPORTED |
Property is not supported for this object. |
DBIERR_INVALIDPARAM |
hObj is null or invalid. |
See also