ICommandPrepare

This section describes Jet-specific implementation of the ICommandPrepare interfaces. This includes ICommandPrepare::Prepare and ICommandPrepare::Unprepare.

This interface encapsulates command optimization, a separation of compile time and run time, as found in traditional relational database systems. The result of this optimization is a command execution plan.

Commands must be in a prepared state prior to calling the following methods:

Method Description
Prepare Validates and optimizes the current command.
Unprepare Discards the current command execution plan.

ICommandPrepare::Prepare

Validates and optimizes the current command. This interface takes the parameter cExpectedRuns. As described in the OLE DB Programmer’s Reference, by using this parameter, the consumer can indicate how often the command execution plan (which is produced by Prepare) will be used; that is, how often the command is likely to be executed without renewed optimization. A value of zero indicates that the consumer is unable to provide an estimate, and leaves it to the optimizer to choose a default value.

For Jet, this parameter is ignored. A new execution plan is not generated based on this parameter.

To see a comprehensive list of supported properties, see Appendix A.

ICommandPrepare::Unprepare

Discards the current command execution plan. For information on how this interface is implemented, see the OLE DB Programmer’s Reference.