petehilljnr
Registered User.
- Local time
- Today, 00:37
- Joined
- Feb 13, 2007
- Messages
- 192
Using DAO in Excel connecting to an Access database, which is the better of these methods to get my recordset:
a) Create the query in Access then connect to it using
or
b)
Or are they much they same (performance wise)?
Both work and neither ~seem~ to be quicker than the other I use the second method if I have to pass in parameters in the SQL string but was just wondering if one way was better than the other?
Pete
a) Create the query in Access then connect to it using
Code:
set rst = MyDB.OpenRecordset("MyQuery")
or
b)
Code:
strSQL = "SELECT MyID, MyField, Count(MyNumber) as MyCount FROM MyTable"
set rst = MyDB.OpenRecordset(strSQL)
Or are they much they same (performance wise)?
Both work and neither ~seem~ to be quicker than the other I use the second method if I have to pass in parameters in the SQL string but was just wondering if one way was better than the other?
Pete