short GetVariables(long QueryID, VARIANT* Variables)
Description
This function returns an array that includes the names of all the variables in the query's SQL text. You can assign values to these variables by calling SetVariable() prior to running the query using either Open() or Execute().
Parameters
Name | Description |
---|---|
QueryID | The ID of the original query, as returned from InitializeQuery(). |
Variables |
A pointer to a VARIANT in which the result is stored. The result is an array of strings (variant type VT_ARRAY | VT_BSTR), with each string containing the name of one variable. If there are no variables in the SQL statement, the result is empty (variant type VT_EMPTY). Initialize the VARIANT before calling this function. Visual Basic does this automatically. Visual C++ programmers should call VariantInit().
|
Return Value
The return value will be zero if successful or non-zero if unsuccessful. If there are no variables in the SQL statement, the return value is RS_ERROR_NO_DATA (-1). If the return value is non-zero, you can call GetLastErrorString() or GetLastErrorType() to get additional error information.