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

JET_COLUMNDEF Structure

· 52CE 我爱测

Learn more about: JET_COLUMNDEF Structure

Applies to: Windows | Windows Server

JET_COLUMNDEF Structure

The JET_COLUMNDEF structure defines the data that can be stored in a column.

    typedef struct {
      unsigned long cbStruct;
      JET_COLUMNID columnid;
      JET_COLTYP coltyp;
      unsigned short wCountry;
      unsigned short langid;
      unsigned short cp;
      unsigned short wCollate;
      unsigned long cbMax;
      JET_GRBIT grbit;
    } JET_COLUMNDEF;

Members

cbStruct

The size of the structure, in bytes. It must be set to sizeof( JET_COLUMNDEF).

columnid

Reserved. columnid must be set to 0 (zero).

coltyp

The type of the column (for example, text, binary, or numerical). For more information, see JET_COLTYP.

wCountry

Reserved. wCountry must be set to 0 (zero).

langid

Obsolete. langid should be set to 0 (zero).

cp

The code page for the column. The only valid values for text columns are English (1252) and Unicode (1200). A value of zero means the default will be used (English, 1252). If the column is not a text column, the code page automatically gets set to zero.

wCollate

Reserved. wCollate must be set to 0 (zero).

cbMax

The maximum length, in bytes, of a variable-length column, or the length of a fixed-length column.

grbit

A group of bits that contain the options to be used for this call, which include zero or more of the following values.

Value Meaning
JET_bitColumnFixed The column will be fixed. It will always use the same amount of space in a row, regardless of how much data is being stored in the column. JET_bitColumnFixed cannot be used with JET_bitColumnTagged. This bit cannot be used with long values (that is JET_coltypLongText and JET_coltypLongBinary).
JET_bitColumnTagged The column will be tagged. Tagged columns do not take up any space in the database if they do not contain data. This bit cannot be used with JET_bitColumnFixed.
JET_bitColumnNotNULL The column must never be set to a NULL value.
JET_bitColumnVersion The column is a version column that specifies the version of the row. The value of this column starts at zero and will be automatically incremented for each update on the row.This bit can only be applied to JET_coltypLong columns. This bit cannot be used with JET_bitColumnAutoincrement, JET_bitColumnEscrowUpdate, or JET_bitColumnTagged.
JET_bitColumnAutoincrement The column will automatically be incremented. The number is an increasing number, and is guaranteed to be unique within a table. The numbers, however, might not be continuous. For example, if five rows are inserted into a table, the "autoincrement" column could contain the values { 1, 2, 6, 7, 8 }. This bit can only be used on columns of type JET_coltypLong or JET_coltypCurrency.Windows 2000:  In Windows 2000, this bit can only be used on columns of type JET_coltypLong.
JET_bitColumnUpdatable This bit is valid only on calls to <a href="gg269215(v=exchg.10).md">JetGetColumnInfo</a>.
JET_bitColumnTTKey This bit is valid only on calls to <a href="gg294118(v=exchg.10).md">JetOpenTable</a>.
JET_bitColumnTTDescending This bit is valid only on calls to <a href="gg269211(v=exchg.10).md">JetOpenTempTable</a>.
JET_bitColumnMultiValued The column can be multi-valued. A multi-valued column can have zero, one, or more values associated with it. The various values in a multi-valued column are identified by a number called the itagSequence member, which belongs to various structures, including: <a href="gg294049(v=exchg.10).md">JET_RETINFO</a>, <a href="gg294090(v=exchg.10).md">JET_SETINFO</a>, <a href="gg269233(v=exchg.10).md">JET_SETCOLUMN</a>, <a href="gg269334(v=exchg.10).md">JET_RETRIEVECOLUMN</a>, and <a href="gg294052(v=exchg.10).md">JET_ENUMCOLUMNVALUE</a>. Multi-valued columns must be tagged columns; that is, they cannot be fixed-length or variable-length columns.
JET_bitColumnEscrowUpdate Specifies that a column is an escrow update column. An escrow update column can be updated concurrently by different sessions with <a href="gg294125(v=exchg.10).md">JetEscrowUpdate</a> and will maintain transactional consistency. An escrow update column must also meet the following conditions:<ul><li>An escrow update column can be created only when the table is empty.</li></ul><ul><li>An escrow update column must be of type JET_coltypLong.</li></ul><ul><li>An escrow update column must have a default value (that is cbDefault must be positive).</li></ul><ul><li>JET_bitColumnEscrowUpdate cannot be used in conjunction with JET_bitColumnTagged, JET_bitColumnVersion, or JET_bitColumnAutoincrement.</li></ul>
JET_bitColumnUnversioned The column will be created in an without version information. This means that other transactions that attempt to add a column with the same name will fail. This bit is only useful with <a href="gg294122(v=exchg.10).md">JetAddColumn</a>. It cannot be used within a transaction.
JET_bitColumnMaybeNull Reserved for future use.
JET_bitColumnFinalize Use JET_bitColumnDeleteOnZero instead of JET_bitColumnFinalize. JET_bitColumnFinalize that a column can be finalized. When a column that can be finalized has an escrow update column that reaches zero, the row will be deleted. Future versions might invoke a callback function instead (For more information, see <a href="gg294098(v=exchg.10).md">JET_CALLBACK</a>). A column that can be finalized must be an escrow update column. JET_bitColumnFinalize cannot be used with JET_bitColumnUserDefinedDefault.
JET_bitColumnUserDefinedDefault The default value for a column will be provided by a callback function. See <a href="gg294098(v=exchg.10).md">JET_CALLBACK</a>. A column that has a user-defined default must be a tagged column. Specifying JET_bitColumnUserDefinedDefault means that pvDefault must point to a <a href="gg269200(v=exchg.10).md">JET_USERDEFINEDDEFAULT</a> structure, and cbDefault must be set to sizeof( <a href="gg269200(v=exchg.10).md">JET_USERDEFINEDDEFAULT</a> ).<ul><li>JET_bitColumnUserDefinedDefault cannot be used in conjunction with JET_bitColumnFixed, JET_bitColumnNotNULL, JET_bitColumnVersion, JET_bitColumnAutoincrement, JET_bitColumnUpdatable, JET_bitColumnEscrowUpdate, JET_bitColumnFinalize, JET_bitColumnDeleteOnZero, or JET_bitColumnMaybeNull.</li></ul>
JET_bitColumnDeleteOnZero The column is an escrow update column, and when it reaches zero, the record will be deleted. A common use for a column that can be finalized is to use it as a reference count field, and when the field reaches zero the record gets deleted. JET_bitColumnDeleteOnZero is related to JET_bitColumnFinalize. A Delete-on-zero column must be an escrow update column. JET_bitColumnDeleteOnZero cannot be used with JET_bitColumnFinalize. JET_bitColumnDeleteOnZero cannot be used with user defined default columns.

Requirements

Requirement Value
Client Requires Windows Vista, Windows XP, or Windows 2000 Professional.
Server Requires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.
Header Declared in Esent.h.

See Also

JET_CALLBACK
JET_COLTYP
JET_COLUMNCREATE
JET_COLUMNID
JET_GRBIT
JET_USERDEFINEDDEFAULT
JetAddColumn
JetEscrowUpdate
JetGetTableColumnInfo
JetOpenTempTable
JetOpenTempTable2
JetOpenTempTable3
JetRenameColumn

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)

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

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