Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default How To Pull Access Query into Excel (2003): Reposting

Hello: i previously posted code that successfully pulls an Access 2003 table
into an Excel 2003 spreadsheet. How is this done pulling a query, using a
query name? (Not using a SQL string that defines the query.)

Thanks~
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default How To Pull Access Query into Excel (2003): Reposting

Bettergains wrote:

Hello: i previously posted code that successfully pulls an Access

2003 table
into an Excel 2003 spreadsheet. How is this done pulling a query,

using a
query name? (Not using a SQL string that defines the query.)


If it is a VIEW type query

SELECT MyCol1, MyCol2 FROM MyQuery;

If it a PROCEDURE type query:

EXECUTE MyQuery arg1, arg2
or
{CALL MyQuery arg1, arg2}

Jamie.

--

  #3   Report Post  
Posted to microsoft.public.excel.programming
TK TK is offline
external usenet poster
 
Posts: 177
Default How To Pull Access Query into Excel (2003): Reposting

Hi Bettergains

A couple more suggestions if your using ADO. you didn't really give much
information.

I use the following:

' When using a connection object

cnn.Open
Set Rs = cnn.Execute("Your Query Name", , adCmdStoredProc)

' When using a Command object

cnn.Open
CMD.ActiveConnection = cnn
CMD.CommandText = "[Your Query Name]"
CMD.CommandType = adCmdUnknown
Set Rs = CMD.Execute

Good Luck
TK
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
Excel 2003 query from Access 2000 database Loretta Cahill Excel Worksheet Functions 1 March 1st 10 04:33 PM
importing/linking data from an Access 2003 Query to an Excel 2003 PerryK Excel Discussion (Misc queries) 2 August 24th 09 07:06 PM
Applying Criteria in Excel Cell to MS Query Pull from Access Tony Excel Discussion (Misc queries) 1 February 1st 08 04:43 PM
MS Query - from Access 2003 to Excel 97 afuller Excel Discussion (Misc queries) 0 February 26th 07 11:30 PM
Reposting lost query about virus scan Tom Excel Discussion (Misc queries) 2 February 14th 07 08:16 PM


All times are GMT +1. The time now is 01:03 AM.

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

About Us

"It's about Microsoft Excel"