Request.ServerVariables APPL_PHYSICAL_PATH returning wrong directory - suspicion it is METABASE PATH problem

Posted on 2004-11-24
Last Modified: 2008-01-16

I'm completely lost with this problem. We've changed servers so that a webstie we've moved to IIS 6.0 that was on IIS 4.0 is in a different directory structure on the new computer.

On the old computer the directory was on the D: drive and on the new computer with IIS 6.0 the directory is on the C: drive. Here is the error message I'm getting:


Microsoft JET Database Engine error '80004005'

'D:\Inetpub\wwwroot\lawsuit-free\MemberArea\Misc\MemberArea\Misc\Login.mdb' 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.



Here is the code in LFInclude.asp on line 6


<!-- METADATA TYPE="typelib"
              FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
  Dim objConn
  Set objConn = Server.CreateObject("ADODB.Connection")
  objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
               "Data Source= " + Request.ServerVariables("APPL_PHYSICAL_PATH") +"\Login.mdb"

  Dim objConnInv
  Set objConnInv= Server.CreateObject("ADODB.Connection")
  objConnInv.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
               "Data Source= " + Request.ServerVariables("APPL_PHYSICAL_PATH") +"\Purchases.mdb"

  If Session("blnValidUser") = True and Session("PersonID") = "" Then
    Dim rsPersonIDCheck
    Set rsPersonIDCheck = Server.CreateObject("ADODB.Recordset")
    Dim strSQL
    strSQL = "SELECT PersonID FROM Person " & _
             "WHERE EMailAddress = '" & Session("EMailAddress") & "';"
    rsPersonIDCheck.Open strSQL, objConn
    If rsPersonIDCheck.EOF Then
      Session("blnValidUser") = False
    Response.Write "Testing"
      Session("PersonID") = rsPersonIDCheck("PersonID")
    End If
    Set rsPersonIDCheck = Nothing
  End If


I have no idea where to look for a solution. I've checked the metabase.xml file to see if there was anything there referencing the D:\ drive (which is nonexistent on this machine)

What puzzles me is that the error references the D: drive in both the path and the path for the file that is being included.

Can someone please direct me to some kind of solution?

By the way, the correct path should be:


And we can access the same page via an ip address directly without the error.


Guy Davis
Question by:guytdavis
    LVL 16

    Expert Comment

    Some questions:

    1. Are there multiple sites on this server? Is there one set to respond to the host header you normally use that is not the default web site?

    2. What, if anything, is in C:\Inetpub\wwwroot\lawsuit-free?

    3. Is there a virtual directory in use here?

    4. Have you considered using Server.MapPath instead?

    Author Comment

    1. Yes, there are multiple sites on the server. I am not sure about the 2nd part to this question.
    2. in c:\inetpub\wwwroot\lawsuit-free is the main website
    3. I have no idea if a virtual directory is in use. how do I find our?
    4. I'll try this... I'm not an asp expert but maybe this will solve the problem
    LVL 16

    Expert Comment

    Sorry, 2 should have said what is in D:\...

    1. In IIS Manager, click on Web Sites. In the list, is there a site other than your own that has a blank under "Host header value" and 80 under "Port" in the table? What is under "Host header value" by your site?

    3. May be irrelevant - hold off on that one until I know more about 1 and 2.

    Author Comment

    1. there is no d: drive on this computer - there was a D: on the old computer that this site was moved from

    all of the sites have a blank under "Host header value" including this one
    2 sites have 8099, 5479 under "Port" - both of these are Stopped
    LVL 16

    Accepted Solution

    Hmmm. The IIS metabase seems to be corrupted in that case. How did you transfer the old site to the new server?

    There is an article here on restoring a backup if there is one. Try the steps in there (you might not be able to or want to uninstall and reinstall IIS, but at least go down to that point if you can).

    As a workaround, Server.MapPath may sort you out.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    IIS and .Net Web Service 24 91
    SMTP Question 3 55
    How to remove exclusion group 10 34
    app pool not starting Exchange 2010 12 32
    What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
    If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now