Run Make table query from Excel

G

Guest

I need data from Access. The Access query is based on a table that must be
created first using a Make Table query. How do I run this query from Excel
VBA?

I tried:
200 Set db = OpenDatabase(Name:=strDbName1, _
Options:=False, ReadOnly:=True)
Set qry = db.QueryDefs(strQryName1)
Set rs = qry.OpenRecordset(dbOpenSnapshot)
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing

but it fails at:
Set rs = qry.OpenRecordset(dbOpenSnapshot)

I can get the 2nd query to run when the table is created within Access.
However, I need to do all of this on the Excel side.

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