Open()


" "

short Open(long QueryID, long RowLimit, BOOLEAN FetchAllRows)

Description

Use this function to run a query that uses the SELECT verb, by opening a cursor in the database for the query. Use FetchNextRow() or FetchNextRows() to retrieve the data for the query, and call Close() when you are done.

If QMF for Windows is configured to fetch all rows (see RSR_AUTOFETCHALLROWS in the description for GetResourceLimit()) or the FetchAllRows parameter is non-zero, QMF for Windows fetches all rows of the result set into its internal buffer before returning from this call.

Note:
The name of this function conflicts with the Microsoft Access 2.0 keyword Execute. If you are using MS Access 2.0, place square brackets [] around the function name.
Note:
Use this function only in statements that contain the SQL verb SELECT. For statements containing any other verb, for example, SET, call Execute() instead. To determine the verb used by a query, call GetQueryVerb().

Parameters

Name Description
QueryID The ID of the query, as returned from InitializeQuery() or InitializeStaticQuery().
RowLimit A number indicating the maximum number of rows to retrieve from the database. Zero indicates that no limit is enforced except for the row limit established by the QMF for Windows Administrator program.
FetchAllRows A Boolean value that indicates whether all rows in the result set are fetched into QMF for Windows's internal buffer. If non-zero, all rows are fetched, closing the cursor and freeing the database for other users. This is the same as calling CompleteQuery().

Return Value

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

Related Tasks

Execute()
ExecuteEx()
ExecuteStoredProcedure()
ExecuteStoredProcedureEx()