Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problem in excel opening on IIS 5.1

Problem in excel opening on IIS 5.1

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabaseoraclesysadmin
9 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amittinku
    wrote on last edited by
    #1

    I have written a code to upload data from excel to oracle database in asp.net.This code is working fine on local machine. I have hosted this code on web server IIS 5.1 using my credentials(OS window XP SP3, so default IIS is 5.1). Problem : When I login on the server machine using my login id ,the application runs fine. If I try to run this application from another local machine other than server(using same my login id) then also there is no problem. But if someone else logs in into a local machine and tried to run the application using his id   then it’s not working.. This is my connection string: OleDbConnection oledbConn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Label1.Text + ";" + "Extended Properties=Excel 12.0"); The code fails after oledbConn.Open(); when someone else logs in into a local machine

    C 1 Reply Last reply
    0
    • A amittinku

      I have written a code to upload data from excel to oracle database in asp.net.This code is working fine on local machine. I have hosted this code on web server IIS 5.1 using my credentials(OS window XP SP3, so default IIS is 5.1). Problem : When I login on the server machine using my login id ,the application runs fine. If I try to run this application from another local machine other than server(using same my login id) then also there is no problem. But if someone else logs in into a local machine and tried to run the application using his id   then it’s not working.. This is my connection string: OleDbConnection oledbConn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Label1.Text + ";" + "Extended Properties=Excel 12.0"); The code fails after oledbConn.Open(); when someone else logs in into a local machine

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Naturally, if you told us what label1.Text was, we might have some suggestions.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      A 1 Reply Last reply
      0
      • C Christian Graus

        Naturally, if you told us what label1.Text was, we might have some suggestions.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        A Offline
        A Offline
        amittinku
        wrote on last edited by
        #3

        Label1.Text = FileUpload1.PostedFile.FileName; containing name and path of excel file

        C 1 Reply Last reply
        0
        • A amittinku

          Label1.Text = FileUpload1.PostedFile.FileName; containing name and path of excel file

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          And this is supposed to find the file using the network, right ? I suspect the issue has to do with the login you're using because it has to do with permission to grab files at random across the network. OR it has to do simply with your login having the right to access files on your computer.

          amittinku wrote:

          Label1

          amittinku wrote:

          FileUpload1

          Are you attempting to make your code as hard to read as possible ?

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          A 1 Reply Last reply
          0
          • C Christian Graus

            And this is supposed to find the file using the network, right ? I suspect the issue has to do with the login you're using because it has to do with permission to grab files at random across the network. OR it has to do simply with your login having the right to access files on your computer.

            amittinku wrote:

            Label1

            amittinku wrote:

            FileUpload1

            Are you attempting to make your code as hard to read as possible ?

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            A Offline
            A Offline
            amittinku
            wrote on last edited by
            #5

            I am agreeing that issue is with some permissions. It is web based application, any one can use it. After accessing the URL from local machine, any user can try to select excel placed in any location on his desktop. So how to do settings on IIS so that any user could do it, not just who configured IIS.

            C 1 Reply Last reply
            0
            • A amittinku

              I am agreeing that issue is with some permissions. It is web based application, any one can use it. After accessing the URL from local machine, any user can try to select excel placed in any location on his desktop. So how to do settings on IIS so that any user could do it, not just who configured IIS.

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              It's not an IIS issue. It's a network issue. Your current code will only work if you give the server access to all the computers. But you have the file data, why not write it locally and read it from there ?

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              A 1 Reply Last reply
              0
              • C Christian Graus

                It's not an IIS issue. It's a network issue. Your current code will only work if you give the server access to all the computers. But you have the file data, why not write it locally and read it from there ?

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                A Offline
                A Offline
                amittinku
                wrote on last edited by
                #7

                i have not got u completely. see code is on webseerver. we r calling from any other machine. When local machine try to access webserver, it asks for username and password, but after that does not open excel file. I did not get "But you have the file data, why not write it locally and read it from there ? "

                A 1 Reply Last reply
                0
                • A amittinku

                  i have not got u completely. see code is on webseerver. we r calling from any other machine. When local machine try to access webserver, it asks for username and password, but after that does not open excel file. I did not get "But you have the file data, why not write it locally and read it from there ? "

                  A Offline
                  A Offline
                  amittinku
                  wrote on last edited by
                  #8

                  I am posting the exact error that i Got at oledbConn.Open(); Exception ex ex.message returns "C:\Users\vikas_aggarwal01\Desktop\Kapil.xls' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides." ex.source returns " Microsoft Office Access Database Engine" The above error comes only when another user tries to do it.

                  A 1 Reply Last reply
                  0
                  • A amittinku

                    I am posting the exact error that i Got at oledbConn.Open(); Exception ex ex.message returns "C:\Users\vikas_aggarwal01\Desktop\Kapil.xls' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides." ex.source returns " Microsoft Office Access Database Engine" The above error comes only when another user tries to do it.

                    A Offline
                    A Offline
                    amittinku
                    wrote on last edited by
                    #9

                    I tried with different user, I am getting similar error: The Microsoft Office Access database engine cannot open or write to the file 'C:\Users\Public'. It is already opened exclusively by another user, or you need permission to view and write its data.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups