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 1 1492
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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
|
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...
|
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.
----------------------------------------------------------------------------
----
|
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...
| |
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...
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
| |
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |