Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Retreiving data from Excel spreadsheet through ADODB

Hi,

I am using the ADO to retreive data from one worksheet from one book and
into another book. I used sqSQL for the sheet search:

rsdata.Open szSQL, ...

where szSQL = "SELECT * FROM [Combined TG and TN$]"

The sheet name from the book is "Combined TG and TN". Is there any way
to format this so that this can be recognized? I know I should not be using
long names with spaces, but I am not allowed to change the name.


Thanks,

Roel


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Retreiving data from Excel spreadsheet through ADODB

What do you mean by 'reorganize'? You can alias the table name to make
you queries more concise e.g. if you wanted to select columns named
Col1 and Col2 from your 'Combined TG and TN' sheet:

SELECT T1.Col1, T1.Col2
FROM [Combined TG and TN$] AS T1
WHERE T1.Col1 100

BTW in the other workbook, are you creating a new sheet or appending
to an existing sheet?

To create a new sheet:

SELECT T1.Col1, T1.Col2
INTO [Excel 8.0;database=C:\MyOtherWorkbook.xls;].MyNewTable
FROM [Combined TG and TN$] AS T1

To append to existing sheet 'MyTable':

INSERT INTO [Excel 8.0;database=C:\MyOtherWorkbook.xls;].[MyTable$]
SELECT T1.Col1, T1.Col2
FROM [Combined TG and TN$] AS T1

--

"Roel" wrote in message ...
Hi,

I am using the ADO to retreive data from one worksheet from one book and
into another book. I used sqSQL for the sheet search:

rsdata.Open szSQL, ...

where szSQL = "SELECT * FROM [Combined TG and TN$]"

The sheet name from the book is "Combined TG and TN". Is there any way
to format this so that this can be recognized? I know I should not be using
long names with spaces, but I am not allowed to change the name.


Thanks,

Roel

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
Dead links retreiving data? [email protected] Links and Linking in Excel 1 June 26th 06 10:08 PM
Retreiving font when matching data from one worksheet to another hgopp99 Excel Discussion (Misc queries) 4 January 22nd 06 11:22 PM
Retreiving TABNAME from within a spreadsheet Bob Harike Excel Discussion (Misc queries) 2 February 2nd 05 09:35 PM
Export from Excel to Access ADODB javydreamercsw Excel Programming 2 February 19th 04 09:49 PM
Using ADODB to read data out of another excel file Chris Edwards Excel Programming 2 December 15th 03 11:07 PM


All times are GMT +1. The time now is 02:58 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"