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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top