qd.execute

  • Thread starter Thread starter Lynn
  • Start date Start date
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
 
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

Similar Threads

OpenQuerydef Problem 15
removing trailing returns 11
vba 14
Something wrong with my code. 1
Cancel Sub if combo null or = "" 3
Run-time error '3265' 19
Code Help: Table of Contents 5
Front End being locked 7

Back
Top