I'm attempting to create an ASP.Net application (using a
VB.Net code behind page)process that creates a connection
to an Excel spreadsheet and reads the contents of the
spreadsheet.
However,when the command is executed to open the
connection (cnnExcel.Open()) , I receive the following error:
"Could Not Find Installable ISAM"
When I use ""Excel 8.0;... I receive the error
"Failure Creating File"
The code I am executing appears below:
Public Sub importProviderExcelFiles()
Dim m_sConnection As String
="Provider=Microsoft.Jet.OleDB.4.0;" & _
"Data Source=E:\CESpreadsheet.xls;" & _
"Extended Properties=""Excel 9.0;HDR=YES"""
Dim cnnExcel As New System.Data.OleDb.OleDbConnection
(m_sConnection)
cnnExcel.Open()
Dim cmdExcel As New System.Data.OleDb.OleDbCommand
("Select * From [Sheet1$]", cnnExcel)
Dim excelDataReader As OleDbDataReader =
cmdExcel.ExecuteReader
Do While excelDataReader.Read
excelDataReader.GetString(0)
Loop
excelDataReader.Close()
cnnExcel.Close()
Any assistance will be greatly appreciated!
Thanks.
Brian
VB.Net code behind page)process that creates a connection
to an Excel spreadsheet and reads the contents of the
spreadsheet.
However,when the command is executed to open the
connection (cnnExcel.Open()) , I receive the following error:
"Could Not Find Installable ISAM"
When I use ""Excel 8.0;... I receive the error
"Failure Creating File"
The code I am executing appears below:
Public Sub importProviderExcelFiles()
Dim m_sConnection As String
="Provider=Microsoft.Jet.OleDB.4.0;" & _
"Data Source=E:\CESpreadsheet.xls;" & _
"Extended Properties=""Excel 9.0;HDR=YES"""
Dim cnnExcel As New System.Data.OleDb.OleDbConnection
(m_sConnection)
cnnExcel.Open()
Dim cmdExcel As New System.Data.OleDb.OleDbCommand
("Select * From [Sheet1$]", cnnExcel)
Dim excelDataReader As OleDbDataReader =
cmdExcel.ExecuteReader
Do While excelDataReader.Read
excelDataReader.GetString(0)
Loop
excelDataReader.Close()
cnnExcel.Close()
Any assistance will be greatly appreciated!
Thanks.
Brian