Hi Folks,

Having a problem running some DAO in Excel 97.

Here is the code :

''Function to set a DAO recordset from anywhere in the project
Public Function SetRecordset() As Boolean

Dim ws As Workspace
Dim db As Database
Dim rs As Recordset
Dim strConnection As String
Dim strSQL As String

Set ws = DBEngine.Workspaces(0)

strConnection = "ODBC;DSN=MYDATA"

Set db = ws.OpenDatabase("", False, False, strConnection)

Set rs = db.OpenRecordset("select * from tblData")


End Function

I know I'm connecting ok but I keep getting type mismatch errors and can't seem to tell why.