• dbOpenTable – Type mismatch error (Access97)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » dbOpenTable – Type mismatch error (Access97)

    Author
    Topic
    #414565

    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

    Viewing 0 reply threads
    Author
    Replies
    • #922109

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

      • #922111

        Dim dbR As Database, rsResp As Recordset

        I’ve tried Dynaset…no luck

        Thanks

        • #922155

          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

          • #922182

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

    Viewing 0 reply threads
    Reply To: dbOpenTable – Type mismatch error (Access97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: