MsiDatabaseOpenView

[This is preliminary documentation and subject to change.]

The MsiDatabaseOpenView function prepares a database query and creates a view object.

UINT MsiDatabaseOpenView(
  MSIHANDLE hDatabase,   // database handle
  LPCTSTR szQuery,       // SQL query to be prepared
  MSIHANDLE *phView      // returned view if TRUE
);
 

Parameters

hDatabase
Handle to the database to which you want to open a view object.
szQuery
Specifies a SQL query string for querying the database. For correct syntax, see SQL Syntax.
phView
Pointer to a handle for the returned view.

Return Values

ERROR_BAD_QUERY_SYNTAX
An invalid SQL query string was passed to the function.
ERROR_INVALID_HANDLE
An invalid or inactive handle was supplied.
ERROR_SUCCESS
The function succeeded, and the handle is to a view object.

Remarks

The MsiDatabaseOpenView function opens a view object for a database. You must open a view object for a database before performing any execution or fetching.

If an error occurs, you can call MsiGetLastErrorRecord for more information.

QuickInfo

  Windows NT: Requires version 4.0 or later. Available as a redistributable for Windows NT 4.0.
  Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in msiquery.h.
  Import Library: Use msi.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Database Access Reference, General Database Access Functions