ExecuteEx()


" "

short ExecuteEx(long QueryID, VARIANT* Result)

Description

This function executes an SQL statement that uses an SQL verb other than SELECT and CALL.

Parameters

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

A pointer to a VARIANT in which the result will be stored. The result is an array (variant type VT_ARRAY | VT_VARIANT) containing one value for each column in the result.

Each value is specified in its native data type or the closest variant data type. The supported return types are:

  • string (variant type VT_BSTR)
  • float (variant type VT_R4)
  • double (variant type VT_R8)
  • short (variant type VT_I2)
  • long (variant type VT_I4)
  • binary (variant type VT_UI1 | VT_ARRAY)
Note:
Initialize the VARIANT before calling this function. Visual Basic does this automatically. Visual C++ programmers can call VariantInit()
.

Return Value

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

Related Tasks

Execute()
ExecuteStoredProcedure()
ExecuteStoredProcedureEx()
Open()