Select record External Source

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi:

I would like to insert a record and the record is extracted from Excel file
in Access 2003. I know I can write the SQL command as:

insert into Table1
select * from Table2

But, what's the expression in Table2 so that it can refer to an Excel file
source (e.g. The excel file is C:\test.xls)? I try many times but it still
fails.

Thanks

John
 
John,

I'm don't think you can write a SQL statement to directly select information
from Excel.

I would recommend that you first link to the spreadsheet (File - Get
External - Link Tables), or if you need to do this programmatically checkout
the TransferSpreadsheet method.

Then you can write a SQL statement against the linked "table".

HTH
Dale
 
sure you can...

SELECT *
FROM Menu
IN "G:\ADH\Ch05\test5.xls" "Excel 5.0;"

straight from ADH...
 
Didn't have my developers handbook handy.

I guess that automatically selects from Sheet1 then? I'll have to give that
a try.

Dale
 
Didn't have my developers handbook handy.

I guess that automatically selects from Sheet1 then? I'll have to give that
a try.

Dale








- Show quoted text -

Can't remember that part. I think you have to specify it. Check out
what's at Access Web. I think someone sorted that out.

www.mvps.org/Access

It's a common problem, so the answer should be there.
 
Back
Top