CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: VB

  1. #1

    VB

    I'm trying to write a program that opens up an access database and modifies the values in that db. I've successfully created the database and and filled a table with the fields that I need but I haven't been able to fill the db with the data(records) that I need. What I need to know is should I be using DAO for this? or can I do it using opencurrentdatabase etc??? Any help or direction would be appreciated. [email protected]


  2. #2
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: VB

    You can do it with both ways. Select one and I'll guide you how to do it...

    Michael Vlastos
    Automation Engineer
    Company SouthGate Hellas SA
    Development Department
    Athens, Greece

  3. #3

    Re: VB

    Thank you. But I figured it out. I made a really simple mistake. I forgot to set Dao as one of my libraries.


  4. #4
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: VB

    ;-)

    Michael Vlastos
    Automation Engineer
    Company SouthGate Hellas SA
    Development Department
    Athens, Greece

  5. #5
    Join Date
    Dec 1999
    Location
    Atlanta, GA
    Posts
    6

    Re: VB

    I would use ADO instead of DAO. Something like this:


    Dim rst as ADODB.Recordset
    Dim con as ADODB.Connection
    set con = new ADODB.Connection
    con.ConnectionString = "DRIVER=(Microsoft Access Driver (*.mdb)); DBQ=databasename.mdb;DefaultDir=" & App.path & ";UID=admin..."
    con.Open
    rst.Open "select * from table", con





    There really are any number of ways to use it; i.e. thru the Command obj, the Connection obj or even the Recordset obj. I believe the piece of code above should work.

    good luck.


    Lee Barnard
    Atlanta, GA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured