In Access 97 I created a recordset in a module this way:
Dim Wrk as Workspace
Dim DB as Database
Dim Rst as Recordset
Set Wrk = DBEngine(0)
Set DB = Wrk.Databases(0)
Set Rst = DB.OpenRecordset(strSQL)
In Access 2000, it is telling me that Workspace and Database are undefined user variables. All of the help screens set-up (at least the Dim) this way. Did I miss something when I set-up Access? What do I need to do? What are my alternatives?
I have done a work around but am stuck by another problem.
Dim Wrk as Variant, DB as Variant
Dim strSQL as String, Rst as RecordSet
strSQL = “Select * FROM Table”
Set Wrk = DBEngine(0)
Set DB = Wrk.OpenDatabase(“Tracker.mdb”)
Set Rst = DB.OpenRecordset(strSQL)
With this, it says that the strSQL is the wrong data type.