OLEdb problem

Discussion in 'ASP .Net' started by EMW, Nov 8, 2004.

  1. EMW

    EMW Guest

    I use the following function to read an Excel worksheet into a dataset:

    Public Function GetDataFromExcel(ByVal FileName As String, ByVal ds As
    DataSet) As Boolean
    Try
    Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data
    Source=" & FileName & "; Extended Properties=Excel 8.0;"
    Dim objConn As New System.Data.OleDb.OleDbConnection(strConn)
    objConn.Open()
    ' Create objects ready to grab data
    Dim objCmd As New System.Data.OleDb.OleDbCommand("SELECT * FROM
    [sheet1$]", objConn)
    Dim objDA As New System.Data.OleDb.OleDbDataAdapter
    objDA.SelectCommand = 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.OleDb.OleDbException: Unspecified error at
    System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at
    System.Data.OleDb.OleDbConnection.InitializeProvider() at
    System.Data.OleDb.OleDbConnection.Open() at
    FSsite.FSsite.WebFormSubmit.GetDataFromExcel(String FileName, DataSet ds)

    Now I copied to System.Data.OleDb.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
    EMW, Nov 8, 2004
    #1
    1. Advertising

  2. 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.com> wrote in message
    news:418f3626$0$44069$...
    >I use the following function to read an Excel worksheet into a dataset:
    >
    > Public Function GetDataFromExcel(ByVal FileName As String, ByVal ds As
    > DataSet) As Boolean
    > Try
    > Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data
    > Source=" & FileName & "; Extended Properties=Excel 8.0;"
    > Dim objConn As New System.Data.OleDb.OleDbConnection(strConn)
    > objConn.Open()
    > ' Create objects ready to grab data
    > Dim objCmd As New System.Data.OleDb.OleDbCommand("SELECT * FROM
    > [sheet1$]", objConn)
    > Dim objDA As New System.Data.OleDb.OleDbDataAdapter
    > objDA.SelectCommand = 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.OleDb.OleDbException: Unspecified error at
    > System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at
    > System.Data.OleDb.OleDbConnection.InitializeProvider() at
    > System.Data.OleDb.OleDbConnection.Open() at
    > FSsite.FSsite.WebFormSubmit.GetDataFromExcel(String FileName, DataSet ds)
    >
    > Now I copied to System.Data.OleDb.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
    >
    Dino Chiesa [Microsoft], Nov 8, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jan Smazinka

    FoxPro OleDb Problem on Windows 2003

    Jan Smazinka, Nov 28, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    482
    Jan Smazinka
    Nov 28, 2003
  2. =?Utf-8?B?Uk1M?=

    MS Access OLEDB connection problem

    =?Utf-8?B?Uk1M?=, Jul 21, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    3,244
    =?Utf-8?B?Uk1M?=
    Jul 24, 2004
  3. mo
    Replies:
    0
    Views:
    430
  4. Stefan Landgraf

    Problem with OleDB Dateformats using Access-DB

    Stefan Landgraf, Jan 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    306
    Stefan Landgraf
    Jan 17, 2005
  5. Patrick.O.Ige

    Informix OLEDB problem

    Patrick.O.Ige, Nov 9, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    3,225
    Patrick.O.Ige
    Nov 9, 2005
Loading...

Share This Page