[AccessD] A2K: OpenRecordset doesn't

Darren DICK d.dick at uws.edu.au
Sat Apr 12 09:33:06 CDT 2003


Hello all
Can anyone shed some light on why my code fails on
the line...
 Set rst = dbs.OpenRecordset("SELECT * FROM
tblMyTable;", dbOpenDynaset)
and I get the error "Run time error 13 'Type
Mismatch"

Many thanks
Darren

________________________________
Public Sub MySub()
Dim dbs As Database
Dim rst As Recordset

    Set dbs = CurrentDb
    '<Fails on the line below>
    Set rst = dbs.OpenRecordset("SELECT * FROM
tblMyTable;", dbOpenDynaset)
    '<Fails on the line above>

    With rst
        .MoveLast
        Debug.Print .RecordCount
        .Close
    End With

    Set dbs = Nothing

End Sub


________________________________



More information about the AccessD mailing list