菜鸟求救!!!!!asp:必须为 MapPath 方法指定路径参数。 ( 积分: 100 )

  • 主题发起人 主题发起人 lmjgb
  • 开始时间 开始时间
L

lmjgb

Unregistered / Unconfirmed
GUEST, unregistred user!
菜鸟求救!!!!!asp:必须为 MapPath 方法指定路径参数。
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
Server.MapPath() 错误 'ASP 0171 : 80004005'
缺少路径
/yyw/createpage.asp,行44
必须为 MapPath 方法指定路径参数。
想把HTM文件放在/yyw/LN目录下。请各位帮帮忙,给出代码,以及加入位置。附原码如下:
<%@LANGUAGE=&quot;VBSCRIPT&quot;
CODEPAGE=&quot;936&quot;%>
<!--#include file=&quot;Connections/conn.asp&quot;
-->
<%
Dim Rs5__MMColParam
Rs5__MMColParam =&quot;2005-12-15&quot;
If (Request.Form(&quot;shijian&quot;) <> &quot;&quot;) then

Rs5__MMColParam = Request.Form(&quot;shijian&quot;)
End If
%>
<%
Dim Rs5
Dim Rs5_numRows
Set Rs5 = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Rs5.ActiveConnection = MM_conn_STRING
Rs5.Source = &quot;SELECT * FROM news WHERE shijian =#&quot;
+ Replace(Rs5__MMColParam, &quot;'&quot;, &quot;''&quot;) + &quot;#&quot;
Rs5.CursorType = 0
Rs5.CursorLocation = 2
Rs5.LockType = 1
Rs5.Open()
Rs5_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Rs5_numRows = Rs5_numRows + Repeat1__numRows
%>
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&quot;http://www.w3.org/TR/html4/loose.dtd&quot;
>
<html>
<head>
<meta http-equiv=&quot;Content-Type&quot;
content=&quot;text/html;
charset=gb2312&quot;>
<title>生成静态网页</title>
</head>
<body>
<%
Strfolder = Request.Form(&quot;shijian&quot;)
set fso=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)

set folder = objfso.CreateFolder(Server.mappath(Strfolder))

dim Rs5_total
Rs5_total = 1
%>
<%
While ((Repeat1__numRows <> 0) AND (NOT Rs5.EOF))
%>
<%
Dim StrTitle
StrTitle = Rs5.Fields.Item(&quot;biaoti&quot;).value
set objectfile=fso.CreateTextFile(Server.mappath(Strfolder&amp;&quot;/&quot;&amp;Strfolder&amp;&quot;-&quot;&amp;Rs5.Fields.Item(&quot;newsid&quot;).value&amp;&quot;.htm&quot;),true)
objectfile.write &quot;<html>&quot;&amp;vbcrlf&amp;&quot;<head>&quot;&amp;vbcrlf
objectfile.write &quot;<meta http-equiv='content-type' content='text/html;
charset=gb2312'>&quot;&amp;vbcrlf
objectfile.write &quot;<title>&quot;&amp;StrTitle&amp;&quot;</title>&quot;&amp;vbcrlf
objectfile.write &quot;</head>&quot;&amp;vbcrlf
objectfile.write &quot;<body bgcolor=#FFFFFF>&quot;&amp;vbcrlf
objectfile.write &quot;<center>&quot;&amp;vbcrlf&amp;&quot;<table width=560 border=0 cellspacing=0 cellpadding=0 bgcolor='#FFFFCC'>&quot;&amp;vbcrlf
objectfile.write &quot;<tr><th class=f24><font color=#05006C><h1 style='font-size:14px'>&quot;&amp;StrTitle&amp;&quot;</h1></font></th></tr>&quot;&amp;vbcrlf
objectfile.write &quot;<tr><td height=><hr size=1 bgcolor=#d9d9d9></td></tr>&quot;&amp;vbcrlf
objectfile.write &quot;<tr><td height=20 align=center style='font-size:14px;color:red'>&quot;&amp;Rs5.Fields.Item(&quot;shijian&quot;).value&amp;&quot;</td></tr>&quot;&amp;vbcrlf
objectfile.write &quot;<tr><td height=15></td></tr>&quot;&amp;vbcrlf
objectfile.write &quot;<tr><td><font style='font-size:12px'>&quot;&amp;Rs5.Fields.Item(&quot;neiwen&quot;).value&amp;&quot;</font></td></tr>&quot;&amp;vbcrlf
objectfile.write &quot;<tr height=10><td></td></tr>&quot;&amp;vbcrlf
objectfile.write &quot;</table>&quot;&amp;vbcrlf&amp;&quot;</center>&quot;&amp;vbcrlf&amp;&quot;</body>&quot;&amp;vbcrlf&amp;&quot;</html>&quot;
objectfile.close
set objectfile=nothing
Rs5_total= Rs5_total + 1
%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Rs5.MoveNext()
Wend
%>
<% set fso=nothing
Response.Write (&quot;<center>生成了&quot;&amp;Rs5_total&amp;&quot;个网页!<br>&quot;)
Response.Write (&quot;单击<a href='newsmanager.asp'>返回</a>到管理主页面</center>&quot;)
%>
</body>
</html>
<%
Rs5.Close()
Set Rs5 = Nothing
%>
 
菜鸟求救!!!!!asp:必须为 MapPath 方法指定路径参数。
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
Server.MapPath() 错误 'ASP 0171 : 80004005'
缺少路径
/yyw/createpage.asp,行44
必须为 MapPath 方法指定路径参数。
想把HTM文件放在/yyw/LN目录下。请各位帮帮忙,给出代码,以及加入位置。附原码如下:
<%@LANGUAGE=&quot;VBSCRIPT&quot;
CODEPAGE=&quot;936&quot;%>
<!--#include file=&quot;Connections/conn.asp&quot;
-->
<%
Dim Rs5__MMColParam
Rs5__MMColParam =&quot;2005-12-15&quot;
If (Request.Form(&quot;shijian&quot;) <> &quot;&quot;) then

Rs5__MMColParam = Request.Form(&quot;shijian&quot;)
End If
%>
<%
Dim Rs5
Dim Rs5_numRows
Set Rs5 = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Rs5.ActiveConnection = MM_conn_STRING
Rs5.Source = &quot;SELECT * FROM news WHERE shijian =#&quot;
+ Replace(Rs5__MMColParam, &quot;'&quot;, &quot;''&quot;) + &quot;#&quot;
Rs5.CursorType = 0
Rs5.CursorLocation = 2
Rs5.LockType = 1
Rs5.Open()
Rs5_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Rs5_numRows = Rs5_numRows + Repeat1__numRows
%>
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&quot;http://www.w3.org/TR/html4/loose.dtd&quot;
>
<html>
<head>
<meta http-equiv=&quot;Content-Type&quot;
content=&quot;text/html;
charset=gb2312&quot;>
<title>生成静态网页</title>
</head>
<body>
<%
Strfolder = Request.Form(&quot;shijian&quot;)
set fso=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)

set folder = objfso.CreateFolder(Server.mappath(Strfolder))

dim Rs5_total
Rs5_total = 1
%>
<%
While ((Repeat1__numRows <> 0) AND (NOT Rs5.EOF))
%>
<%
Dim StrTitle
StrTitle = Rs5.Fields.Item(&quot;biaoti&quot;).value
set objectfile=fso.CreateTextFile(Server.mappath(Strfolder&amp;&quot;/&quot;&amp;Strfolder&amp;&quot;-&quot;&amp;Rs5.Fields.Item(&quot;newsid&quot;).value&amp;&quot;.htm&quot;),true)
objectfile.write &quot;<html>&quot;&amp;vbcrlf&amp;&quot;<head>&quot;&amp;vbcrlf
objectfile.write &quot;<meta http-equiv='content-type' content='text/html;
charset=gb2312'>&quot;&amp;vbcrlf
objectfile.write &quot;<title>&quot;&amp;StrTitle&amp;&quot;</title>&quot;&amp;vbcrlf
objectfile.write &quot;</head>&quot;&amp;vbcrlf
objectfile.write &quot;<body bgcolor=#FFFFFF>&quot;&amp;vbcrlf
objectfile.write &quot;<center>&quot;&amp;vbcrlf&amp;&quot;<table width=560 border=0 cellspacing=0 cellpadding=0 bgcolor='#FFFFCC'>&quot;&amp;vbcrlf
objectfile.write &quot;<tr><th class=f24><font color=#05006C><h1 style='font-size:14px'>&quot;&amp;StrTitle&amp;&quot;</h1></font></th></tr>&quot;&amp;vbcrlf
objectfile.write &quot;<tr><td height=><hr size=1 bgcolor=#d9d9d9></td></tr>&quot;&amp;vbcrlf
objectfile.write &quot;<tr><td height=20 align=center style='font-size:14px;color:red'>&quot;&amp;Rs5.Fields.Item(&quot;shijian&quot;).value&amp;&quot;</td></tr>&quot;&amp;vbcrlf
objectfile.write &quot;<tr><td height=15></td></tr>&quot;&amp;vbcrlf
objectfile.write &quot;<tr><td><font style='font-size:12px'>&quot;&amp;Rs5.Fields.Item(&quot;neiwen&quot;).value&amp;&quot;</font></td></tr>&quot;&amp;vbcrlf
objectfile.write &quot;<tr height=10><td></td></tr>&quot;&amp;vbcrlf
objectfile.write &quot;</table>&quot;&amp;vbcrlf&amp;&quot;</center>&quot;&amp;vbcrlf&amp;&quot;</body>&quot;&amp;vbcrlf&amp;&quot;</html>&quot;
objectfile.close
set objectfile=nothing
Rs5_total= Rs5_total + 1
%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Rs5.MoveNext()
Wend
%>
<% set fso=nothing
Response.Write (&quot;<center>生成了&quot;&amp;Rs5_total&amp;&quot;个网页!<br>&quot;)
Response.Write (&quot;单击<a href='newsmanager.asp'>返回</a>到管理主页面</center>&quot;)
%>
</body>
</html>
<%
Rs5.Close()
Set Rs5 = Nothing
%>
 
很明显了
你的Server.mappath(Strfolder)参数不对
建议在
Strfolder = Request.Form(&quot;shijian&quot;)后加入一行
Response.Write(Strfolder)看看Strfolder取到值没有
 
能取到值。
就是不能自动建立相应目录。
还请唉!!!和大富翁们帮帮忙。
 
后退
顶部