G
Guest
Hi Developers,
I am trying to access an Excel data file through a VB.Net application.
I have the following code:
=================================== VB.Net Code ===================
Dim sSqlString = ""
Dim rCount As Integer = 0
Dim sDataSet As New DataSet()
sSqlString = "Select * From [Sheet1$]"
Dim sConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + "E:\Visual Basic.NET\DataOne" + ";Extended Properties=Excel 8.0;HDR=YES;"
Dim dbConn As New OleDbConnection(sConnString)
Dim sCommandSelect As New OleDbCommand(sSqlString, dbConn)
Try
sCommandSelect.Connection.Open()
Catch ex As OleDbException
MessageBox.Show(ex.Message, ex.ErrorCode)
End Try
=========================================================
Each time I hit the statement "sCommandSelect.Connection.Open()" above, I got the following error:
"Could not find installable ISAM"
Excel 2002 and Visual Studio.Net are both fully and successfully installed.
Anyone knows why it would not make work?
Sincerely,
Omar
P.S. Please cc your reply to my email: (e-mail address removed)
I am trying to access an Excel data file through a VB.Net application.
I have the following code:
=================================== VB.Net Code ===================
Dim sSqlString = ""
Dim rCount As Integer = 0
Dim sDataSet As New DataSet()
sSqlString = "Select * From [Sheet1$]"
Dim sConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + "E:\Visual Basic.NET\DataOne" + ";Extended Properties=Excel 8.0;HDR=YES;"
Dim dbConn As New OleDbConnection(sConnString)
Dim sCommandSelect As New OleDbCommand(sSqlString, dbConn)
Try
sCommandSelect.Connection.Open()
Catch ex As OleDbException
MessageBox.Show(ex.Message, ex.ErrorCode)
End Try
=========================================================
Each time I hit the statement "sCommandSelect.Connection.Open()" above, I got the following error:
"Could not find installable ISAM"
Excel 2002 and Visual Studio.Net are both fully and successfully installed.
Anyone knows why it would not make work?
Sincerely,
Omar
P.S. Please cc your reply to my email: (e-mail address removed)