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

JetGotoSecondaryIndexBookmark Function

· 52CE 我爱测

Learn more about: JetGotoSecondaryIndexBookmark Function

Applies to: Windows | Windows Server

JetGotoSecondaryIndexBookmark Function

The JetGotoSecondaryIndexBookmark function positions a cursor to an index entry that is associated with the specified secondary index bookmark. The secondary index bookmark must be used with the same index over the same table from which it was originally retrieved. The secondary index bookmark for an index entry can be retrieved using JetGotoSecondaryIndexBookmark.

Windows XP:  JetGotoSecondaryIndexBookmark is introduced in Windows XP.

    JET_ERR JET_API JetGotoSecondaryIndexBookmark(
      __in          JET_SESID sesid,
      __in          JET_TABLEID tableid,
      __in          void* pvSecondaryKey,
      __in          unsigned long cbSecondaryKey,
      __in_opt      void* pvPrimaryBookmark,
      __in          unsigned long cbPrimaryBookmark,
      __in          const JET_GRBIT grbit
    );

Parameters

sesid

The session to use for this call.

tableid

The cursor to use for this call.

pvSecondaryKey

The buffer that contains the secondary key to use to position the cursor.

cbSecondaryKey

The size of the secondary key in the buffer.

pvPrimaryBookmark

The buffer that contains the primary key bookmark to use to position the cursor.

cbPrimaryBookmark

The size of the primary key bookmark in the buffer.

grbit

A group of bits that specifies zero or more of the following options.

Value Meaning
JET_bitBookmarkPermitVirtualCurrency In the event that the index entry can no longer be found, the cursor will be left positioned where that index entry was previously found. The operation will still fail with JET_errRecordDeleted; however, it will be possible to move to the next or previous index entry relative to the index entry that is now missing.

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_errClientRequestToStopJetService The operation cannot complete because all activity on the instance that is associated with the session has ceased as a result of a call to <a href="gg269240(v=exchg.10).md">JetStopService</a>.
JET_errInstanceUnavailable The operation cannot complete because is because the instance that is associated with the session has encountered a fatal error that requires that access to all data be revoked to protect the integrity of that data.Windows XP:  This return value is introduced in Windows XP.
JET_errInvalidBookmark The secondary index bookmark that was provided was invalid. This error might have occurred because the secondary key is zero or the secondary key buffer pointer is NULL. This error occurs because<ul><li>The current secondary index does not have a uniqueness constraint and the size of the provided bookmark is zero.</li><li>The bookmark buffer pointer is NULL.</li></ul>
JET_errNoCurrentIndex The cursor is not currently on a secondary index. It is not meaningful to go to a secondary index bookmark when the cursor is not currently using a secondary index. <a href="gg294053(v=exchg.10).md">JetGotoBookmark</a> should be used when the cursor is not on a secondary index.
JET_errNotInitialized The operation cannot complete because the instance that is associated with the session has not yet been initialized.
JET_errRecordDeleted The index entry that is associated with the secondary index bookmark could not be found.
JET_errRestoreInProgress The operation cannot complete because a restore operation is in progress on the instance that is associated with the session.
JET_errSessionSharingViolation The same session cannot be used for more than one thread at the same time.Windows XP:  This return value is introduced in Windows XP.
JET_errTermInProgress The operation cannot complete because the instance that is associated with the session is being shut down.

If this function succeeds, the cursor will be positioned at an index entry that is associated with the specified secondary index bookmark. If a record has been prepared for update, that update will be canceled. If an index range is in effect, that index range will be canceled. If a search key has been constructed for the cursor to use, that search key will be deleted. No change to the database state will occur.

If this function fails, the position of the cursor remains unchanged unless JET_errRecordDeleted is returned and JET_bitBookmarkPermitVirtualCurrency is specified. In that case, the cursor will be positioned where the index entry that is associated with the specified secondary index bookmark would have been. The cursor can be moved relative to that position, but is still not on a valid index entry.

If a record has been prepared for update, that update will be canceled. If an index range is in effect, that index range will be canceled. If a search key has been constructed for the cursor to use, that search key will be deleted. In any case, no change to the database state will occur.

Requirements
Requirement Value
Client Requires Windows Vista or Windows XP.
Server Requires Windows Server 2008 or Windows Server 2003.
Header Declared in Esent.h.
Library Use ESENT.lib.
DLL Requires ESENT.dll.
See Also

JET_ERR
JET_GRBIT
JET_SESID
JET_TABLEID
JetGetSecondaryIndexBookmark
JetGotoBookmark
JetStopService

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)

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

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