Database
  Home arrow Database arrow ADO and the Command Object
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE

ADO and the Command Object
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 11
    2006-10-25

    Table of Contents:
  • ADO and the Command Object
  • Command Object in the Object Browser
  • Examples using the CommandType property
  • CommandType is adCmdStoredProc
  • CommandType is adCmdTable
  • CommandType is adCmdUnknown

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    ADO and the Command Object


    (Page 1 of 6 )

    ADO's command object can be used in several different ways to query a database. This basic tutorial presents some of these ways with examples. The Microsoft Access 2003 program is also used for the sake of the interface.

    Introduction

    The place of the command object in relation to the other objects in the ADO object model is shown in the next picture. The command object can query the data source and return a RecordSet Object. By providing the name of a parametrized query, or the name of a table in the database, or a stored procedure, the command object can be used to execute instructions and also return the results of the execution.

    The picture shown next also shows that the Parameters collection and Parameter object are related to the Command object. While the command object can execute a query repeatedly, it can also execute multiple queries.

    Properties and Methods of the Command Object

    Provide a reference to ADO 2.8 library

    Similar to the other articles on ADO at the ASP Free site by this author, MS Access 2003 will be used to look at some of the properties and methods of the command object. Before looking at any of the ADO objects, it is necessary to add a reference to the ADO library. By default, it may already have been added (ADO2.1) and it will be necessary to change it to a version higher than 2.5.

    For this tutorial, the latest version (ADO 2.8) will be used as shown in the next picture. This window may be accessed by clicking on the Components drop-down menu when you click the menu item Tools when you are in the Microsoft Visual Basic screen.

    Objective of the tutorial

    The main objective of this basic tutorial on ADO's Command object is to show some of the ways it can be used to query the database and present each of the ways by an example. MS Access 2003 program is used basically to utilize the Microsoft Visual Basic interface it provides. Even if one does not have the VB 6.0 the MS Access program can be used to follow these examples.

    More Database Articles
    More By Jayaram Krishnaswamy


       · ADO command with several ways of calling it makes programming easier. The choices...
     

    DATABASE ARTICLES

    - Manage Projects with SQL Server Management S...
    - Query Editing and Regular Expressions with S...
    - Using SQL Server Management Studio Tools
    - SQL Server Management Studio
    - Exporting a MySQL Database to Excel Using OD...
    - Controlling Databases with SQL Server 2005 D...
    - Using Recovery Models with SQL Server 2005 D...
    - Handling Database Properties for the SQL Ser...
    - Managing Permissions with the SQL Server 200...
    - SQL Server 2005 Database Engine Security
    - Administering SQL Server 2005 Database Engine
    - Building Applications with Anonymous Types
    - A Closer Look at Anonymous Types
    - Programming with Anonymous Types
    - Converting Your Excel Worksheet into a Worki...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek