类型不匹配(高手请进)
我想通过BoardName从数据库取BoardID的值,但网页出现如下错误:错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配
/bbs/Archive_view.asp, 第 17 行
<!--#include file="inc.asp"-->
<!--#include file="inc/ubb_Cls.asp"-->
<%
If Not BBS94KK.Founduser then
BBS94KK.GoToErr(10)
End If
Dim Rs,SQL,TopicCaption,UserName,SqlAdd
Dim BBS94KK_ubb,ID
Dim rootid,topic,postbuyuser,bgcolor,EmotPath
SqlAdd=" WHERE boardid not in(12)" '禁止列出这个版面
ID=BBS94KK.CheckNum(request.querystring("ID"))
IF BBS94KK.BoardID=0 or Id=0 or BBS94KK.TB=0 or not BBS94KK.Fun.isInteger(BBS94KK.BoardID) then BBS94KK.GoToErr(1)
Set BBS94KK_ubb=New BBS94KKubb_Cls
Dim Tempwrite,Templist,BoardName,BoardID
BoardName=Request("BoardName")
sql="select BoardID from KK_Board where BoardName="&BoardName&""
BoardID=rs("BoardID")
Tempwrite="<div class=pagebody><div id=navbar><a href={$forumurl}Archive_index.asp>{$forumname}</a> >> <a href={$forumurl}Archive_index.asp?boardid={$boardid}&BoardType=&BoardName={$boardname}>{$boardname}</a></div><p class=largefont>查看完全版本: <a href={$forumurl}Show.asp?boardid={$boardid}&id={$announceid}&TB={$TB}>{$topic}</a></p>{$bbslist}<div id=copyright>"&BBS94KK.Info(0)&"文档集 <a href="&BBS94KK.Info(1)&">"&BBS94KK.Info(0)&"</a></div></div>"
Tempwrite=Replace(Tempwrite,"{$forumname}",BBS94KK.Info(0))
Tempwrite=Replace(Tempwrite,"{$forumurl}","")
Tempwrite=Replace(Tempwrite,"{$boardid}",BBS94KK.BoardID)
Tempwrite=Replace(Tempwrite,"{$boardname}",server.htmlencode(Request("BoardName")))
Tempwrite=Replace(Tempwrite,"{$announceid}",Id)
Tempwrite=Replace(Tempwrite,"{$TB}",BBS94KK.TB)
Sql="Select Name,Caption,Content,Addtime,UbbString From [KK_Bbs"&BBS94KK.TB&"] "&SQlAdd&" and (TopicID="&ID&" Or ReplyTopicID="&ID&") And BoardID="&BBS94KK.BoardID&" and IsDel=0 Order by BBSid"
Set Rs=BBS94KK.Execute(Sql)
If Rs.Eof And Rs.Bof Then
BBS94KK.GoToErr(11)
Else
topic=Rs("Caption")
Tempwrite=Replace(Tempwrite,"{$topic}",BBS94KK.Fun.HtmlCode(Rs("Caption")))
Do While Not Rs.Eof
BBS94KK_ubb.UbbString=Rs("UbbString")
Templist=Templist&"<div class=post><div class=username id=u1><b> 作者: "&Rs("Name")&"</b></div><div class=posttext id=p1><i>"&Rs("Addtime")&"</i><br>"&BBS94KK_ubb.UBB(Rs("Content"),1)&"</div></div>"
Rs.movenext
loop
Tempwrite=Replace(Tempwrite,"{$bbslist}",Templist)
%>
<html>
<head>
<title><%=BBS94KK.Info(0)&" - "&server.HtmlEncode(Topic)%></title>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" >
<link rel="stylesheet" href="archive.css">
</head>
<body>
<%Response.write Tempwrite
End if
Set BBS94KK=Nothing
%>
<br><br>
</body></html><%
Function SimJsReplace(str)
If IsNull(str) Or str="" Then Exit Function
str=Replace(str,"\","\\")
str=Replace(str,"'","\'")
SimJsReplace=str
End Function
%>
<%
Response.write ""&BoardID&""
%>
<!--#include file="inc/ubb_Cls.asp"-->
<%
If Not BBS94KK.Founduser then
BBS94KK.GoToErr(10)
End If
Dim Rs,SQL,TopicCaption,UserName,SqlAdd
Dim BBS94KK_ubb,ID
Dim rootid,topic,postbuyuser,bgcolor,EmotPath
SqlAdd=" WHERE boardid not in(12)" '禁止列出这个版面
ID=BBS94KK.CheckNum(request.querystring("ID"))
IF BBS94KK.BoardID=0 or Id=0 or BBS94KK.TB=0 or not BBS94KK.Fun.isInteger(BBS94KK.BoardID) then BBS94KK.GoToErr(1)
Set BBS94KK_ubb=New BBS94KKubb_Cls
Dim Tempwrite,Templist,BoardName,BoardID
BoardName=Request("BoardName")
sql="select BoardID from KK_Board where BoardName="&BoardName&""
BoardID=rs("BoardID")
Tempwrite="<div class=pagebody><div id=navbar><a href={$forumurl}Archive_index.asp>{$forumname}</a> >> <a href={$forumurl}Archive_index.asp?boardid={$boardid}&BoardType=&BoardName={$boardname}>{$boardname}</a></div><p class=largefont>查看完全版本: <a href={$forumurl}Show.asp?boardid={$boardid}&id={$announceid}&TB={$TB}>{$topic}</a></p>{$bbslist}<div id=copyright>"&BBS94KK.Info(0)&"文档集 <a href="&BBS94KK.Info(1)&">"&BBS94KK.Info(0)&"</a></div></div>"
Tempwrite=Replace(Tempwrite,"{$forumname}",BBS94KK.Info(0))
Tempwrite=Replace(Tempwrite,"{$forumurl}","")
Tempwrite=Replace(Tempwrite,"{$boardid}",BBS94KK.BoardID)
Tempwrite=Replace(Tempwrite,"{$boardname}",server.htmlencode(Request("BoardName")))
Tempwrite=Replace(Tempwrite,"{$announceid}",Id)
Tempwrite=Replace(Tempwrite,"{$TB}",BBS94KK.TB)
Sql="Select Name,Caption,Content,Addtime,UbbString From [KK_Bbs"&BBS94KK.TB&"] "&SQlAdd&" and (TopicID="&ID&" Or ReplyTopicID="&ID&") And BoardID="&BBS94KK.BoardID&" and IsDel=0 Order by BBSid"
Set Rs=BBS94KK.Execute(Sql)
If Rs.Eof And Rs.Bof Then
BBS94KK.GoToErr(11)
Else
topic=Rs("Caption")
Tempwrite=Replace(Tempwrite,"{$topic}",BBS94KK.Fun.HtmlCode(Rs("Caption")))
Do While Not Rs.Eof
BBS94KK_ubb.UbbString=Rs("UbbString")
Templist=Templist&"<div class=post><div class=username id=u1><b> 作者: "&Rs("Name")&"</b></div><div class=posttext id=p1><i>"&Rs("Addtime")&"</i><br>"&BBS94KK_ubb.UBB(Rs("Content"),1)&"</div></div>"
Rs.movenext
loop
Tempwrite=Replace(Tempwrite,"{$bbslist}",Templist)
%>
<html>
<head>
<title><%=BBS94KK.Info(0)&" - "&server.HtmlEncode(Topic)%></title>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" >
<link rel="stylesheet" href="archive.css">
</head>
<body>
<%Response.write Tempwrite
End if
Set BBS94KK=Nothing
%>
<br><br>
</body></html><%
Function SimJsReplace(str)
If IsNull(str) Or str="" Then Exit Function
str=Replace(str,"\","\\")
str=Replace(str,"'","\'")
SimJsReplace=str
End Function
%>
<%
Response.write ""&BoardID&""
%>
[[italic] 本帖最后由 thbwn 于 2008-1-22 09:07 编辑 [/italic]]