please dont rip this site

Execute Method

· Command Executes the query, SQL statement, or stored procedure specified in the CommandText property.

· Connection Executes the specified query, SQL statement, or stored procedure.


On a Command object:

Set recordset = command.Execute(RecordsAffected, Parameters, Options)
command.Execute RecordsAffected, Parameters, Options

On a Connection object:

Set recordset = connection.Execute(CommandText, RecordsAffected, Options)
connection.Execute CommandText, RecordsAffected, Options

The Execute method syntax has these parts.




An object variable representing the Recordset object in which the results of the query are stored.


An object variable representing a Command object whose CommandText property contains the query to execute.


An object variable representing a Connection object on which the query is executed.


Optional. A Long variable to which the provider returns the number of records that the operation affected.


Optional. A Variant array of parameter values passed with an SQL statement. (Output parameters will not return correct values when passed in this argument.)


A String containing the SQL statement, table name, or stored procedure to execute.


Optional. A CommandTypeEnum value that indicates how the provider should evaluate the CommandText argument. Can be one of the following constants:

adCmdText, 1 Evaluate CommandText as a textual definition of a command.

adCmdTable, 2 Evaluate CommandText as a table name.

adCmdStoredProc, 4 Evaluate CommandText as a stored procedure.

adCmdUnknown, 8 The type of command in the CommandText argument is not known.

See the CommandType property for a more detailed explanation of these constants.


Use the Execute method to execute an existing Command object or a query of your choosing. You can also specify a Recordset object in which to store the results, if any.


Using the Execute method on a Command object executes the query specified in the CommandText property of the object. If the CommandText property specifies a row-returning query, any results the execution generates are stored in a new Recordset object. If the command is not a row-returning query, the provider returns a closed Recordset object. Most application languages allow you to ignore this return value if no Recordset is desired.

If the query has parameters, the current values for the Command object's parameters are used unless you override these with parameter values passed with the Execute call. You can override a subset of the parameters by omitting new values for some of the parameters when calling the Execute method. The order in which you specify the parameters is the same order in which the method passes them. For example, if there were four (or more) parameters and you wanted to pass new values for only the first and fourth parameters, you would pass Array(var1,,,var4) as the Parameters argument.

Note Output parameters will not return correct values when passed in the Parameters argument.


Using the Execute method on a Connection object executes whatever query you pass to the method in the CommandText argument on the specified connection. If the CommandText argument specifies a row-returning query, any results the execution generates are stored in a new Recordset object. If the command is not a row-returning query, the provider returns a closed Recordset object.

The contents of the CommandText argument are specific to the provider and can be standard SQL syntax or any special command format that the provider supports.

Applies To

Command, Connection

file: /Techref/language/asp/comp/dameth02_1.htm, 6KB, , updated: 1996/11/21 19:01, local time: 2022/8/9 06:27,

 ©2022 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF=""> Execute method (ADO)</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2022 contributors:
o List host: MIT, Site host, Top posters @20220809
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.

Welcome to!