AdsGetField / AdsGetFieldW
Advantage Client Engine
|
AdsGetField / AdsGetFieldW Advantage Client Engine |
|
|
|
|
AdsGetField / AdsGetFieldW Advantage Client Engine |
|
|
Retrieves the text string version of the given field from the given table
Syntax
UNSIGNED32 |
AdsGetField (ADSHANDLE hTable, UNSIGNED8 *pucFldName, UNSIGNED8 *pucBuf, UNSIGNED32 *pulLen, UNSIGNED16 usOption); |
UNSIGNED32 |
AdsGetFieldW ( ADSHANDLE hTable, UNSIGNED8 *pucFldName, WCHAR *pwcBuf, UNSIGNED32 *pulLen, UNSIGNED16 usOption); |
Parameters
hTable (I) |
Handle of table or cursor. |
pucFldName (I) |
Name of field to retrieve. |
pucBuf (O) |
For AdsGetField, this parameter returns field data as an ANSI/OEM encoded text string in this buffer. |
pwcBuf (O) |
For AdsGetFieldW, this parameter returns field data as a UTF16 encoded Unicode text string in this buffer. |
pulLen (I/O) |
Length of given buffer on input, length of returned data on output. For AdsGetField, the length is number of bytes. For AdsGetFieldW, the length is number of UTF16 characters. |
usOption (I) |
Option to trim spaces from the returned data. ADS_NONE, ADS_TRIM, (trims leading and trailing spaces) ADS_LTRIM, (trims leading spaces) and ADS_RTRIM (trims trailing spaces) |
Special Return Codes
AE_INSUFFICIENT_BUFFER |
The buffer passed to the function was insufficient to return all data. |
AE_NO_CURRENT_RECORD |
Data cannot be retrieved from EOF or BOF. |
AE_UNICODE_CONVERSION |
Unicode data cannot be converted into ANSI/OEM encoded string without loss. |
Remarks
AdsGetField and AdsGetFieldW can be used to retrieve string, numeric, date, logical, double, CurDouble, Money, integer, short date, time, timestamp, memo, image, RowVersion, ModTime, and binary data. For numerics, Money, times, timestamps, and dates, it converts the result to a string (instead of storing the IEEE numeric data in the buffer). Dates are formatted according to the date mask set by AdsSetDateFormat. AdsGetField returns data in an ANSI/OEM encoded string. AdsGetFieldW returns data in a UTF16 encoded Unicode string.
If AdsGetField returns AE_INSUFFICIENT_BUFFER, the number of bytes needed for the call to succeed is returned in the pulLen parameter.
If AdsGetFieldW returns AE_INSUFFICIENT_BUFFER, the number of UTF16 characters needed for the call to succeed is returned in the pulLen parameter.
The pucFldName parameter can be passed as the field name itself or as the one-based integer field position. To pass an integer field position for the pucFldName parameter, use the ADSFIELD macro that is defined in ACE.H. For example, to specify the first field in the table, pass ADSFIELD(1) for the pucFldName parameter; to specify the second field in the table, pass ADSFIELD(2) for the pucFldName parameter; etc.
Example
See Also