登录后我收到此错误:Microsoft VBScript runtime error '800a004c' Path not found /ppi/files.asp, line 23
。
如何修复错误?见下文:
SQL = "SELECT * FROM [rapid_prod].[dbo].[PPI] WHERE [UserName] ='" & Request.Form("txtUserName") & "'"
rs.Open SQL, Conn
If NOT rs.EOF Then
If (Request.Form("txtUserPass")) = rs("Passwd") Then
Session("TopUrl") = rs("PPI_Dir")
Dim propertyname, propertydir
propertyname = rs("Property_Name")
propertydir = rs("PPI_Dir")
rs.Close
Set rs = Nothing
Conn.Close
Set Conn = Nothing
Response.Redirect "/ppi/files.asp?property="& propertyname &"&fold="& propertydir
End If
End If
关于上面的代码,我正在为重定向添加文件。这是下面的file.asp代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%
If Request.QueryString("fold")= "" then
'pthFolder="/ppi/"
Response.Write("<center><br><br><br>There was either an error with your request<br> Or Your session timed out.<br><br><a href='../ppi.asp'>Return to the login page.</a></center>")
Else
'pthFolder=pthFolder&"/ppi/"&Request.QueryString("fold")
'pthFolder="/ppi/"&Request.QueryString("fold")
sTopUrl = "files.asp?fold="&Session("TopUrl")
pthFolder= Request.QueryString("fold")
Set fso=Server.CreateObject("Scripting.FileSystemObject")
'get all required info
sParentFolder=fso.GetParentFolderName(pthFolder)
If sParentFolder="" then sParentFolder="/"
If left(sParentFolder,1)="/" or left(sParentFolder,1)="\" then sParentFolder=Mid(sParentFolder,2)
sBackURL="files.asp?fold="&sParentFolder
dim FolderSize
FolderSize=0
Set Folder=fso.GetFolder(Server.MapPath(pthFolder))
'correct the pthFolder variable if it starts with a slash
'we will not be using the mappath method anymore, so we can discard the slash
If left(pthFolder,1)="/" or left(pthFolder,1)="\" then pthFolder=Mid(pthFolder,2)
'now, if the folder name does not end with a slash, then add a slash
If len(pthFolder)>0 and right(pthFolder,1)<>"/" and right(pthFolder,1)<>"\" then _
pthFolder=pthFolder&"/"
%>
<HTML>
<HEAD>
<title>PPI</title>
<link href="ppi.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="./fancybox/jquery.mousewheel-3.0.2.pack.js"></script>
<script type="text/javascript" src="./fancybox/jquery.fancybox-1.3.1.js"></script>
<link rel="stylesheet" type="text/css" href="./fancybox/jquery.fancybox-1.3.1.css" media="screen" />
<link rel="stylesheet" href="style.css" />
<script type="text/javascript">
$(document).ready(function() {
$("a#example5").fancybox({
'titlePosition' : 'inside'
});
});
</script>
<script>
function newWindow(urlname)
{
var a=window.open(urlname,'winName',"top=100, left=100, width=680, height=520, scrollbars=no");
a.focus();
}
</script>
</HEAD>
<BODY>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" style="padding-bottom:20px;"><img src="img/banner.gif" width="760" height="133"></td>
</tr>
<tr>
<td valign="top">
<br><br>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="568"><span class="body1">Viewing for: <b><a href="<% =sTopURL %>&property=<% = Request.QueryString("property") %>">
<% = Request.QueryString("property") %>
</a> /
<% If Request.Querystring ("subprop") <> "" then %>
<% If Request.Querystring ("level") = "eof" then %>
<a href="<% =sBackURL %>&property=<% = Request.QueryString("property") %>&subprop=<% = Request.QueryString("subprop") %>">
<% = Request.QueryString("subprop") %>
</a>
<% Else %>
<% = Request.QueryString("subprop") %>
<% End If %>
<% End If %>
</b></span> </td>
<td width="82" align="right"><a href="../ppi.asp?logout=true">Logout</a></td>
</tr>
</table>
<br>
<% If Request.Querystring ("level") = "eof" then %>
<br>
<table width="720" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="347" class="body1">Vehicles for <b><% = Request.QueryString("month") %></b></td>
<td width="168" align="right"> </td>
</tr>
<tr>
<td colspan="2"><span class="smallprint">Click on thumbnail for larger view</span> <br>
<hr> </td>
</tr>
</table>
<%
' ---------------- START FILE VIEW -------------------------------
Dim ImagePath
ImagePath = Request.QueryString("fold")
Response.write "<table width=""680"" align=""center"" border=""0"">"
'iColumnSpan is used as a column counter
iColumnSpan=0
response.write "<tr>"
'If there are records then loop through the fields AND iColumnSpan <= IntPageSize
for each item in Folder.files
If iColumnSpan=4 Then
response.write "</tr><tr>"
iColumnSpan=0
End If
response.write "<td valign='top'>"
%>
<a id="example5" href="<%=ImagePath%>/<%=item.Name%>" title="<%=item.Name%>"><img src="<%=ImagePath%>/<%=item.Name%>" alt="Click To Enlarge" border="0" height="113" width="150" class="img"></a>
<!--<a href="javascript:newWindow('<%=ImagePath%>/<%=item.Name%>')"> <img src="<%=ImagePath%>/<%=item.Name%>" alt="Click To Enlarge" border="0" height="113" width="150" class="img"></a>--><br>
<span class="smallprint" style="padding-left:11px; display:block;"><%=item.Name%></span>
<br><br><br>
<%
response.write "</td>"
iColumnSpan=iColumnSpan + 1
next
response.write "</tr>"
Response.write "</table><br>"
' ---------------- END IMAGE VIEW -------------------------------
%>
<center><br><br></center>
<%
Else
' ---------------- START FOLDER VIEW ------------------------------- %>
<br>
<table width="680" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="247"><em>Folder</em></td>
<td width="303"><em>Last Modified</em></td>
</tr>
<tr>
<td colspan="2"><hr size=1></td>
</tr>
</table>
<table width="680" border="0" align="center" cellpadding="2" cellspacing="5" class="body1">
<tr valign="top">
<%
for each item in Folder.SubFolders
If right(item.Name,2) > "12" then
DirLabel = item.Name
SubProperty = item.Name
Else
FolderView = "eof"
SubProperty = Request.QueryString("subprop")
If right(item.Name,2) = "01" then DirLabel = "January " & left(item.Name,2) End If
If right(item.Name,2) = "02" then DirLabel = "February " & left(item.Name,2) End If
If right(item.Name,2) = "03" then DirLabel = "March " & left(item.Name,2) End If
If right(item.Name,2) = "04" then DirLabel = "April " & left(item.Name,2) End If
If right(item.Name,2) = "05" then DirLabel = "May " & left(item.Name,2) End If
If right(item.Name,2) = "06" then DirLabel = "June " & left(item.Name,2) End If
If right(item.Name,2) = "07" then DirLabel = "July " & left(item.Name,2) End If
If right(item.Name,2) = "08" then DirLabel = "August " & left(item.Name,2) End If
If right(item.Name,2) = "09" then DirLabel = "September " & left(item.Name,2) End If
If right(item.Name,2) = "10" then DirLabel = "October " & left(item.Name,2) End If
If right(item.Name,2) = "11" then DirLabel = "November " & left(item.Name,2) End If
If right(item.Name,2) = "12" then DirLabel = "December " & left(item.Name,2) End If
End If
%>
<td width="20" align="center"><img src="img/folder.gif" width="16" height="13"></td>
<td width="211"><a href="files.asp?month=<%=DirLabel%>&level=<%=FolderView%>&property=<% = Request.QueryString("property") %>&subprop=<%=SubProperty%>&fold=<%=pthFolder%><%=item.Name%>"><%=DirLabel%></a></td>
<td width="308"><span class="smallprint"><%=item.DateLastModified%></span></td>
</tr>
<% Next %>
</table>
<br><br><br><br><br><br><br><br><br><br><br><br>
<%' ---------------- END FOLDER VIEW -------------------------------%>
<% End If %>
<br> </td>
</tr>
<tr>
<td align="center" valign="top"><br> </td>
</tr>
</table>
<br>
<%
function fit(text,length)
'function to make text fit a given length, so that it does not overflow the cell width.
If len(text)>(length-3) then
text=left(text,(length-3))
text=text&"..."
fit=text
else
fit=text
end if
end function
%>
</BODY>
</HTML>
<% End If %>
答案 0 :(得分:0)
应该&#39; **&#39;在你的重定向网址? 可能真的需要更多的信息,但问题可能发生在这个重定向到的脚本中。