| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2528 人关注过本帖
标题:类型不匹配(高手请进)
取消只看楼主 加入收藏
thbwn
Rank: 1
等 级:新手上路
帖 子:235
专家分:0
注 册:2007-10-2
结帖率:80%
收藏
 问题点数:0 回复次数:4 
类型不匹配(高手请进)
我想通过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&""
%>


[[italic] 本帖最后由 thbwn 于 2008-1-22 09:07 编辑 [/italic]]
搜索更多相关主题的帖子: 类型 
2008-01-22 09:06
thbwn
Rank: 1
等 级:新手上路
帖 子:235
专家分:0
注 册:2007-10-2
收藏
得分:0 
问题依然存在
错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配
/bbs/Archive_view.asp, 第 17 行

17行代码是:
BoardID=rs("BoardID")

[[italic] 本帖最后由 thbwn 于 2008-1-22 11:14 编辑 [/italic]]

          人人为我,我为人人!
2008-01-22 11:12
thbwn
Rank: 1
等 级:新手上路
帖 子:235
专家分:0
注 册:2007-10-2
收藏
得分:0 
加后出现新情况
BoardName=Request("BoardName")
    sql="select BoardID from KK_Board where BoardName="&BoardName&""
    rs.open sql,conn,1,1   '17行
    BoardID=rs("BoardID")   

错误提示:
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: ''
/bbs/Archive_view.asp, 第 17 行

[[italic] 本帖最后由 thbwn 于 2008-1-22 12:02 编辑 [/italic]]

          人人为我,我为人人!
2008-01-22 12:00
thbwn
Rank: 1
等 级:新手上路
帖 子:235
专家分:0
注 册:2007-10-2
收藏
得分:0 
连接文件不缺:<!--#include file="inc.asp"-->


错误提示:
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: ''
/bbs/Archive_view.asp, 第 17 行

          人人为我,我为人人!
2008-01-22 15:22
thbwn
Rank: 1
等 级:新手上路
帖 子:235
专家分:0
注 册:2007-10-2
收藏
得分:0 
相关文件代码,供高手参考!
inc.asp代码:

<!-- #include File="Conn.asp" -->
<!-- #include File="Inc/94kk_Cls.asp" -->
<!-- #include File="Inc/Fun_Cls.asp" -->
<%
Dim BBS94KK
Set BBS94KK = New Cls_94KK
BBS94KK.Config()
'If Instr(BBS94KK.BbsURL,"admin_")=0 Then
BBS94KK.CheckUser()
%>


conn.asp代码:
<%@LANGUAGE="VBSCRIPT"%>
<%
Option Explicit
Response.Buffer = True
'Session.CodePage=936
Const Timeset=0 '时区相对东八区(北京时间)
Dim Conn,StartTime,PageUrl,CacheName
StartTime = Timer()
PageURL=Lcase(Request.ServerVariables("URL"))
CacheName="94KK"&Replace(left(PageURL,instrRev(PageURL,"/")),"/","")
Sub ConnectionDatabase
    Dim Db,ConnStr
    on error resume next
    '======================
    Db="Data/94kk.asp"     '修改双引号里面数据库名称
    '======================
    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 "数据连接错误!"
        Response.End
    End If
End Sub
%>

          人人为我,我为人人!
2008-01-23 08:08
快速回复:类型不匹配(高手请进)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028671 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved