Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2810
  • Last Modified:

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


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
  • 3
  • 2
1 Solution
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?
guytdavisAuthor Commented:
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
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.
guytdavisAuthor Commented:
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
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.

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now