programmatically getting the results from executing a QueryDef?

G

Guest

I am attempting to execute a stored QueryDef within an Access database from an external VB-like application through Automation. I can verify that I can access the named QueryDef, but I'm also confused by the Execute method within QueryDef objects which doesn't appear to return anything. Likewise, when I find no string associated with the SQL property, yet I can execute the Design View query (named QueryDef) and display results. How can I access the values displayed? Thanks

Ji
 
D

Douglas J. Steele

Assign the results of the execution to a Recordset using the QueryDef's
OpenRecordset method, rather than using the Execute method. Execute is only
meant for Action queries (INSERT INTO, UPDATE, DELETE)

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Jim said:
I am attempting to execute a stored QueryDef within an Access database
from an external VB-like application through Automation. I can verify that
I can access the named QueryDef, but I'm also confused by the Execute
method within QueryDef objects which doesn't appear to return anything.
Likewise, when I find no string associated with the SQL property, yet I can
execute the Design View query (named QueryDef) and display results. How can
I access the values displayed? Thanks.
 

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