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

Column Definition Format

· 52CE 我爱测

MsiViewGetColumnInfo and the ColumnInfo Property of the View object use the following format to describe database column definitions.

MsiViewGetColumnInfo and the ColumnInfo Property of the View object use the following format to describe database column definitions. Each column is described by a string in the corresponding record field returned by the function or property. The definition string consists of a single letter representing the data type followed by the width of the column (in characters when applicable, bytes otherwise). A width of zero designates an unbounded width (for example, long text fields and streams). An uppercase letter indicates that null values are allowed in the column.

Column descriptor Definition string
s? String, variable length (?=1-255)
s0 String, variable length
i2 Short integer
i4 Long integer
v0 Binary Stream
g? Temporary string (?=0-255)
j? Temporary integer (?=0,1,2,4)
O0 Temporary object

The strings used to describe columns have the following relationship to the SQL query strings used by CREATE and ALTER. For more information, see SQL Syntax.

Returned value SQL syntax
s0 LONGCHAR
l0 LONGCHAR LOCALIZABLE
s # CHAR(#)
s # CHARACTER(#)
l # CHAR(#) LOCALIZABLE
l # CHARACTER(#) LOCALIZABLE
i2 SHORT
i2 INT
i2 INTEGER
i4 LONG
v0 OBJECT

If the letter is not capitalized, the SQL statement should be appended with NOT NULL.

Returned value SQL syntax
s0 LONGCHAR NOT NULL

The installer does not internally limit the length of columns to the value specified by the column definition format. If the data entered into a field exceeds the specified column length, the package fails to pass package validation. To pass validation in this case, either the data or the database schema must be changed. The only means to change the column length of a standard table is by exporting the table using MsiDatabaseExport, editing the exported .idt file, and then importing the table using MsiDatabaseImport. Authors cannot change the column data types, nullability, or localization attributes of any columns in standard tables. Authors can create custom tables with columns having any column attributes.

When using MsiDatabaseMerge to merge a reference database into a target database, the column names, number of primary keys, and column data types must match. MsiDatabaseMerge ignores the localization and column length attributes. If a column in the reference database has a length that is 0 or greater than the that column's length in the target database, MsiDatabaseMerge increases the column length in the target database to the length in the reference database.

When using Mergmod.dll version 2.0, the application of a merge module to a .msi file never changes the length of columns or the column types of an existing database table. The application of a merge module can however change the schema of an existing database table if the module adds new columns to a table for which it is valid to add columns. When using a Mergemod.dll version less than version 2.0, the application of a merge module never changes the length of columns and never changes the schema of the target database.

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)

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

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