The Connection string to Excel

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I use the ConnectionString below to read data from excel files.
It succss with some excel files, but fail with others.
I think the excel file have different versions.

How can I make a general connection string which can read Excel for
defferent versions?
 
¤ I use the ConnectionString below to read data from excel files.
¤ It succss with some excel files, but fail with others.
¤ I think the excel file have different versions.
¤
¤ How can I make a general connection string which can read Excel for
¤ defferent versions?
¤
¤
¤
¤ ------------------------------------------------------------------------------------
¤ string sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data
¤ Source=" + sExcelFile +
¤ "; Extended Properties=" +
¤ (char)34 + "Excel 8.0;IMEX=1;" + (char)34;


The connection string should work with any version of Excel. What sort of error message is generated
when the connection fails?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Back
Top