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

JET_TABLECREATE2 Structure

· 52CE 我爱测

Learn more about: JET_TABLECREATE2 Structure

Applies to: Windows | Windows Server

JET_TABLECREATE2 Structure

The JET_TABLECREATE2 structure contains the information that is needed to create a table populated with columns and indexes in an ESE database, and that designates a callback function. The JET_TABLECREATE2 structure is used by JetCreateTableColumnIndex2.

Windows XP: The JET_TABLECREATE2 structure is introduced in Windows XP.

    typedef struct tagJET_TABLECREATE2 {
      unsigned long cbStruct;
      tchar* szTableName;
      tchar* szTemplateTableName;
      unsigned long ulPages;
      unsigned long ulDensity;
      JET_COLUMNCREATE* rgcolumncreate;
      unsigned long cColumns;
      JET_INDEXCREATE* rgindexcreate;
      unsigned long cIndexes;
      tchar* szCallback;
      JET_CBTYP cbtyp;
      JET_GRBIT grbit;
      JET_TABLEID tableid;
      unsigned long cCreated;
    } JET_TABLECREATE2;

Members

cbStruct

The size of this structure in bytes (for future expansion). It must be set to sizeof( JET_TABLECREATE2 ) in bytes.

szTableName

The name of table to create.

The name must use meet the following conditions:

  • Have a value less than JET_cbNameMost, not including the terminating NULL.

  • Consist of the following set of characters: 0 through 9, A through Z, a through z, and all other punctuation except for exclamation point (!), comma (,), opening bracket ([), and closing bracket (]), that is, ASCII characters 0x20, 0x22 through 0x2d, 0x2f through 0x5a, 0x5c, and 0x5d through 0x7f.

  • Not begin with a space.

  • Consist of at least one non-space character.

szTemplateTableName

The name of an already-existing table from which to inherit base DDL (Data Definition Language). Using a template table allows easy creation of many tables with identical columns and indexes.

ulPages

The initial number of database pages to allocate for the table. Specifying a number larger than one can reduce fragmentation if many rows are inserted into this table.

ulDensity

The table density, in percentage points. The number must be either 0 or in the range of 20 through 100. Passing 0 means that the default value should be used. The default is 80.

rgcolumncreate

An array of JET_COLUMNCREATE structures, each of which corresponds to a column to be created in the new table.

cColumns

the number of JET_COLUMNCREATE elements in rgcolumncreate.

rgindexcreate

An array of JET_INDEXCREATE structures, each of which corresponds to an index to be created in the new table.

cIndexes

The number of JET_INDEXCREATE elements in rgindexcreate.

szCallback

The function that gets called during certain events. cbtyp determines when the callback function will be called.

The format of szCallback must be "module!function"—for example, "alpha!beta" refers to the beta function in the module named "alpha". The prototype of the function must match JET_CALLBACK. For more information, see JET_CALLBACK.

cbtyp

Describes the type of callback function designated by szCallback. For more information, see JET_CBTYP. This bitfield is composed of one or more of the following bits.

Value Meaning
JET_cbtypFinalize The callback function will be called when a column that can be finalized has gone to zero.
JET_cbtypBeforeInsert The callback function will be called prior to record insertion.
JET_cbtypAfterInsert The callback function will be called once the database engine has finished inserting a record.
JET_cbtypBeforeReplace The callback function will be called prior to modification of a record.
JET_cbtypAfterReplace The callback function will be called after finishing modification of a record.
JET_cbtypBeforeDelete The callback function will be called prior to deletion of a record.
JET_cbtypAfterDelete The callback function will be called after a record has been deleted.
JET_cbtypUserDefinedDefaultValue The callback function will be called to calculate a user-defined default.
JET_cbtypOnlineDefragCompleted The callback function will be called after a call to <a href="gg294095(v=exchg.10).md">JetDefragment2</a> has completed.
JET_cbtypFreeCursorLS The callback function will be called when the local storage that is associated with a cursor must be freed.
JET_cbtypFreeTableLS The callback function will be called when the local storage that is associated with a table must be freed.

grbit

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

Value Meaning
JET_bitTableCreateFixedDDL Setting JET_bitTableCreateFixedDDL prevents DDL operations on the table (such as adding or removing columns).
JET_bitTableCreateTemplateTable Setting JET_bitTableCreateTemplateTable causes the table to be a template table. New tables can then specify the name of this table as their template table. Setting JET_bitTableCreateTemplateTable implies JET_bitTableCreateFixedDDL.
JET_bitTableCreateNoFixedVarColumnsInDerivedTables Must be used in conjunction with JET_bitTableCreateTemplateTable. Deprecated. Do not use.

tableid

An output field that holds the JET_TABLEID of the new table if the API call succeeds. If the API call fails, the value is undefined.

cCreated

An output field that contains the count of objects that are created if the API call succeeds. If the API call fails, the value is undefined.

The count of objects that is created is equal to the sum of columns, tables, and indexes that are successfully created.

Requirements

Requirement Value
Client Requires Windows  Vista or Windows XP.
Server Requires Windows Server 2008 or Windows Server 2003.
Header Declared in Esent.h.
Unicode Implemented as JET_TABLECREATE2_W (Unicode) and JET_TABLECREATE2_A (ANSI).

See Also

JET_CALLBACK
JET_CBTYP
JET_CONDITIONALCOLUMN
JET_ERR
JET_GRBIT
JET_INDEXCREATE
JET_TABLEID
JetCreateTable
JetCreateTableColumnIndex
JetCreateTableColumnIndex2
JetDefragment2

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)

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

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