Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Import Queries instead of Tables (ADO)

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Import Queries instead of Tables (ADO)

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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Import Queries instead of Tables (ADO)

For the queries is the results and the tittles of each
colums and for the reports, yes is the layout but if I can
get the queries is better. I tried changeing the name of
the table with one of the queries and it gives me an error
that the file is not available.
-----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.


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Import Queries instead of Tables (ADO)

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.


.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default Import Queries instead of Tables (ADO)

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.


.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import/Export from database queries JudyT Excel Discussion (Misc queries) 0 August 6th 08 07:35 PM
Access queries/tables Naz Excel Discussion (Misc queries) 1 July 5th 06 01:16 PM
pivot tables & queries Pivot tables & tracking data Excel Worksheet Functions 7 June 11th 05 11:10 PM
pivot tables interface with queries biviluv Excel Worksheet Functions 0 March 15th 05 08:15 PM
Import Queries instead of Tables (ADO) George Excel Programming 1 April 12th 04 08:21 PM


All times are GMT +1. The time now is 10:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"