DIWbemServices.ExecQueryAsync

[This is preliminary documentation and subject to change.]

The DIWbemServices.ExecQueryAsync method performs the same task as DIWbemServices.ExecQuery, except that the result set is supplied to the specified response handler.

For the valid types of queries that can be performed, see Queries.

DIWbemServices.ExecQueryAsync(
  [in] QueryLanguage As String,                
  [in] Query As String,                        
  [in] lFlags As Long,                       
  [in] pCtx As Object,              
  [in] pResponseHandler As Object  
) As Long
 

Parameters

QueryLanguage
A string containing one of the query languages supported by CIMOM. This must be "WQL" for the WBEM Query Language.
Query
A string containing the text of the query. This cannot be vbNullString.
lFlags
Reserved. It must be zero.
pCtx
Typically NOTHING. Otherwise, this is a DWbemContext object required by the dynamic class provider that is producing the class instances. The values in the context object must be specified in the documentation for the provider in question.

If the query is broad and involves many instance providers, it is not practical to include enough context information for all providers. In these situations, the parameter should be set to NOTHING.

pResponseHandler
The caller's implementation of DIWbemObjectSink. This handler receives the objects in the query result set as they become available. CIMOM calls DIWbemObjectSink.Indicate with the objects any number of times, followed by a single call to DIWbemObjectSink.SetStatus to indicate the final status.

For a detailed explanation of this parameter, see Asynchronous Methods.

Return Values

WBEM_E_FAILED Unspecified error.
WBEM_E_INVALID_CLASS The specified class was invalid.
WBEM_E_INVALID_PARAMETER An invalid parameter was specified, or the namespace could not be parsed.
WBEM_E_OUT_OF_MEMORY There was not enough memory to complete the operation.
WBEM_NO_ERROR Success.

For more information on return values see Visual Basic error handeling and return values.

Other error codes are returned to the object sink specified by the pResponseHandler parameter.

See Also

Asynchronous Methods, DIWbemServices.ExecQuery, Queries