ADO newbie


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: ADO newbie

  1. #1
    Doug Guest

    ADO newbie

    Can anyone send me a small piece of sample code using ADO? I have been
    using DAO and need to learn ADO. I need a very simple example of connecting
    to an access 97 db. Thanks for any help.......



  2. #2
    Gonzalo Medina Guest

    Re: ADO newbie


    "Doug" <doug@seisystems.com> wrote:
    > Can anyone send me a small piece of sample code using ADO? I have been
    >using DAO and need to learn ADO. I need a very simple example of connecting
    >to an access 97 db. Thanks for any help.......
    >
    >

    Let see if this code help:
    Dim cnn as ADODB.Connection

    'Create a new reference.
    '-----------------------------------------------------------
    Set cnn = New ADODB.Connection

    'Set the information ADO need to connect to the database.
    '-----------------------------------------------------------
    cnn.ConnectionString ="Provider=Microsoft.Jet.OLEDB.3.51;" _
    & "Data Source=C:\Microsoft Visual Studio\Vb98\Biblio.mdb"

    'Open the connection.
    '-----------------------------------------------------------
    cnn.Open

    NOTE: Remember create the reference to ADO in my case I'm using ADO 2.6 and
    close the connection when you're closing the application or when you don't
    need it anymore.

    Let me know if I'm wrong, we can talk about it.

    Have fun :-)



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center