473,849 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OLEdb problem

EMW
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
Nov 18 '05 #1
1 1496
I would guess a security error, or a path error.
What is the FileName, and can ASPNET (or the ASPNET use id on the server)
read it ?
I would highly doubt that you need Oledb.dll in the bin directory.
"EMW" <someone_@_MS.c om> wrote in message
news:41******** **************@ dreader2.news.t iscali.nl...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1855
by: Chris Thunell | last post by:
I have a program where i connect to an access database and get some information out of it. I'm using the oledb.3.51 version, my computer doesn't seem to have the 4.0 version, but the computer that is trying to run it only have the 4.0 version. So as you will see with the code below, i first try to open the 4.0 version... if that doesn't work, do the 3.51 version. When i run the program from my computer... the 4.0 fails and it goes to...
2
23970
by: Joe | last post by:
Hi All, I am new to using the Access DB and I need some help if someone is able to give it to me. What I want to do is get the names of the columns of certain tables. Not the data in the table but the table column names. I've seen other posts that suggest using the SQL command DESCRIBE but I can't get it to work for some reason. Other posts have code samples but they're written in VB which I am not familiar with. I
9
4779
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and DataSet; and all I'm doing is showing one record in text fields, allowing the user to modify the text fields, and then updating the database again when the user clicks the Save button. The fields already show the correct data record since I have...
3
8843
by: Brian Foree | last post by:
I am developing an ASP.NET application that uses Access 2000 as its backend, and have just started getting the following error on 2 ASP.NET pages that had been working until late last week (and I don't think I made any changes to either page other than changing the user control that creates the header). Server Error in '/myApp' Application. ---------------------------------------------------------------------------- ----
3
1424
by: Chris Thunell | last post by:
I have a program where i connect to an access database and get some information out of it. I'm using the oledb.3.51 version, my computer doesn't seem to have the 4.0 version, but the computer that is trying to run it only have the 4.0 version. So as you will see with the code below, i first try to open the 4.0 version... if that doesn't work, do the 3.51 version. When i run the program from my computer... the 4.0 fails and it goes to...
0
9893
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9738
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10665
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7070
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5921
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4139
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3177
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.