Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
George
Post the code you are using. This works OK for me Sub ImpQry() Dim cn As ADODB.Connection Dim sConSt As String Dim Rs As ADODB.Recordset sConSt = "DSN=MS Access 97 Database;DBQ=c:\Dick\db1.mdb;" Set cn = New ADODB.Connection Set Rs = New ADODB.Recordset cn.Open sConSt Rs.Open "Query3", cn Sheet2.Range("a1").CopyFromRecordset Rs Rs.Close cn.Close Set Rs = Nothing Set cn = Nothing End Sub -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "George" wrote in message ... The exact erro is: Run-time error ... The Microsoft Jet database engine cannot find the input table or query'my queries name'. Make sure it existe and that its name is spelled correctly. I made sure that it was correct and it dosent work for the queries. -----Original Message----- Hi George: - for queries: what do you want to import: the result? if yes simply use the query name as source (instead of the table) - for the report: What exactly do you want to nimport: the layout? (IMHO not possible) -- Regards Frank Kabel Frankfurt, Germany George wrote: Hi, I am working on a project in Excel that imports from Access. I have a code that imports tables to excel but what I really need is to import the reports or the queries of this database. If someone know a way to do this pls let me know. . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Import/Export from database queries | Excel Discussion (Misc queries) | |||
Access queries/tables | Excel Discussion (Misc queries) | |||
pivot tables & queries | Excel Worksheet Functions | |||
pivot tables interface with queries | Excel Worksheet Functions | |||
Import Queries instead of Tables (ADO) | Excel Programming |