Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

activex
ado

What is the ActiveX Data Object(ADO) command object?

Behzad Ahmad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The ActiveX Data Object (ADO) module enables programs written in C++ and Visual Basic to connect to different databases and SQL servers. It includes several objects, such as the ADO command object. This object executes a single query against the database. We can create, add, update, delete, and retrieve records with the help of this query.

If we retrieve the data using a query, the returned data is in the form of a Recordset object. We can then manipulate the data by using the properties, collections, methods, and events of the Recordset object.

A major feature of the command object is the ability to use procedures with parameters and stored queries.

The command object has certain methods, properties, and collections associated with it. These are described below.

Methods

  • Execute: This executes the query or SQL statement or procedure in CommandText property, returning a Recordset object or Nothing.

  • Cancel: This cancels the execution of an asynchronous method call.

  • CreateParameter: This creates a new parameter object.

Properties

  • Name: This sets or returns the name of a command object.

  • State: This returns the current state of a command object and is a read-only property.

  • Prepared: This sets or returns a Boolean value. If the value is true, it indicates that before executing the first command. The command saves a compiled version of the query.

  • CommandType: This sets or returns the type of a Command object, a value from CommandTypeEnum.

  • CommandTimeout: This sets or returns the number of seconds to wait before terminating an execution attempt before raising an error.

  • ActiveConnection: This sets or returns a message if the connection is closed. Otherwise, if the connection is open, it returns the current connection object. It tells us which Connection object is associated with the current Command object.

  • CommandText: This sets or returns the text of a Command object’s command.

Collections

  • Properties: This contains all the property objects of a Command object.

  • Parameters: This contains all the parameter objects of a Command object.

RELATED TAGS

activex
ado

CONTRIBUTOR

Behzad Ahmad
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring