求救高手:server.HTMLEncode出错怎么办???

rxr 2000-04-17 02:51:00
在做BBS时,有时会出现以下提示:
“Microsoft VBScript 运行时错误 错误 '800a000d'
类型不匹配: 'server.HTMLEncode'”
查找半天,也没有找到原因。求救!!!!

...全文
177 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
King 2000-04-20
  • 打赏
  • 举报
回复
把代码贴出来,并把你输入的数据也一并贴出来,有时候不一定是代码出错的
rxr 2000-04-20
  • 打赏
  • 举报
回复
我的原代码为:
<%
m = TRIM( Request( "messageId" ) )
ord=TRIM(Request("ordernum"))

if m="" then
sql="select m_id,m_subject from bbs where m_reply=0 and m_ordernum='"&ord&"'"
Set RS1 = Server.CreateObject( "ADODB.RecordSet" )
RS1.Open sql,cn
while not RS1.EOF
m=RS1("m_id")
RS1.MoveNext
wend
end if

MySQL = "select * from bbs where m_id='"&m&"'"
Set RS = Server.CreateObject( "ADODB.RecordSet" )
RS.Open MySQL, Cn, adOpenStatic
%>
<html>
<head><title>Message</title></head>
<body bgcolor="#FFFFED">
<% while not rs.EOF %>
<table width="780" bgcolor="#c0c0c0" cellspacing=0 cellpadding=2 border=0>
*******
<% if rs("m_reply")=1 then%>
<tr bgcolor="#FFCCCC">
<td colspan=2> <small><b>主题:</b> <i><%=RS( "m_subject" )%></i></small> </td>
</tr>
<% end if %>
**********
<tr bgcolor="#FFCCCC">
<td width="314"><small><b>作者:</b> <i><%=RS( "m_username" )%></i></small></td>
<td width="458"><small><b>Email地址:</b> <i><%=RS("m_email")%></i></small></td>
</tr>
<tr bgcolor="#FFCCCC">
<td colspan=2> <small><b>主题:</b> <i><%=RS( "m_subject" )%></i></small> </td>
</tr>
<tr bgcolor="#FFEBE1">
<td colspan=2>
<pre><%=Server.HTMLEncode( RS("m_message"))%></pre>
</td>
</tr>
</table>
<%
RS.MoveNext
wend
%>

</body>
</html>
如去掉*****之间的内容,Server.HTMLEncode会报“类型不匹配的错误”,实在找不出原因。


SQL数据库表为:
CREATE TABLE [dbo].[bbs] (
[m_id] [int] IDENTITY (1, 1) NOT NULL ,
[m_subject] [varchar] (30) NOT NULL ,
[m_username] [varchar] (30) NOT NULL ,
[m_email] [varchar] (70) NOT NULL ,
[m_entrydate] [datetime] NOT NULL default getdate(),
[m_message] [text] NULL ,
[m_ordernum] [int] NULL ,
[m_reply] [bit] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
蝈蝈俊 2000-04-17
  • 打赏
  • 举报
回复
server.HTMLEncode(str)
传进去的是否为字符串???
这一段代码贴出来让我们看看。

28,390

社区成员

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

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