Error querying excel file, "Could not find installable ISAM"

G

Guest

i am querying excel file as follows

Dim conn As New OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source='" &
"C:\Temp\SSPortfolio.xls" & " '; " & _
"Extended Properties=Excel 8.0;" &
"HDR=Yes;" & "IMEX=1")


'! Select the data from Sheet1 of the workbook.
Dim da As New OleDbDataAdapter("SELECT * FROM [SSPortfolio$]", conn)

Dim ds As New DataSet

da.Fill(ds)

DataGridView1.DataSource = ds.Tables(0)

but getting an error message saying "Could not find installable ISAM". what
thia error cud be???

thanks
 
P

Paul Clement

¤ i am querying excel file as follows
¤
¤ Dim conn As New OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; " & _
¤ "data source='" &
¤ "C:\Temp\SSPortfolio.xls" & " '; " & _
¤ "Extended Properties=Excel 8.0;" &
¤ "HDR=Yes;" & "IMEX=1")
¤
¤
¤ '! Select the data from Sheet1 of the workbook.
¤ Dim da As New OleDbDataAdapter("SELECT * FROM [SSPortfolio$]", conn)
¤
¤ Dim ds As New DataSet
¤
¤ da.Fill(ds)
¤
¤ DataGridView1.DataSource = ds.Tables(0)
¤
¤ but getting an error message saying "Could not find installable ISAM". what
¤ thia error cud be???

Usually an indication of a bad connection string. Try something like the following:

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Temp\SSPortfolio.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""

Dim ExcelConnection As New System.Data.OleDb.OleDbConnection(ConnectionString)
ExcelConnection.Open()


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

Top