JET_CBTYP

Windows

The JET_CBTYP group of constants describes all possible points in an operation that the database engine will notify an application by calling the JET_CALLBACK callback function. The database engine passes one of these constants in the cbtyp parameter of the callback function. The meaning of the other parameters passed by the database engine in this call depend on the specific JET_CBTYP passed.

Windows XP:  The JET_CBTYP group of constants are introduced in Windows XP.

Constant/value

Description

JET_cbtypNull
0x00000000

This callback is reserved and always considered invalid.

JET_cbtypFinalize
0x00000001

This callback is reserved for future use.

JET_cbtypBeforeInsert
0x00000002

This callback will occur just before a new record is inserted into a table by a call to JetUpdate.

The function pointer for this callback reason is either passed to JetCreateTableColumnIndex by means of JET_TABLECREATE or is configured at runtime by means of JetRegisterCallback. For more information, see JET_TABLECREATE or JetRegisterCallback.

The callback parameters will have the following values:

  • sesid: The session that has the record to be inserted.

  • dbid: The database ID of the table that contains the record to be inserted.

  • tableid: The cursor that has prepared the new record to be inserted. It is important to note that the value of any version or auto-increment columns may not be correct at this time.

  • pvArg1: NULL

  • pvArg2: NULL

  • pvContext: The context pointer passed to JetRegisterCallback or NULL.

  • ulUnused: NULL If an error is returned by the callback, the operation originating the callback will fail with that error.

JET_cbtypAfterInsert
0x00000004

This callback will occur just after a new record has been inserted into a table by a call to JetUpdate but before JetUpdate returns to its caller.

The function pointer for this callback reason is either passed to JetCreateTableColumnIndex by means of JET_TABLECREATE or is configured at runtime by means of JetRegisterCallback. For more information, see JET_TABLECREATE or JetRegisterCallback.

The callback parameters will have the following values:

  • sesid: The session that has the record that was just inserted.

  • dbid: The database ID of the table that contains the record that was just inserted.

  • tableid: A cursor on the table into which the record that was just inserted. Note that the cursor is still positioned on the same index entry as it was in the before insert callback. Further note that this index entry may not be related in any way to the record being inserted.

  • pvArg1: NULL

  • pvArg2: NULL

  • pvContext: The context pointer passed to JetRegisterCallback or NULL.

  • ulUnused: NULL If an error is returned by the callback, it will be ignored.

JET_cbtypBeforeReplace
0x00000008

This callback will occur just prior to an existing record in a table being changed by a call to JetUpdate.

The function pointer for this callback reason is either passed to JetCreateTableColumnIndex by means of JET_TABLECREATE or is configured at runtime by means of JetRegisterCallback. For more information, see JET_TABLECREATE or JetRegisterCallback.

The callback parameters will have the following values:

  • sesid: The session that has the record to be changed.

  • dbid: The database ID of the table that contains the record to be changed.

  • tableid: A cursor positioned on an index entry associated with the record to be changed. It is important to note that the value of any version or auto-increment columns may not be correct at this time.

  • pvArg1: NULL

  • pvArg2: NULL

  • pvContext: The context pointer passed to JetRegisterCallback or NULL.

  • ulUnused: NULL If an error is returned by the callback, the operation originating the callback will fail with that error.

JET_cbtypAfterReplace
0x00000010

This callback will occur just after an existing record in a table has been changed by a call to JetUpdate but prior to JetUpdate returning to its caller.

The function pointer for this callback reason is either passed to JetCreateTableColumnIndex by means of JET_TABLECREATE or is configured at runtime by means of JetRegisterCallback. For more information, see JET_TABLECREATE or JetRegisterCallback.

The callback parameters will have the following values:

  • sesid: The session that has the record that was just changed.

  • dbid: The database ID of the table that contains the record that was just changed.

  • tableid: A cursor positioned on an index entry associated with the record that was just changed.

  • pvArg1: NULL

  • pvArg2: NULL

  • pvContext: The context pointer passed to JetRegisterCallback or NULL.

  • ulUnused: NULL If an error is returned by the callback, it will be ignored.

JET_cbtypBeforeDelete
0x00000020

This callback will occur just before an existing record in a table is deleted by a call to JetDelete.

The function pointer for this callback reason is either passed to JetCreateTableColumnIndex by means of JET_TABLECREATE or is configured at runtime by means of JetRegisterCallback. For more information, see JET_TABLECREATE or JetRegisterCallback.

The callback parameters will have the following values:

  • sesid: The session that has the record to be deleted.

  • dbid: The database ID of the table that contains the record to be deleted.

  • tableid: A cursor positioned on an index entry associated with the record to be deleted.

  • pvArg1: NULL

  • pvArg2: NULL

  • pvContext: The context pointer passed to JetRegisterCallback or NULL.

  • ulUnused: NULL If an error is returned by the callback, the operation originating the callback will fail with that error.

JET_cbtypAfterDelete
0x00000040

This callback will occur just after an existing record in a table has been deleted by a call to JetDelete but before JetDelete returns to its caller.

The function pointer for this callback reason is either passed to JetCreateTableColumnIndex by means of JET_TABLECREATE or is configured at runtime by means of JetRegisterCallback. For more information, see JET_TABLECREATE or JetRegisterCallback.

The callback parameters will have the following values:

  • sesid: The session that has the record that was just deleted.

  • dbid: The database ID of the table that contains the record that was just deleted.

  • tableid: A cursor positioned on an index entry associated with the record that was just deleted.

  • pvArg1: NULL

  • pvArg2: NULL

  • pvContext: the context pointer passed to JetRegisterCallback or NULL.

  • ulUnused: NULL

If an error is returned by the callback, it will be ignored.

JET_cbtypUserDefinedDefaultValue
0x00000080

This callback will occur when the engine needs to retrieve the user defined default value of a column from the application. This callback is essentially a limited implementation of JetRetrieveColumn that is evaluated by the application. A maximum of one column value can be returned for a user defined default value.

The function pointer for this callback reason is either passed to JetAddColumn by means of a JET_USERDEFINEDDEFAULT structure or passed to JetCreateTableColumnIndex by means of a JET_USERDEFINEDDEFAULT structure in a JET_COLUMNCREATE structure in a JET_TABLECREATE structure.

The callback parameters will have the following values:

  • sesid: The session that is computing the user defined default value

  • dbid: The database ID of the table that contains the user defined default value

  • tableid: A cursor positioned on the record for which the user defined default value is being retrieved

  • pvArg1: The output buffer for the user defined default value

  • pvArg2: On input, this is the size of the output buffer. On output, this is the actual size of the user defined default value. in either case, the size is a 32-bit unsigned integer.

  • pvContext: A pointer to a buffer containing the user data specified in the JET_USERDEFINEDDEFAULT structure when the column was created or NULL if no context was provided.

  • ulUnused: The column ID of the column for which the user defined default value is being retrieved.

If an error is returned by the callback then the operation originating the callback will fail with that error.

If JET_wrnBufferTruncated is returned by the callback, the operation will continue, but the entire value is not retrieved during the callback.

If JET_wrnColumnNull is returned by the callback, the operation will continue, but the user defined default value for the column is NULL.

JET_cbtypOnlineDefragCompleted
0x00000100

This callback will occur when the online defragmentation of a database as initiated by JetDefragment has stopped due to either the process being completed or the time limit being reached.

The function pointer for this callback reason is passed to JetDefragment. For more information, see JetDefragment.

The callback parameters will have the following values:

  • sesid: The session used to perform online defragmentation for the database or JET_sesidNil for a streaming file.

  • dbid: The database ID of the database being defragmented or JET_dbidNil for a streaming file.

  • tableid: JET_tableidNil

  • pvArg1: NULL

  • pvArg2: NULL

  • pvContext: NULL

  • ulUnused: NULL

If an error is returned by the callback, it will be ignored.

JET_cbtypFreeCursorLS
0x00000200

This callback will occur when the application needs to clean up the context handle for the Local Storage associated with a cursor that is being released by the database engine. For more information, see JetSetLS.

The function pointer for this callback reason is configured by means of JetSetSystemParameter with JET_paramRuntimeCallback.

The callback parameters will have the following values:

  • sesid: JET_sesidNil

  • dbid: JET_dbidNil

  • tableid: JET_tableidNil

  • pvArg1: The context handle set using JetSetLS

  • pvArg2: NULL

  • pvContext: NULL

  • ulUnused: NULL

If an error is returned by the callback, it will be ignored.

JET_cbtypFreeTableLS
0x00000400

This callback will occur as the result of the need for the application to cleanup the context handle for the Local Storage associated with a table that is being released by the database engine. For more information, see JetSetLS.

The function pointer for this callback reason is configured by means of JetSetSystemParameter with JET_paramRuntimeCallback.

The callback parameters will have the following values:

  • sesid: JET_sesidNil

  • dbid: JET_dbidNil

  • tableid: JET_tableidNil

  • pvArg1: The context handle set using JetSetLS.

  • pvArg2: NULL

  • pvContext: NULL

  • ulUnused: NULL

If an error is returned by the callback, it will be ignored.

Requirements

Client

Requires Windows Vista or Windows XP.

Server

Requires Windows Server 2008 or Windows Server 2003.

Header

Declared in Esent.h.

See Also

Community Additions

ADD
Show:
© 2014 Microsoft