Database
  Home arrow Database arrow Page 3 - On Wiring Up an ADO Data Control
Iron Speed
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 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
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

On Wiring Up an ADO Data Control
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2006-10-18

    Table of Contents:
  • On Wiring Up an ADO Data Control
  • Preparatory Steps
  • Creating a New ODBC DSN
  • Testing the ODBC Data Source Name Option

  • 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
     
     
    Iron Speed
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    On Wiring Up an ADO Data Control - Creating a New ODBC DSN
    (Page 3 of 4 )

    In this case we will be using the Oracle 10G XE database; therefore the appropriate driver will be used. Make sure that the Oracle server is running. Click on the  Add... button. This brings up the list of database drivers on this machine that allow you to connect to various databases. We will be using the Oracle XE driver that was registered when Oracle 10G XE was installed. Choose this driver by highlighting it as shown. Then click on the Finish button.

    This brings up the Oracle ODBC Drive Configuration window. As usual you need to provide a name for this DSN. Here it is called DSNOraXe. For the TNS (Transparent Network Substrate) Service Name provide the name of the server, XE. The description, which is optional, may be used to refer to the machine on which the server is running. For UserID, you must use HR, assuming you have established a user of the HR database by that name. If you have not taken this step, you must do so before proceeding further. This is described in the Oracle 10G XE installation manual, or in the online help. You may also read the previous article on the DevShed.com site.

    You need not configure other items in this window. Click on the OK button to proceed to the next step. This will bring up the login for the Oracle 10 XE server. Once the proper information is entered, the DSN gets into the list of DSNs in the System DSN list in the ODBC Data Source Administrator window.

    Creating a Connection String for the Use Connection String Option

    This will be created inside the Visual Basic Program and will be described there.

    Testing Connectivity with a Visual Basic Project

    Start a standard EXE Visual Basic project. From the Project --> Components menu you can access the Components window. The ADODC ActiveX control (msadodc.ocx) can be added to the tool box from the Components window by scrolling down and choosing the control as shown.

    The project has three forms, each appropriately named as shown. On each of the forms an ADODC control is placed by double clicking the control's icon in the toolbox.

    Testing the DataLink File

    Right click the ADODC control and choose ADODC properties from the drop-down; you can bring up its property pages as shown. The picture shows both the form and the Property pages for the control. With the radio button choose the Use Data link file; you may browse to the AccLink.udl file created earlier as shown.

    In the Authentication tab accept the default. In the RecordSource tab choose the Orders table as shown and click OK.

    For the textbox on the form set the DataSource property to adodc1 and the DataField property to ShipName. When you run this form after choosing it from the Project -->AdoConn Properties... drop-down, you will see the following displayed (record position changed for this picture).

    More Database Articles
    More By Jayaram Krishnaswamy


       · This tutorial discusses all the three options in wiring up the ADO data Control to...
     

    DATABASE ARTICLES

    - Database Programming in C# with MySQL : Usin...
    - Formatting Techniques for Data Access from E...
    - Data Access from Excel VBA
    - Generating a Multiple Table Crystal Report u...
    - ADO and the Command Object
    - On Wiring Up an ADO Data Control
    - Reading and Writing to Files on the Intranet
    - Using ADO Record to Create and Navigate Intr...
    - Using Data Access Pages to Access Data on a ...
    - Using ADO with the SQL Native Client
    - ADO`s Stream Object
    - Opening a Record Object Referencing an Open ...
    - Introducing Jasper (SQL Anywhere 10 Beta)
    - Creating a Database Project in VS 2005
    - Manipulating ADO Recordsets




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