大网数据广告活动
磁盘与文件系统

Using Columns in a Table

· 52CE 我爱测

Learn more about: Using Columns in a Table

Applies to: Windows | Windows Server

Using Columns in a Table

A table can be created with an initial set of columns by calling JetCreateTableColumnIndex or without columns by calling JetCreateTable. When the table is created with an initial set of columns in the call to JetCreateTableColumnIndex or JetCreateTableColumnIndex2, it contains a JET_TABLECREATE (or JET_TABLECREATE2) structure. These structures contain an array of JET_COLUMNCREATE structures that define the set of columns in the table. The grbit member sets the options on the column and the coltyp member sets the type of data that can be set in the column.

When the table is created without columns, they must be added by calling JetAddColumn with the JET_COLUMNDEF structure. The grbit member of the JET_COLUMNDEF structure sets the options on the column and the coltyp member sets the type of data that can be set in the column. Default column values are set in the call to JetAddColumn by specifying a value in the pvDefault parameter and the size in the cbDefault parameter. A column without a default value effectively has a default value of NULL.

The values in the table can only be set within the context of a transaction. The transaction begins in the call to JetBeginTransaction and ends in the call to JetCommitTransaction. Inside the transaction, a single column value can be set by calling JetSetColumn, or multiple columns values can be set by calling JetSetColumns. JetSetColumns uses an array of JET_SETCOLUMN structures to set multiple columns in the table. The data is contained in the pvData parameter of JetSetColumn, or the pvData member in JET_SETCOLUMN structure.

The JET_COLUMNBASE, JET_COLUMNLIST, and JET_COLUMNDEF structures are returned in the calls to JetGetTableColumnInfo, and JetGetColumnInfo depending on the type of column that is retrieved. The JET_COLUMNBASE structure describes the parameters of the base column, and the JET_COLUMNLIST contains the information needed to traverse the temporary table that is created by the JetGetColumnInfo and JetGetTableColumnInfo functions.

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 04/11/2016
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

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

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