I use the following function to read an Excel worksheet into a dataset:
Public Function GetDataFromExce l(ByVal FileName As String, ByVal ds As
DataSet) As Boolean
Try
Dim strConn As String = "Provider=Micro soft.Jet.OLEDB. 4.0; Data
Source=" & FileName & "; Extended Properties=Exce l 8.0;"
Dim objConn As New System.Data.Ole Db.OleDbConnect ion(strConn)
objConn.Open()
' Create objects ready to grab data
Dim objCmd As New System.Data.Ole Db.OleDbCommand ("SELECT * FROM
[sheet1$]", objConn)
Dim objDA As New System.Data.Ole Db.OleDbDataAda pter
objDA.SelectCom mand = objCmd
' Fill DataSet
objDA.Fill(ds)
' Clean up and return
objConn.Close()
Return True
Catch ex As Exception
lblHeading.Text = ex.ToString
Return False
End Try
End Function
When I run my ASPX on my own PC it runs fine and does what it must do.
When I put the page on the server I get this message:
System.Data.Ole Db.OleDbExcepti on: Unspecified error at
System.Data.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) at
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() at
System.Data.Ole Db.OleDbConnect ion.Open() at
FSsite.FSsite.W ebFormSubmit.Ge tDataFromExcel( String FileName, DataSet ds)
Now I copied to System.Data.Ole Db.dll file to the BIN folder at the IIS
webserver, but is there anything else I should do?
Can anyone explain to me what this means, it's a little vage error message?
thanks,
Eric
Public Function GetDataFromExce l(ByVal FileName As String, ByVal ds As
DataSet) As Boolean
Try
Dim strConn As String = "Provider=Micro soft.Jet.OLEDB. 4.0; Data
Source=" & FileName & "; Extended Properties=Exce l 8.0;"
Dim objConn As New System.Data.Ole Db.OleDbConnect ion(strConn)
objConn.Open()
' Create objects ready to grab data
Dim objCmd As New System.Data.Ole Db.OleDbCommand ("SELECT * FROM
[sheet1$]", objConn)
Dim objDA As New System.Data.Ole Db.OleDbDataAda pter
objDA.SelectCom mand = objCmd
' Fill DataSet
objDA.Fill(ds)
' Clean up and return
objConn.Close()
Return True
Catch ex As Exception
lblHeading.Text = ex.ToString
Return False
End Try
End Function
When I run my ASPX on my own PC it runs fine and does what it must do.
When I put the page on the server I get this message:
System.Data.Ole Db.OleDbExcepti on: Unspecified error at
System.Data.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) at
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() at
System.Data.Ole Db.OleDbConnect ion.Open() at
FSsite.FSsite.W ebFormSubmit.Ge tDataFromExcel( String FileName, DataSet ds)
Now I copied to System.Data.Ole Db.dll file to the BIN folder at the IIS
webserver, but is there anything else I should do?
Can anyone explain to me what this means, it's a little vage error message?
thanks,
Eric