Last modified: March 09, 2015
Applies to: Windows | Windows Server
The JetGetLS function enables the application to retrieve the context handle known as Local Storage that is associated with a cursor or the table associated with that cursor. This context handle must have been previously set using JetSetLS. JetGetLS can also be used to simultaneously fetch the current context handle for a cursor or table and reset that context handle.
Windows XP: JetGetLS is introduced in Windows XP.
JET_ERR JET_API JetGetLS( __in JET_SESID sesid, __in JET_TABLEID tableid, __out JET_LS* pls, __in JET_GRBIT grbit );
The session to use for this call.
The cursor to use for this call.
The output buffer that receives the context handle currently associated with the cursor or table.
A group of bits specifying zero or more of the following options.
Indicates that the context handle associated with the given cursor should be retrieved.
If neither JET_bitLSCursor nor JET_bitLSTable is specified then JET_bitLSCursor is presumed.
This option cannot be used with JET_bitLSTable. The operation will fail with JET_errInvalidgrbit if this is attempted.
Indicates that the context handle associated to the table that contains the given cursor should be retrieved. It is illegal to use this option with JET_bitLSCursor. The operation will fail with JET_errInvalidgrbit if this is attempted.
Indicates that the context handle for the chosen object should be reset to JET_LSNil. The current value of the context handle is returned in the output buffer.
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.
The operation completed successfully.
It is not possible to complete the operation because all activity on the instance associated with the session has ceased as a result of a call to JetStopService.
It is not possible to complete the operation because the instance 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.
This error will only be returned by Windows XP and later releases.
One of the options requested was invalid, used in an illegal manner, or not implemented.
This can happen for JetGetLS when both JET_bitLSCursor and JET_bitLSTable are set.
The context handle could not be returned because no context handle is currently associated with the requested object.
Note This error is not returned if JET_bitLSReset is specified yet no context handle was associated with the requested object.
It is not possible to complete the operation because the instance associated with the session has not been initialized yet.
It is not possible to complete the operation because a restore operation is in progress on the instance associated with the session.
It is not possible to complete the operation because the instance associated with the session is being shut down.
On success, the context handle was successfully retrieved from the requested object. If JET_bitLSReset was specified then that context handle was also successfully removed from the object. No change to the database state will occur.
On failure, no change to the state of the requested object has occurred. No change to the database state will occur.
Requires Windows Vista or Windows XP.
Requires Windows Server 2008 or Windows Server 2003.
Declared in Esent.h.