GetColumnHeadings()


" "

short GetColumnHeadings(long QueryID, VARIANT* Headings)

Description

This function returns the column headings (also referred to as column names).

Parameters

Name Description
QueryID The ID of the query, as returned from InitializeQuery().
Headings

A pointer to a VARIANT in which the result is stored. The result is an array of strings (variant type VT_ARRAY | VT_BSTR) containing one string for each column heading.

Initialize the VARIANT before calling this function. Visual Basic does this automatically. Visual C++ programmers should call VariantInit().

Note:
Due to a bug in Microsoft Excel 7.0 and Microsoft Access 7.0 (and possibly other 32-bit Microsoft products that use Visual Basic for Applications), string data in Variant variables received from QMF for Windows may not be translated from Unicode (used by OLE) to ANSI (used by VBA). When this occurs, only the first character of the string is displayed. To remedy this problem, set the variable equal to an empty string before you call the QMF for Windows function that uses the variable.
Note:
Column headings are not available for static SQL statements. For query IDs returned from InitializeStaticQuery(), GetColumnHeadings() returns a string of the form "Coln" where "n" is the column number.

Return Value

The return value will be zero, if successful and non-zero if unsuccessful. If the return value is non-zero, you can call GetLastErrorString(), GetLastErrorType(), GetLastSQLCode(), GetLastSQLError(), or GetLastSQLState() to get additional error information.

Related Tasks

GetColumnHeader()
GetColumnHeadings()