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

JetGetRecordPosition Function

· 52CE 我爱测

Learn more about: JetGetRecordPosition Function

Applies to: Windows | Windows Server

JetGetRecordPosition Function

The JetGetRecordPosition function returns the fractional position of the current record in the current index in the form of a JET_RECPOS structure. This structure describes fractional positions in terms of an approximate number of index entries before the current record and an approximate total number of entries in the index.

    JET_ERR JET_API JetGetRecordPosition(
      __in          JET_SESID sesid,
      __in          JET_TABLEID tableid,
      __out         JET_RECPOS* precpos,
      __in          unsigned long cbRecpos
    );

Parameters

sesid

The session to use for this call.

tableid

The cursor to use for this call.

precpos

The description of the fraction to use in getting the position of the current record in the current index.

cbRecpos

The size of memory allocated at precpos.

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_errNotInitialized It is not possible to complete the operation because the instance that is associated with the session has not been initialized yet.
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 This operation cannot complete because the instance, associated with the session, encountered a fatal error. It is required that access to all data be revoked in order to protect the integrity of that data.Windows 2000:  This error will not be returned by the Windows 2000 operating system.
JET_errInvalidParameter The size of the allocated memory at precpos is not a sufficient size.
JET_errNoCurrentRecord The cursor is not currently on a record and cannot return a position.
JET_errRestoreInProgress It is not possible to complete the operation 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 2000:  This error will not be returned by the Windows 2000 operating system.
JET_errTermInProgress The operation cannot complete because the instance associated with the session is being shut down.

On success, the approximate number of index entries preceding the current record in the index are returned in precpos->centriesLT. 1 is returned in precpos->centriesInRange. The approximate number of entries in the index is returned in precpos->centriesTotal.

On failure, no changes are made to memory allocated at precpos.

Remarks

This operation returns varying data when updates occur continuously on the table. The changes in the values will not always match expectations based on knowledge of the updates, since the values are approximations based on physical properties of the index. Transactional isolation does not apply to positions from JetGetRecordPosition since the values depend on physical properties of the index that are not transaction isolated.

JET_RECPOS should not be used to describe a record within a table or to reposition a record close to an existing record. Instead, bookmarks for an existing record should be retrieved and then used to reposition the same record.

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.
See Also

JET_COLUMNID
JET_ERR
JET_SESID
JET_TABLEID
JET_RECPOS
JET_SETINFO
JetGotoPosition
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)

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

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