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)
 

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