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

JetGetTableIndexInfo Function

· 52CE 我爱测

Learn more about: JetGetTableIndexInfo Function

Applies to: Windows | Windows Server

JetGetTableIndexInfo Function

The JetGetTableIndexInfo function retrieves information about an index.

    JET_ERR JET_API JetGetTableIndexInfo(
      __in          JET_SESID sesid,
      __in          JET_TABLEID tableid,
      __in          const tchar* szIndexName,
      __out         void* pvResult,
      __in          unsigned long cbResult,
      __in          unsigned long InfoLevel
    );

Parameters

sesid

The database session context to use for the API call.

tableid

The database table that contains the index that holds the needed information.

szIndexName

The name of the index that contains information that will be retrieved.

pvResult

Pointer to a buffer which will receive the information. The buffer should be aligned to hold the type required. The type of the buffer is dependent on the InfoLevel parameter.

cbResult

The size, in bytes, of the buffer passed in the pvResult parameter.

InfoLevel

Specifies which information will be stored in pvResult. The valid values are:

Value Meaning
JET_IdxInfo pvResult is interpreted as a <a href="gg269185(v=exchg.10).md">JET_INDEXLIST</a> structure. On success, the <a href="gg269185(v=exchg.10).md">JET_INDEXLIST</a> structure receives information about the index. On failure, the contents of pvBuffer are undefined.
JET_IdxInfoLCID pvResult is interpreted as an LCID. On success, the LCID holds the Locale Identifier of the index. On failure, the contents of pvBuffer are undefined.
JET_IdxInfoList pvResult is interpreted as a <a href="gg269185(v=exchg.10).md">JET_INDEXLIST</a> structure. On success, the <a href="gg269185(v=exchg.10).md">JET_INDEXLIST</a> structure receives information about the index. On failure, the contents of pvBuffer are undefined.
JET_IdxInfoOLC JET_IdxInfoOLC is obsolete.
JET_IdxInfoResetOLC JET_IdxInfoResetOLC is obsolete.
JET_IdxInfoSpaceAlloc pvResult is interpreted as a ULONG. On success, the ULONG holds the space usage of the index. On failure, the contents of pvBuffer are undefined.
JET_IdxInfoSysTabCursor JET_IdxInfoSysTabCursor is obsolete.
JET_IdxInfoLangid JET_IdxInfoLangid is deprecated. Use JET_IdxInfoLCID instead, and the <a href="/windows/win32/api/winnt/nf-winnt-langidfromlcid">LANGIDFROMLCID</a> macro instead.
JET_IdxInfoCount pvResult is interpreted as a ULONG. On success, the ULONG holds the count of indexes on the specified table. szIndexName is ignored. On failure, the contents of pvBuffer are undefined.
JET_IdxInfoVarSegMac pvResult is interpreted as a USHORT. On success, the USHORT holds the value of cbVarSegMac used when the index was created. See <a href="gg269186(v=exchg.10).md">JET_INDEXCREATE</a> for a description of cbVarSegMac. On failure, the contents of pvBuffer are undefined.
JET_IdxInfoIndexId pvResult is interpreted as a <a href="gg269327(v=exchg.10).md">JET_INDEXID</a>. On success, the <a href="gg269327(v=exchg.10).md">JET_INDEXID</a> structure receives information about the index. On failure, the contents of pvBuffer are undefined.
JET_IdxInfoKeyMost pvResult is interpreted as a USHORT. On success, the USHORT holds the value of cbKeyMost used when the index was created. See the <a href="gg269186(v=exchg.10).md">JET_INDEXCREATE</a> structure for a description of cbKeyMost. On failure, the contents of pvBuffer are undefined.
JET_IdxInfoCreateIndex pvResult is interpreted as a <a href="gg269186(v=exchg.10).md">JET_INDEXCREATE</a> structure. On failure, the contents of pvBuffer are undefined.Windows 7:  JET_IdxInfoCreateIndex is introduced in Windows 7.
JET_IdxInfoCreateIndex2 pvResult is interpreted as a <a href="gg294082(v=exchg.10).md">JET_INDEXCREATE2</a> structure. On failure, the contents of pvBuffer are undefined.Windows 7:  JET_IdxInfoCreateIndex2 is introduced in Windows 7.
JET_IdxInfoSpaceOwned pvResult is interpreted as a ULONG. On success, the ULONG holds the number of pages owned by the index. See Remarks for more information. Windows 11: JET_IdxInfoSpaceOwned is introduced in Windows 11.
JET_IdxInfoSpaceAvail pvResult is interpreted as a ULONG. On success, the ULONG holds the number of pages available in the index. See Remarks for more information. Windows 11: JET_IdxInfoSpaceAvail is introduced in Windows 11.

Return Value

This function returns the JET_ERR datatype with one of the following return codes. For more information about the possible ESE errors, see Extensible Storage Engine Errors and Error Handling Parameters.

Return code Description
JET_errSuccess The operation completed successfully.
JET_errIndexNotFound The specified index cannot be found in the specified table.
JET_wrnBufferTruncated The buffer passed in as pvResult was too small. The contents of the buffer are undefined.
Remarks

JetGetIndexInfo and JetGetTableIndexInfo retrieve identical information about an index. The difference is in how the table is specified. JetGetIndexInfo expects a database (dbid) and name of a table (szTableName), while JetGetTableIndexInfo expects a table identifier (tableid).

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.
Library Use ESENT.lib.
DLL Requires ESENT.dll.
Unicode Implemented as JetGetTableIndexInfoW (Unicode) and JetGetTableIndexInfoA (ANSI).
See Also

JET_COLUMNID
JET_ERR
JET_GRBIT
JET_SESID
JET_TABLEID
JET_INDEXCREATE
JET_INDEXCREATE2 JET_INDEXID
JET_INDEXLIST JetGetIndexInfo

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)

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

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