0

Hi

I would like to get the connection string for both 2003 excel (*.xls) and 2007 excel (*.xlsx). I want to read both files depends upon the selection.

When I was using this code

Dim cn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & a_sFilepath & ";Extended Properties= Excel 8.0;HDR=YES;")

I get an oleDB exception "Could not find installable ISAM" and also I would like to know wheather we can use same connection string for both .XLS and *.XLSX

3
Contributors
4
Replies
7
Views
6 Years
Discussion Span
Last Post by deva.v
-1

hi..try this connection string...

Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
                MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; Data Source='" & filepath & "';Extended Properties=Excel 8.0;")
                MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection)

Try this below .to how to import excel file to database
[snipped blog promo]

Edited by Ezzaral: n/a

Votes + Comments
why you need to post the blog link
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.