Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dbOpenTable - Type mismatch error (Access97)

    When I run code
    Set rsResp = dbR.OpenRecordset("Search_Result", dbOpenTable)
    On Error Resume Next
    txtStr = rsResp![Last Name]
    If txtStr = "" Then
    MsgBox "Search Produced No Results! Please, try again!"
    End If

    I am getting an error "Type mismatch" at the first line.
    My table has few columns with text datatype and 2 columns with Number datatype.
    I am checking my table - it is populated with 2 rows of records, but my code
    Set rsResp = dbR.OpenRecordset("Search_Result", dbOpenTable)
    wouldn't open it.

    Thanks for looking into it

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dbOpenTable - Type mismatch error (Access97)

    Try dbOpenDynaset instead of dbOpenTable. if that doesn't work, how is dbR defined?

  3. #3
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: dbOpenTable - Type mismatch error (Access97)

    Dim dbR As Database, rsResp As Recordset

    I've tried Dynaset...no luck

    Thanks

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dbOpenTable - Type mismatch error (Access97)

    If this is a database converted back from a higher version of Access, do the following:
    - Make sure that you have a reference to the Microsoft DAO 3.5* Object Library in Tools | References...
    - If there is a reference to Microsoft ActiveX Data Objects 2.* Library, clear the corresponding check box.
    - Just to make sure, change the declaration to

    Dim dbR As DAO.Database, rsResp As DAO.Recordset

  5. #5
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: dbOpenTable - Type mismatch error (Access97)

    How do you know all this? It is awesome, it worked!!!
    Thanks so much and have a great weekends.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dbOpenTable - Type mismatch error (Access97)

    In the school of hard knocks... <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

Posting Permissions

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