VoDbFieldInfo Function (DWord, DWord, Usual) | |
Retrieve field definition information about a field.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION VoDbFieldInfo(
kInfoType AS DWORD,
wFieldPos AS DWORD,
uValue AS USUAL
) AS LOGIC
public static bool VoDbFieldInfo(
uint kInfoType,
uint wFieldPos,
Usual uValue
)
Request Example
View SourceParameters
- kInfoType
- Type: DWord
Determines what type of information is retrieved. - wFieldPos
- Type: DWord
The position number of the field that you want information on. - uValue
- Type: Usual
New value to assign to the Field.
Return Value
Type:
Logic
TRUE if successful; otherwise, FALSE.
Remarks
VODBFieldInfo() is the same as DBFieldInfo(), except for the purpose of its third argument and the fact that it returns a logical.
This function, however, does not call the error handler and will not, therefore, produce a runtime error message or create an error object if it fails. Thus, it may be important to check the return value to determine if the function succeeded.
The global structure, StrucErrInfo, will contain needed information regarding any error that occurs. See DBFieldInfo() for more information.
Examples
The following examples use VODBFieldInfo() to retrieve field information:
1FUNCTION ShowFieldInfo(wField AS WORD) AS VOID
2 LOCAL uResult AS USUAL
3 uResult := NIL
4 IF VODBFieldInfo(DBS_NAME, wField, @uResult)
5 ? "FieldName(): ", uResult
6 ELSE
7 DoError()
8 ENDIF
9 IF VODBFieldInfo(DBS_TYPE, wField, @uResult)
10 ? "Field type: ", uResult
11 ELSE
12 DoError()
13 ENDIF
14 IF VODBFieldInfo(DBS_LEN, wField, @uResult)
15 ? "Field length: ", uResult
16 ELSE
17 DoError()
18 ENDIF
19 IF VODBFieldInfo(DBS_DEC, wField, @uResult)
20 ? "Decimals: ", uResult
21 ELSE
22 DoError()
23 ENDIF
24 RETURN
25STATIC FUNCTION DoError() AS USUAL
26 LOCAL uRetCode AS USUAL
27 LOCAL oError AS USUAL
28 oError := ErrorBuild(@strucErrInfo)
29 oError:FuncSym := #VODBFieldInfo
30 RETURN EVAL(ErrorBlock(), oError)
See Also