Microsoft JET database error while trying to open excel file from ASP.NET

Discussion in 'ASP .Net' started by rh.krish@gmail.com, Dec 29, 2005.

  1. Guest

    Hi
    I'm trying to open an excel file uploaded by the user and read the
    content. I'm able to save the file in the web server, but when I try to
    open it - I get the following error:

    "The Microsoft Jet database engine cannot open the file ''. It is
    already opened exclusively by another user, or you need permission to
    view its data.
    "

    This is the code i used to get the data:
    fileName = "Shippers.xls";
    string excelConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Extended
    Properties='Excel 8.0;HDR=Yes';Data Source=" + fileName;
    OleDbConnection con = new OleDbConnection ( excelConStr );
    con.Open ();
    ......
    ......
    ......

    I had granted write access to the folder (where i save the file) and
    the MACHINE\ASPNET account - but no use.
    Help please!....

    Regards,
    Hari.
     
    , Dec 29, 2005
    #1
    1. Advertising

  2. Did you close the file after writing it to the disk?

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    You can lead a fish to a bicycle,
    but it takes a very long time,
    and the bicycle has to *want* to change.

    <> wrote in message
    news:...
    > Hi
    > I'm trying to open an excel file uploaded by the user and read the
    > content. I'm able to save the file in the web server, but when I try to
    > open it - I get the following error:
    >
    > "The Microsoft Jet database engine cannot open the file ''. It is
    > already opened exclusively by another user, or you need permission to
    > view its data.
    > "
    >
    > This is the code i used to get the data:
    > fileName = "Shippers.xls";
    > string excelConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Extended
    > Properties='Excel 8.0;HDR=Yes';Data Source=" + fileName;
    > OleDbConnection con = new OleDbConnection ( excelConStr );
    > con.Open ();
    > .....
    > .....
    > .....
    >
    > I had granted write access to the folder (where i save the file) and
    > the MACHINE\ASPNET account - but no use.
    > Help please!....
    >
    > Regards,
    > Hari.
    >
     
    Kevin Spencer, Dec 30, 2005
    #2
    1. Advertising

  3. Paul Clement Guest

    On 29 Dec 2005 15:57:31 -0800, wrote:

    ¤ Hi
    ¤ I'm trying to open an excel file uploaded by the user and read the
    ¤ content. I'm able to save the file in the web server, but when I try to
    ¤ open it - I get the following error:
    ¤
    ¤ "The Microsoft Jet database engine cannot open the file ''. It is
    ¤ already opened exclusively by another user, or you need permission to
    ¤ view its data.
    ¤ "
    ¤
    ¤ This is the code i used to get the data:
    ¤ fileName = "Shippers.xls";
    ¤ string excelConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Extended
    ¤ Properties='Excel 8.0;HDR=Yes';Data Source=" + fileName;
    ¤ OleDbConnection con = new OleDbConnection ( excelConStr );
    ¤ con.Open ();
    ¤ .....
    ¤ .....
    ¤ .....
    ¤
    ¤ I had granted write access to the folder (where i save the file) and
    ¤ the MACHINE\ASPNET account - but no use.
    ¤ Help please!....

    Try providing "full" access to the folder where this file is located.


    Paul
    ~~~~
    Microsoft MVP (Visual Basic)
     
    Paul Clement, Dec 30, 2005
    #3
    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. =?Utf-8?B?RGF2ZQ==?=

    The Microsoft Jet database engine cannot open the file

    =?Utf-8?B?RGF2ZQ==?=, Aug 3, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    985
    =?Utf-8?B?RGF2ZQ==?=
    Aug 5, 2005
  2. =?Utf-8?B?TmVhbA==?=
    Replies:
    3
    Views:
    41,759
    Paul Clement
    Sep 2, 2005
  3. Morten Wennevik
    Replies:
    1
    Views:
    3,148
    Morten Wennevik
    Oct 31, 2005
  4. Jas
    Replies:
    1
    Views:
    982
    Patrice
    Jan 25, 2010
  5. snazzy
    Replies:
    2
    Views:
    273
    Bob Barrows [MVP]
    Nov 7, 2008
Loading...

Share This Page