AdsGetString

Advantage Client Engine

Retrieves the text string version of the given field from the given table.

Syntax

UNSIGNED32

AdsGetString (ADSHANDLE hTable,

UNSIGNED8 *pucFldName,

UNSIGNED8 *pucBuf,

UNSIGNED32 *pulLen,

UNSIGNED16 usOption);

Parameters

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, ADS_LTRIM, and ADS_RTRIM.

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.

Remarks

AdsGetString may be used to retrieve strings, numerics, dates, logicals, ModTime, and memos. Dates are returned in their raw format (CCYYMMDD). Binary data cannot be retrieved using AdsGetString, see AdsGetBinary. In addition, this function does not support short date, double, CurDouble, integer, short integer, time, or timestamp data. If the function returns AE_INSUFFICIENT_BUFFER, the number of bytes needed for the call to succeed is returned in the pulLen parameter.

When called on a logical field, the value returned will be a T, an F, or a space representing a NULL value.

For memo fields use AdsGetMemoLength to get the size in bytes that will be returned if needed.

The string returned respects the null termination setting specified by AdsNullTerminateStrings.

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

Click Here

See Also

AdsSetString

AdsGetField

AdsGetMemoLength

AdsGetBinaryLength