Results 1 to 5 of 5

Thread: Access 2000 from VB6

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    8

    Access 2000 from VB6

    Hi,

    How do I open an Access2000 mdb from VB6?

    I have my standard data1 control on my form, the database name of which is correct but when I click on recordsource it shows an error saying "Incompatible version". I have DAO3.51, DAO3.6 and Access 9.0 references installed and I have experimented with them in different priorities but still no go!! It works ok when I get Access to convert the file to a prior Access version and then use this new mdb file. This is not an ideal situation though as you may appreciate.

    Any help would be appreciated.

    Thanks,
    AM

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    maybe use a DSN? it is a touch slower though....

  3. #3
    Registered User Virus00110's Avatar
    Join Date
    Jul 2002
    Location
    Williamsport, PA
    Posts
    290
    I have had the same problem before. You can do this one of three things to solve this.

    One: Make an ODBC connection to the Access DB and then make your connection string for your DAO (this is not a very fast method)

    Two: Use the ADO and make a connection using the Microsoft Jet Engine straight the Access DB you are trying to connect to.

    Three: Use the ADO and ODBC connection and make your connection throught that to the Access DB.

    I hope this helps if not let me know and I'll try to help you by explaining it a different way.

  4. #4
    New Member
    Join Date
    Aug 2002
    Posts
    9

    ado

    ps. you are better off using the ado or dao in code. Add a module to your form or on the form_on load event do the following:
    create the dsnless connection to your database e.g in ado:
    Dim con1 as ADODB.Connection
    Dim rstcon1 as ADODB.Recordset
    Dim cmdsql as command etc

    Set con1 = New ADODB.connection
    con1.connectionstring = "provider=microsoft.jet.oledb.4.0;Data Source = C:\database path & location"
    con1.open

    Set cmdsql = new adodb.command
    set cmdsql.activeconnection = con1

    write sqlstmnt
    create a recordset
    and execute sqlstmnt

  5. #5
    Hyperactive Member wordracr's Avatar
    Join Date
    Aug 2001
    Posts
    281
    You mentioned
    "I have DAO3.51, DAO3.6 and Access 9.0 references installed.."
    Do you have all of these references on at the same time?

    You should only need DAO3.6.
    VB might be using 3.51 which is for Acess97.
    I mean, how would it to distinguish between the two references?

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