Results 1 to 4 of 4

Thread: Connecting to Excell file - Problems with conn string?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93

    Connecting to Excell file - Problems with conn string?

    I'm trying to connect an ASP web app to an Excel file and am having a lot of difficulity with the data souce in my connection string. I've searched this site & Googled for the answer on this but so far have come up blank. All of the examples are given with the path like this:

    C:\Myfiles\MyExcel.xls

    My connection string looks like this (which works just fine for the local development on my machine):

    Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source = C:\menu.xls;" & "Extended Properties=""Excel 8.0;"""

    My problem comes in when I get to the point of deployment and I need to move the Excel file out onto a server on the network.

    This is what I've tried so far;

    Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source = (\\Stkprod15\depart1\mis\CafeteriaMenu\menu.xls" & "Extended Properties=""Excel 8.0;"""

    I receive an unspecified error when I try to run with this connection string. My questions are:

    Do I have the syntax correct?
    The server referenced in the connection string is not the web server, it is where I want to place the file, does this matter? Should the server be referenceing the web server?

    Project specifications:

    ASP.NET 2003, Excel 2003


    Thanks for any help someone can provide.

    Corinne

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Its possible ASPNET does not have permissions to access that file.

    It would work on your local machine, because the ASPNET account on your machine has permissions to access the file.

    However, once you move the file to a different machine, there needs to be a way to tell that machine, your machine and its ASPNET account has permissions.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93
    Thanks for the response - can you give me some direction on how to accomplish this?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93

    Connection string

    Anyone??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width