Cannot open XML file from ASP if "logged in"


  • I have a (classic) ASP page. I open an XML file in the page. Works great.

    I need to get the username, so up front, I force login by:

    If Request.ServerVariables("LOGON_USER") = "" Then
      Response.Status = "401 Access Denied"
    End If
    Response.Write Request.ServerVariables("LOGON_USER")   ' (This works fine.)

    Once I do this, I can no longer open the XML file (mapped drive). I get:
    "Error 3709:The connection cannot be used to perform this operation. It is either closed or invalid in this context."

    Why can I only open the file if I am Anonymous? This is driving me crazy!
    Saturday, February 18, 2017 3:48 AM