Advantage Client Engine
Retrieves the text string version of the given field from the given table
UNSIGNED32 |
AdsGetField (ADSHANDLE hTable, UNSIGNED8 *pucFldName, UNSIGNED8 *pucBuf, UNSIGNED32 *pulLen, UNSIGNED16 usOption); |
hTable (I) |
Handle of table or cursor. |
pucFldName (I) |
Name of field to retrieve. |
pucBuf (O) |
Return field in this buffer. |
pulLen (I/O) |
Length of given buffer on input, length of returned data on output. |
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) |
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. |
AdsGetField 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. If AdsGetField returns AE_INSUFFICIENT_BUFFER, the number of bytes 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.