大网数据广告活动
安装更新与部署

Working with Queries

· 52CE 我爱测

Because the installer uses a relational database, there are functions for making Structured Query Language (SQL) queries to the database. The following procedure describes how to use SQL to query a database.

Because the installer uses a relational database, there are functions for making Structured Query Language (SQL) queries to the database. The following procedure describes how to use SQL to query a database.

To query a database with SQL

  1. Open the View object, with the appropriate SQL statement, by calling the MsiDatabaseOpenView function.

    A View object is the logical table created by applying a query to a set of tables. SQL queries must adhere to the SQL syntax provided by the installer. This SQL statement can contain parameter markers that are not specified until the View object runs.

  2. Run the View object by calling the MsiViewExecute function.

  3. Retrieve the next record from a View object by calling the MsiViewFetch function.

  4. Modify the View object by calling the MsiViewModify function.

    You can also validate data with MsiViewModify by passing the appropriate flags. If MsiViewModify returns ERROR_INVALID_DATA from a validation request, the underlying data is corrupt.

  5. Obtain detailed error information on the View object by calling the MsiViewGetError function.

  6. Close the View object by calling the MsiViewClose function.

For more information, see Examples of Database Queries Using SQL and Script.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。