Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access 2000 OpenQueryDef

Status
Not open for further replies.

matrixknow

IS-IT--Management
May 3, 2007
78
Hola,

It seems that you can't use OpenQueryDef in Access2000.
I need a query to feed my recordset and I can not hardcode this as an SQL statement in my sub. How to feed my recordset with a query as datasource ?
Code:
Set qry = dbs.OpenQueryDef(strQueryName)
  Set rst = qry.OpenRecordset()
 
Which object should expose an OpenQueryDef method ?
 
You wanted this ?
Dim dbs As Database, qry As QueryDef, rst As DAO.Recordset
Set dbs = CurrentDb
Set qry = dbs.QueryDefs(strQueryName)
Set rst = qry.OpenRecordset
 
a query, but he is refusing OpenQueryDef. He said that this method is not supported in VB. Perhaps this version
 
How about:
Code:
Dim db as Database, rs as Recordset
Set db = Currentdb()
Set rs = db.OpenRecordset(YourQueryName)

... where [YourQueryName] is the querydef/stored procedure name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top