qd.execute

L

Lynn

I got this error message "Can't execute a non-action
query" I am trying to return recordset from select queries
that located in a different database. Below here is my
code:

Set ws = dbengine.workspaces(0)
Set db = ws.OpenDatabase(Pathfile)
Set qd = db.OpenQueryDef(queryname)

qd.Execute
qd.Close

thanks in advance
 
D

Douglas J. Steele

As the message is telling you, you can only use the Execute method on an
Action query (INSERT INTO, UPDATE or DELETE)

You can open a recordset based on the query and work with the recordset.
 
Top