Using Microsoft Query

  • Thread starter Thread starter Paul Johnson
  • Start date Start date
P

Paul Johnson

I'm am using Microsoft query to return data from a combination of 2 sheets
within the workbook and into a new sheet.
How can I control the sql to always find the spreadsheets in the workbook in
the current directory? So that if I save the workbook to different location
the queries work for the workbook in the new location. At present if I save
it back it looks to the old location for the tables.

Thanks

Paul
 
Paul said:
How can I control the sql to always find the spreadsheets in the workbook in
the current directory? So that if I save the workbook to different location
the queries work for the workbook in the new location. At present if I save
it back it looks to the old location for the tables.

Simply omit the path in the connection string e.g.

instead of

SELECT * FROM [Excel 8.0;Database=C:\Tempo\Book1.xls;].[A:A];

use

SELECT * FROM [Excel 8.0;Database=Book1.xls;].[A:A];

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top