ASP Not working correctly. Error 500

Hello Experts, Thank you in advance for your help. I am running SBS2003 with IIS installed. My HTML website is up and running fine. I have downloaded a knowledge base application that is all ASP. Under my WWW root I created a folder called newkb. This folder has 4 more subfolders and there are files in all folders. If I type in http://www.mydomain.com/newkb my default asp comes up fine. No problems. I can navigate to any page that is in the newkb directory. Also under the newkb folder is a folder called admin, seems to have the same permissions and everything that newkb has. But when I type in http://www.mydomain.com/newkb/admin I get the dreaded 500 error. I cannot even type in http://www.mydomain.com/newkb/admin/default.asp I get the same error message. Needless to say all of this does me no good without the admin modules. Thanks for your help in advance.
LVL 5
darrenakinAsked:
Who is Participating?
 
nschaferConnect With a Mentor Commented:
>>sure, and thank you so much for your help
No problem that's why I come here.

As to the problem.  Let's try changing the line slightly.

Change this:
<!--#include file="/newkb/Connections/connDUfaqAdmin.asp" -->

To:
<!--#include virtual="/newkb/Connections/connDUfaqAdmin.asp" -->

The difference here is that file specifies the path from the current path while virtual specifies the path from the root of the web site.  I think this may resolve the problem.

Neal.


0
 
nschaferCommented:
darrenakin,

Let's find out what the error actually is.

If you are using IE, do the following Click On:
  Tools --> Internet Options --> Advanced
  Remove the checkmark from "Show Friendly HTTP Error Messages

Now try to go to the page again.  You will still get the error message, but there should be a lot more information.  This should help us in helping you.

Neal.
0
 
darrenakinAuthor Commented:
The error is this;

Active Server Pages error 'ASP 0131'

Disallowed Parent Path

/newkb/admin/Default.asp, line 2

The Include file '../Connections/connDUfaqAdmin.asp' cannot contain '..' to indicate the parent directory.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
nschaferCommented:
The error message should give you what you need to resolve the problem.

The error is on line 2 of the script.

I assume the code looks something like this:

<!-- #include file="../Connections/connDUfaqAdmin.asp" -->

change this to:

<!-- #include file="/newkb/Connections/connDUfaqAdmin.asp" -->

and it should solve the problem.  The page with the error is in the following path:  /newkb/admin    the original code is using .. to try to get to the parent path which would be /newkb   since .. is not allowed you can simply code the parent path in place of the .. and it should be resolved.  Since this is a script that you downloaded I belive, you may find that this type of issue happens throughout the code and will need to change it as appropriate throughout.

Neal.
0
 
darrenakinAuthor Commented:
Great that solved that problem, but now I am getting this error message;

Active Server Pages error 'ASP 0126'

Include file not found

/newkb/admin/Default.asp, line 2

The include file 'newkb/Connections/connDUfaqAdmin.asp' was not found.


THAT FILE IS REALLY THERE, I did have to go remove .. before the path
0
 
nschaferCommented:
make sure that you have

/newkb/Connections ....

not just

newkb/Connections ....
0
 
darrenakinAuthor Commented:
Active Server Pages error 'ASP 0130'

Invalid File attribute

/admin/Default.asp, line 2

File attribute '/newkb/Connections/connDUfaqAdmin.asp' cannot start with forward slash or back slash.
0
 
nschaferCommented:
Could you post the actual code from the page.
0
 
darrenakinAuthor Commented:
sure, and thank you so much for your help
0
 
darrenakinAuthor Commented:

<!--#include file="/newkb/Connections/connDUfaqAdmin.asp" -->
<% Response.Buffer = True %>
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Request.Form("id"))
If MM_valUsername <> "" Then
  MM_fldUserAuthorization=""
  MM_redirectLoginSuccess="questions.asp"
  MM_redirectLoginFailed="default.asp"
  MM_flag="ADODB.Recordset"
  set MM_rsUser = Server.CreateObject(MM_flag)
  MM_rsUser.ActiveConnection = MM_connDUfaq_STRING
  MM_rsUser.Source = "SELECT U_ID, U_PASSWORD"
  If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
  MM_rsUser.Source = MM_rsUser.Source & " FROM USERS WHERE U_ID='" & Replace(MM_valUsername,"'","''") &"' AND U_PASSWORD='" & Replace(Request.Form("password"),"'","''") & "'"
  MM_rsUser.CursorType = 0
  MM_rsUser.CursorLocation = 2
  MM_rsUser.LockType = 3
  MM_rsUser.Open
  If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
    ' username and password match - this is a valid user
    Session("MM_Username") = MM_valUsername
    If (MM_fldUserAuthorization <> "") Then
      Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
    Else
      Session("MM_UserAuthorization") = ""
    End If
    if CStr(Request.QueryString("accessdenied")) <> "" And true Then
      MM_redirectLoginSuccess = Request.QueryString("accessdenied")
    End If
    MM_rsUser.Close
    Response.Redirect(MM_redirectLoginSuccess)
  End If
  MM_rsUser.Close
  Response.Redirect(MM_redirectLoginFailed)
End If
%>
<html>
<head>
<title>admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="/assets/DUfaq.css" rel="stylesheet" type="text/css">
</head>
<body background="../assets/bg_main.gif" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bg>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" background="../assets/bground.gif">
  <tr>
    <td align="center" valign="middle"><table width="100%" height="300" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="2" align="left" valign="top" bgcolor="#000000"><img src="../assets/_spacer.gif" width="1" height="1"></td>
        </tr>
        <tr>
          <td align="center" valign="middle" bgcolor="#006699"><form name="form1" method="POST" action="<%=MM_LoginAction%>">
              <table border="0" cellspacing="4" cellpadding="4">
                <tr>
                  <td colspan="2" class="textBold"><font color="#FFFFFF" size="4"><strong>SPECTRUM
                    ADMIN PANEL</strong></font></td>
                </tr>
                <tr>
                  <td align="right" valign="middle" class="textBold"><font color="#FFFFFF">Admin
                    ID: </font></td>
                  <td><font color="#FFFFFF">
                    <input name="id" type="text" class="form" id="id" value="admin" size="20">
                    </font></td>
                </tr>
                <tr>
                  <td align="right" valign="middle" class="textBold"><font color="#FFFFFF">Password:
                    </font></td>
                  <td><font color="#FFFFFF">
                    <input name="password" type="password" class="form" id="password" size="20">
                    </font></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td> <input name="Submit" type="submit" class="form"  value="Login"></td>
                </tr>
              </table>
            </form></td>
        </tr>
        <tr>
          <td height="2" align="left" valign="top" bgcolor="#000000"><img src="../assets/_spacer.gif" width="1" height="1"></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>

0
 
darrenakinAuthor Commented:
We are getting so much closer, now I got this.

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] '(unknown)' 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.

/admin/Default.asp, line 15


Would you like for me to open a new question since you did answer the original question? I dont mind let me know.
0
 
darrenakinAuthor Commented:
here is line 15

 MM_rsUser.ActiveConnection = MM_connDUfaq_STRING
0
 
nschaferCommented:
OK, you need to look at the connDUfaqAdmin.asp code (at least I'm assuming that is where you will find what we need).  Look for the path to the MDB file (access database file).  Make sure that path is correct.

Neal.
0
 
darrenakinAuthor Commented:
I have 2 files in that Directory, the directory is Connections, 1st file name is connDUfaq.asp and here is that code;

<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
MM_connDUfaq_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("newkb\_private\DUfaq.mdb")
%>

2nd file is connDUfaqAdmin.asp, and here is that code.

<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
MM_connDUfaq_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("newkb\_private\DUfaq.mdb")
%>
0
 
darrenakinAuthor Commented:
here is the file that I do not have in my directory

' FileName="Connection_odbc_conn_dsn.htm"
0
 
nschaferCommented:
Try this:

MM_connDUfaq_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\newkb\_private\DUfaq.mdb")
0
 
darrenakinAuthor Commented:
Dont we need to add %> at the end of that statement? And also if I do add that %> I get

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt.

/admin/Default.asp, line 15
0
 
darrenakinAuthor Commented:
Let me please add another question, you have most certainly earned these points
0
 
darrenakinAuthor Commented:
I am closing this question, since you answered more than my question. GREAT JOB. I have opened a new question up here http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21926604.html Please help with this.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.