Prepares an SQL statement or stored procedure.


<oRef>.prepare( )


The object you want to prepare.

Property of

Query, StoredProc


prepare( ) prepares the stored procedure named in the procedureName property of a StoredProc object or the SQL statement stored in the sql property of a Query object. If the object is connected to an SQL-server-based database, the prepare message is passed on to the server.

Preparing an SQL statement or stored procedure call includes compiling the statement and setting up any optimizations. If the statement includes parameters, the statement can be prepared first, and, sometime later, you can get the parameter values from the client. Then the prepared statement and its parameters are ready for execution. By separating the client and server activities, things run a bit faster.

Preparing is part of the process that occurs when you set an object’s active property to true, so you’re never required to call prepare( ) explicitly.