A Command object is a definition of a specific command that you intend to execute against a data source.
ActiveConnection, CommandText, CommandTimeout, CommandType, Prepared
You can create a Command object independently of a previously defined Connection object by setting its ActiveConnection property to a valid connection string. ADO still creates a Connection object, but it doesn't assign that object to an object variable. However, if you are associating multiple Command objects with the same connection, you should explicitly create and open a Connection object; this assigns the Connection object to an object variable. If you do not set the Command objects' ActiveConnection property to this object variable, ADO creates a new Connection object for each Command object, even if you use the same connection string.
Use Command objects to obtain records and create a Recordset object, to execute a bulk operation, or to manipulate the structure of a database. Depending on the functionality the provider exposes, some collections, methods, or properties of a Command object may generate an error when you call them.
With the collections, methods, and properties of a Command object, you can do the following:
· Associate an open connection and the Command object with the ActiveConnection property.
· Define the text version of the command (for example, an SQL statement) with the CommandText property.
· Set the number of seconds a provider will wait for a command to execute with the CommandTimeout property.
· Specify the type of command described in the CommandText property with the CommandType property prior to execution in order to optimize performance.
· Determine whether or not the provider saves a prepared (or compiled) version of the command prior to execution with the Prepared property.
· Manage command arguments passed to and from the provider with the Parameters collection.
· Execute a command and return a Recordset object if appropriate with the Execute method.
|file: /Techref/language/asp/comp/dadobj01.htm, 8KB, , updated: 1996/11/21 18:01, local time: 2022/1/25 21:28,
|©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?|
<A HREF="http://www.piclist.com/techref/language/asp/comp/dadobj01.htm"> Command Object (ADO)</A>
|Did you find what you needed?|
PICList 2022 contributors:
o List host: MIT, Site host massmind.org, Top posters @20220125
* 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 www.piclist.com!