Results 1 to 2 of 2

Thread: Database open error 13 - type mismatch

  1. #1

    Thread Starter
    Addicted Member tcurrier's Avatar
    Join Date
    May 1999
    Location
    Northeastern Pa./USA
    Posts
    255

    Post

    I'm getting a database open error 13 - type mismatch on the 'Set mydata - ... ' statement.
    Can anyone help out ?
    ' ***************************************
    Dim mydb As Database
    Dim mydata As Recordset
    On Error GoTo errHandler
    Set mydb = Workspaces(0).OpenDatabase _
    ("C:\MDB\TOM3.MDB")
    Set mydata = mydb.OpenRecordset _
    ("Table1", dbOpenTable)
    ' ****************************************

  2. #2
    Member
    Join Date
    Aug 1999
    Location
    West Hartford, CT, USA
    Posts
    42

    Post

    I was banging my head against the wall on this one for a while. I did a lot of searching on the net and I came up with two things (I'm not sure which one did the trick, but it now works for me).

    1) When you set up your recordset, specify DAO. For example:

    dim rstNew as DAO.recordset

    From what I understand, DAO isn't the first type that VB searches for. If you explicitly state that the recordset is a DAO type, there is no question.

    2)I initially had a reference to the DAO 3.51 object library. I changed this to the DAO 2.5/3.51 Compatibility library.

    I hope that this does the trick for you!


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