A site for solving at least some of your technical problems...
A site for solving at least some of your technical problems...
When I looked around for samples on how to query a MS-Access database using an SQL statement, it was telling me to declare a record set variable of type Recordset.
Option Explicit Sub Function Load(where As String) Dim sql As String Dim rcd As Recordset sql = "SELECT * FROM table WHERE " & where Set1 rcd = CurrentDb.OpenRecordset(sql) End Sub
The OpenRecordset() function, in my MS-Access 2007 installation at least, returns a Recordset2, not a Recordset.Once I changed the declaration of the rcd variable to Variant2 instead of Recordset, it worked.
Dim rcd ' As Recordset -- no strong type because Recordset2 is expected
Why don't I just use Recordset2 here? Because MS-Access does not know about it.