which connectivity?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: which connectivity?

  1. #1
    bill Guest

    which connectivity?


    How do you know which connection you are using?
    ADO, DAO, OBDC
    ?

    Im having troubles entering forms into the database and have this connection
    code:
    Dim db As Database
    Dim rs As Recordset
    Set db = OpenDatabase("c:\database.mdb")
    Set rs = db.OpenRecordset("Users")

    rs.Close
    db.Close

    Set db = Nothing
    Set rs = Nothing
    End Sub

    then in the forms I have under the ADD button:
    Data1.recordset.additem
    Data1.recordset.update
    Data1.recordset.movenext

    yet nothing goes in. I have one database with 4 tables that I have four
    forms for.
    Anyone care to advise a rookie?

  2. #2
    Eric D. Burdo Guest

    Re: which connectivity?

    Well, I am assuming you have all three methods in the project references?

    Why not explicitly declare? like this:

    Dim db As DAO.Database
    Dim rs As DAO.Recordset


    --

    Eric D. Burdo, Red-Leif International
    VB Programmer and Consultant
    <http://www.redleif.com/vb>

    *** Please reply to the newsgroup so all can benefit. ***


    "bill" <bill@cbspools.com> wrote in message news:39b520dd@news.devx.com...
    >
    > How do you know which connection you are using?
    > ADO, DAO, OBDC
    > ?
    >
    > Im having troubles entering forms into the database and have this

    connection
    > code:
    > Dim db As Database
    > Dim rs As Recordset
    > Set db = OpenDatabase("c:\database.mdb")
    > Set rs = db.OpenRecordset("Users")
    >
    > rs.Close
    > db.Close
    >
    > Set db = Nothing
    > Set rs = Nothing
    > End Sub
    >
    > then in the forms I have under the ADD button:
    > Data1.recordset.additem
    > Data1.recordset.update
    > Data1.recordset.movenext
    >
    > yet nothing goes in. I have one database with 4 tables that I have four
    > forms for.
    > Anyone care to advise a rookie?




  3. #3
    Kathleen Dollard-Joeris Guest

    Re: which connectivity?

    Bill,

    It is best to explicitly reference object variables with the DLL name. Such
    as

    Dim db as ADODB.Database

    You can find out what access methods are currently available by seeing what
    is checked in project references. If nothing is checked, you should get
    compile errors.

    --
    Kathleen
    (MS-MVP)
    Reply in the newsgroup so everyone can benefit
    --



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