Thread: sql
View Single Post
  #2 (permalink)  
Old May 4th, 2006, 07:44 PM
SMerrill8 SMerrill8 is offline
Registered User
 
Join Date: May 2006
Location: Bremerton, WA, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Connect to it with the following ADO connection string:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
"HDR=Yes;" indicates that the first row contains columnnames, not data
"IMEX=1;" tells the driver to always read "intermixed" data columns as text
TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name followed by a "$" and wrapped in "[" "]" brackets.
It is nice if the data rectangle starts in the upper-left corner of the sheet.

~ Shaun
Reply With Quote