Name

Command.Prepared Property — (Versions 2.0, 2.1, 2.5, 2.6)

Synopsis

                     command.Prepared = Boolean
                  

The Prepared property indicates whether a prepared statement should be created by the current Command object before it is executed.

Datatype

Boolean

Description

If the value of the Prepared property is set to True, then before the first execution of a query defined by the CommandText property of the Command object, the query is compiled and saved. From then on the Execute statement will refer to the compiled version of the query to perform. This may slow the initial call to Execute, but all calls that follow will benefit from this.

If the value of the Prepared property is set to False, then the query is never compiled; instead the query is done directly from the Command object.

Note

Not all providers support the Prepared property. Some providers raise an error as soon as the Prepared property is set to True, while others do not raise an error and simply replace the Prepared property’s value with False.

Get ADO: ActiveX Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.