Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 2 - Visual Basic Programming: Much Ado about A...
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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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? 
VISUAL BASIC.NET

Visual Basic Programming: Much Ado about ADO
By: Maneesh Makheeja
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 40
    2004-06-15

    Table of Contents:
  • Visual Basic Programming: Much Ado about ADO
  • Not Specifying the Library Being Referred To
  • Improper Ways of Opening the Recordset Object
  • Wasteful Creation of ADO Objects
  • The Purpose of Command Objects

  • 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


    Visual Basic Programming: Much Ado about ADO - Not Specifying the Library Being Referred To


    (Page 2 of 5 )

    Usually, this is how the ADO objects are declared in the General Declaration section:

    Dim Con As Connection
    Dim Com As Command
    Dim Rst As Recordset

    This works fine for a program that references just one data objects library (ADODB library in this instance), since you have selected just the ‘Microsoft ActiveX Data Objects 2.1 Library’ from the References menu. So when you say:

    Dim Con As Connection

    the complier creates a Connection object of ADODB library. But for an application that refers to more than one library that provides the data objects (for instance, the DAO architecture also has Connection, Command and Recordset objects), the habit of not specifying the appropriate library might lead to a messy code.

    Here’s how an ADO object should ideally be declared and created:

    Dim Con As ADODB.Connection
    Set Con = New ADODB.Connection

    More Visual Basic.NET Articles
    More By Maneesh Makheeja


     

    VISUAL BASIC.NET ARTICLES

    - Understanding Delegates using Visual Basic.N...
    - Create a Sudoku Puzzle Generator using VB.NET
    - Entity Creation and Messaging in a VB.NET Te...
    - Movement and Player Statistics in a VB.NET T...
    - Creating and Drawing a Game Map in VB.NET (F...
    - Working with Classes and Properties for Game...
    - Working with Loops, Arrays, and Collections ...
    - Learning Loops in VB.NET for Game Development
    - Learning VB.NET: Working with Variables, Con...
    - The Basics of VB.NET Through Text Game Devel...
    - Learning VB.NET Through Text Game Development
    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT