Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    13

    Question Unanswered: Problem connecting to Access using ASP

    Hi kids,

    I'm a newbie to ASP. I've successfully connected to an Access database located on a local drive of my IIS server, but I get the following error while connecting to the same database if I move it to a network shared folder:

    "Microsoft JET Database Engine error '80004005'

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

    L: is a mapped network drive on the IIS server pointing to a folder on another server on the network. Bothe servers run NT 4.0 SP6 and the IIS user account has full NTFS rights to the mdb file and all folders in the path. It is not opened by another user when this error occurs.

    The database is very simple - just two tables with some test data, no passwords or anything like that.

    My connection string is
    ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=L:\data\testdb.mdb")

    It's an Access 2000 database.

    The line that causes the error is the fourth one below:

    Dim dbLogistics
    Set dbLogistics = Server.CreateObject ("ADODB.Connection")
    dbLogistics.Mode = adModeReadWrite
    dbLogistics.Open(strConnectionString)

    Eternal gratitude and free beer to the reply that gets me past my first major hurdle in ASP.

    Thanks,

    Kev

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    Well, I have to know what beer before I reply.

    But, seriously ... Normally this is tied to your iusr... account, that iis uses to access the file, not having access on your network or password syncronization is enabled on your iis or you have an mdac version that is buggy or you need to use the unc instead of the letter mapping or ....

    The following is a link that will help you:

    link

  3. #3
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    13
    Hi rnealejr,

    Thanks for that link. Still getting the error message - here's my progress so far:

    My IUSR account has been given full rights to the share and the NTFS folder in which the db resides.

    IUSR also has full rights to the db file.

    The "default open mode" for the Access db is set to shared, not exclusive.

    Im IIS Management Console, I've checked the Directory security for the site, the directory, the asp page and the db file - IUSR has full rights for all of these.

    I've cleared the "Enable Automatic Password Synchronization" check box on the site and directory.

    I've tested connecting with the same user, same page etc by putting the testdb on a local drive on the IIS server and it connects perfectly.

    I've set the TEMP and TMP environment variables on the IIS server AND on the file server and given IUSR rights to put temporary files into the temporary directories on each server.

    IUSR is a domain account, not a local account, and has rights to log onto all workstations.

    I've installed MDAC 2.7 on the IIS server.

    I've asked an ASP programmer and she advised me to give up and use a local database.

    If you REALLY want that free beer (your choice, but you may have to come to Dublin to get it) could you please let me know where to go from here?

    Thanks,

    Kev

  4. #4
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    13
    Hi Eve,

    Thanks for the suggestions. I'm not sure the problem is with my connection string, as I manage to connect perfectly to a local database.

    However, I will try them all.

    If I use ODBC, MySQL or MS Access drivers to connect, how does that affect my use of recordsets?

    What is the alternative structure in VBScript for these drivers?

    I want to display the data from my database in a HTML table, which I can do easily enough using ADO recordsets.

    Or should I give up, as my friendly local ASP guru suggests? Would this be easier in PHP (of which I know nothing but I am a fast learner)?

    Cheers,

    Kev

  5. #5
    Join Date
    Aug 2002
    Posts
    1

    ASP connect to database

    Try setting application security to "low" instead of medium as a troubleshooting measure. If that works, then you still have permission issues either on a NT folder level, or I_USR level.

  6. #6
    Join Date
    Feb 2002
    Posts
    2,232
    Have you tried replacing the iusr account with a domain administrator (temporarily) to test ? Also, what does your event viewer reveal ?

  7. #7
    Join Date
    Feb 2002
    Posts
    2,232
    Your not using ssl are you ? Which authentication method are you using with iis ?
    Last edited by rnealejr; 08-26-02 at 23:56.

  8. #8
    Join Date
    Jul 2002
    Location
    Australia
    Posts
    147
    I think you have to use a different type of connection string if you are accessing and Access DB on a different server, (not that I've ever got it to work!).

    Also might try using the UNC path rather than a mapped drive (L)

    Try the strings here:
    http://www.able-consulting.com/ADO_Conn.htm

    Cheers,
    Andrew
    There have been many posts made throughout the world.
    This was one of them.

Posting Permissions

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