InitializeQuery()


" "

long InitializeQuery(short SourceType, BSTR Source)

Description

This function sets the SQL text that you want to use in a query. You can pass the SQL text as a parameter to this function, read it from a text file, or obtain it from an existing query. Call Close() when you are finished with the query.

Parameters

Name Description
SourceType

Specifies the source for the SQL statement text as follows:

0 (RSS_STRING) -- The text is contained in the Source parameter.
2 (RSS_FILE) -- The text is contained in the query whose owner and name is specified by the Source parameter.
3 (RSS_QMFPROC) -- The text is contained in the procedure whose owner and name are specified by the Source parameter.

Source A string containing the text, the owner and name (Owner.Name) of the query, or the name of a file containing the SQL text.

Return Value

If successful, the ID of the query. If unsuccessful, a negative one (-1). Use this value in all interface calls that require the QueryID parameter.