Results 1 to 6 of 6

Thread: Opening Access 2000 database from VB5/6 (ADO or DAO?)

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Canada
    Posts
    3

    Post

    I'm trying to open a Microsoft Access 2000 database through VB5 and keep getting error 3343 - "Unrecognized Database Format".
    Do I use DAO references or ADO references?
    Does anyone have some examples that actually work? I'm using a windows 98 platform. If anyone can answer my question and maybe add a little extra I would appreciate it.
    Thanks.

    ------------------
    ed

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Canada
    Posts
    3

    Post

    Thanks Clunietp for the info.
    What I also forgot to mention was that I was using the DBGrid control in VB5 made by APEX Software. I called them about it today and they informed me that they assisted in that versions development(version 5.00.3714) and now have nothing else to do with Microsoft. Therefore, that version is not compatible with newer versions of their software.
    I'll try VB6 and see what happens.
    Thanks again.

    ------------------
    ed

  4. #4
    Lively Member FirstKnight's Avatar
    Join Date
    Jul 1999
    Location
    Johannesburg, South Africa
    Posts
    95

    Post

    Ed,

    I use VB6 and I have a similar problem with Access 2000 dbases. It would seem that ADO doesnt recognize the new db format. I know because I tried to create a dbase form using the wizard. The only way I could get around this was to create a data environment and then go and create al my text boxes manually, setting the datasource property to the data environment. If you don't know what a data environment is I suggest you read through your manuals or help files. I havent tried this with datagrids yet but I'm sure it works the same.

    If anyone knows a easier way please let me know, coz it is quite a tedious tast to create all the text boxes on a form manually.

    ------------------

  5. #5
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    FirstKnight:

    If you are using ADO, you need to set your provider to Microsoft.Jet.OLEDB.4.0 to connect to Access 2000 databases. I don't use the Data Env so I don't know where to set this property in there...

    If you are using DAO, then follow the procedure in the link I posted above.

    Tom

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Canada
    Posts
    3

    Post

    Hey everybody!
    I finally figured out the DBGrid problem I was having!
    I created a simple Acc. 2000 database and dropped a "DBGrid" and a "Data" object onto a form. Normally you set the "DatabaseName" and "RecordSource" properties to the appropriate database and table, but don't do this with Access 2000!
    Instead, just set the "DataSource" property for the "DBGrid" to the "Data" object, and the rest is accomplished through code like this:
    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    Private Sub Form_Load()
    Set db = DAO.Workspaces(0).OpenDatabase("c:\scottsdb\scott.mdb")
    Set rs = db.OpenRecordset("table1")
    Set Data1.Recordset = rs
    ''Ignore this:
    'DBGrid1.DataSource = Data1
    End Sub
    Weird but works!
    Thanks for your help though. Much apprecitated!

    ------------------
    ed

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