Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Run Make table query from Excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RW - 23 Jan 2006 21:36 GMT
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
K Dales - 24 Jan 2006 17:33 GMT
To run an Action query in DAO you should use the Execute method of the
QueryDef, not OpenRecordset (since no recordset is opened).

ref:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/office97/html/o
utput/F1/D2/S5A270.asp

Signature

- K Dales

> 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
[quoted text clipped - 17 lines]
>
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.