本地调试正常,怎么上传到服务器后就出现如下错误:Active Server Pages error 'ASP 0141'

fwy12 2010-10-17 08:20:14
本地调试正常,怎么上传到服务器后就出现如下错误:
Active Server Pages error 'ASP 0141'

Page Command Repeated

/silandn/Inc/conn.asp, line 1

The @ command can only be used once within the Active Server Page.

这是什么原因引起的啊,我在淘宝上买的空间

而我的conn.sp的代码是:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Config.asp"-->
<!--#include file="Function.asp"-->
<%
dim conn,connstr,db
dim admintable

tbname="Yao" '数据表前缀

db=SitePath&"data/"&DataName
on error resume next
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.Open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "<div style='margin:100px;font-size:14px;text-align:center'>数据库连接出错,请检查Inc/Config.Asp里的数据库名称及路径是否正确。</div>"
Response.End
End If

LaoYID=Request.Cookies("Yao")("ID")
LaoYName=Request.Cookies("Yao")("UserName")
LaoYPass=Request.Cookies("Yao")("UserPass")
If LaoYID<>"" and LaoYName<>"" and LaoYPass<>"" then
set rs4 = server.CreateObject ("adodb.recordset")
sql="select * from "&tbname&"_User where id="& LaoYRequest(LaoYID) &" and PassWord='"&CheckStr(LaoYPass)&"' and UserName='"&CheckStr(LaoYName)&"'"
on error resume next
rs4.open sql,conn,1,1
mymoney=rs4("UserMoney")
username=rs4("UserName")
dengjipic=rs4("dengjipic")
dengji=rs4("dengji")
UserPass=rs4("PassWord")
rs4.close
set rs4=nothing
If UserPass<>LaoYPass or username<>LaoYName Then
LaoYID=""
LaoYName=""
LaoYPass=""
Else
IsUser=1
End if
End if

Sub ShowAD(ID)
set rsad=conn.execute("select * from "&tbname&"_AD Where ID = "&ID&"")
If Not rsad.Eof Then
If rsad("yn")=1 then
Response.Write(laoy(rsad("Content")))
End if
End if
rsad.close
set rsad=nothing
End Sub

Sub Label(ID)
set rsLabel=conn.execute("select * from "&tbname&"_Label Where ID = "&ID&"")
If ID=2 then
Response.Write(" <li>P"&"o"&"w"&"e"&"r"&"e"&"d"&" b"&"y <b>"&sitetitle&"<b></li>"&rsLabel("Content")&"")
else
Response.Write(rsLabel("Content"))
End if
rsLabel.close
set rsLabel=nothing
End Sub
%>
...全文
344 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
fwy12 2010-10-18
  • 打赏
  • 举报
回复
我的代码中没有on error resume next 啊
atDebug 2010-10-17
  • 打赏
  • 举报
回复
把 conn.asp中的<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

去掉是是。可能还有其他文件重复了。
fwy12 2010-10-17
  • 打赏
  • 举报
回复
是啊,我发现我的只有conn.asp中有<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>,我出现这个错误的页面没有啊。出错的界面是用<!--#include file="../inc/conn.asp"-->的,所以只有一次啊

码农の视界 2010-10-17
  • 打赏
  • 举报
回复
@命令只能使用一次在Active Server Page中
quweiie 2010-10-17
  • 打赏
  • 举报
回复
如果页面里有 on error resume next 把它去掉。
fwy12 2010-10-17
  • 打赏
  • 举报
回复
可是我引用conn的文件并没有<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>。只有conn中才有的,怎么会重复呢?

atDebug 2010-10-17
  • 打赏
  • 举报
回复
conn.asp去掉那个@后,可以用这个来强制页面的编码

<%Session.CodePage=936%>

应该就没问题了。
孟子E章 2010-10-17
  • 打赏
  • 举报
回复
包含文件里已经使用了
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
这个声明。conn.asp里面的删除,到包含页面写即可


inde.aspx
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
fwy12 2010-10-17
  • 打赏
  • 举报
回复
把 conn.asp中的<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

去掉的话,很多汉字就都显示?了

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧