?
Solved

ASP Not working correctly. Error 500

Posted on 2006-07-20
19
Medium Priority
?
485 Views
Last Modified: 2010-04-20
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.
0
Comment
Question by:darrenakin
  • 12
  • 7
19 Comments
 
LVL 19

Expert Comment

by:nschafer
ID: 17146532
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
 
LVL 5

Author Comment

by:darrenakin
ID: 17146823
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
 
LVL 19

Expert Comment

by:nschafer
ID: 17146911
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 5

Author Comment

by:darrenakin
ID: 17147738
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
 
LVL 19

Expert Comment

by:nschafer
ID: 17147937
make sure that you have

/newkb/Connections ....

not just

newkb/Connections ....
0
 
LVL 5

Author Comment

by:darrenakin
ID: 17148142
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
 
LVL 19

Expert Comment

by:nschafer
ID: 17148154
Could you post the actual code from the page.
0
 
LVL 5

Author Comment

by:darrenakin
ID: 17148192
sure, and thank you so much for your help
0
 
LVL 5

Author Comment

by:darrenakin
ID: 17148195

<!--#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
 
LVL 19

Accepted Solution

by:
nschafer earned 2000 total points
ID: 17148237
>>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
 
LVL 5

Author Comment

by:darrenakin
ID: 17148275
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
 
LVL 5

Author Comment

by:darrenakin
ID: 17148321
here is line 15

 MM_rsUser.ActiveConnection = MM_connDUfaq_STRING
0
 
LVL 19

Expert Comment

by:nschafer
ID: 17148351
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
 
LVL 5

Author Comment

by:darrenakin
ID: 17148415
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
 
LVL 5

Author Comment

by:darrenakin
ID: 17148424
here is the file that I do not have in my directory

' FileName="Connection_odbc_conn_dsn.htm"
0
 
LVL 19

Expert Comment

by:nschafer
ID: 17148677
Try this:

MM_connDUfaq_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\newkb\_private\DUfaq.mdb")
0
 
LVL 5

Author Comment

by:darrenakin
ID: 17149290
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
 
LVL 5

Author Comment

by:darrenakin
ID: 17149368
Let me please add another question, you have most certainly earned these points
0
 
LVL 5

Author Comment

by:darrenakin
ID: 17149712
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month17 days, 10 hours left to enroll

829 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