Microsoft VBScript 运行时错误 错误 '800a000d'

Microsoft VBScript 运行时错误 错误 '800a000d'
类型不匹配: '[string: ""]'
/sichuanzt/admin/cp_mana.asp,行69
________________________________
以下是此文件部分内容(第60-89行内容)




亚博国际可靠吗亚博网亚博体育官方网页版 <%
ClassID = 0
if request("txtitle")<>"" then
sql="select * from Product Where namesv like '%"&trim(request("txtitle"))&"%' or content like '%"&trim(request("txtitle"))&"%' order by id desc"
elseif not(isnull(request("classid"))) and request("classid")<>0 then
classid=request("classid")
sql="select * from Product Where"
ClassIDz=split(men2(classid),",")
for i = 1 to ubound(ClassIDz)
If i = 1 then
sql = sql & " ClassID="&ClassIDz(i)&""
Else
sql = sql & " or ClassID="&ClassIDz(i)&""
End if
next
sql= sql & " order by ID desc"
else
sql="select * from Product order by ID desc"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
Set rs1= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then 楼下的,你改那里了???单纯的复制我的吧???????
二楼的你好,按你的要求改了之后出现以下
Microsoft VBScript 运行时错误 错误 '800a000d'
类型不匹配: 'CInt'
/admin/cp_mana.asp,行69
强制转化的话,还是起先这个错误

680 亚博体育官方网页版 10 回复
? classid ? if ? sql ? request ? then ?

回复

    恩恩 同上 同上上 同上上上

    李冷

    !

    林琰

    elseif not(isnull(request("classid"))) and cint(request("classid"))<>"0"then

    贺福江

    接不到值,或值为NULL

    石珴




    <%
    ClassID = 0
    if request("txtitle")<>"" then
    sql="select * from Product Where namesv like '%"&trim(request("txtitle"))&"%' or content like '%"&trim(request("txtitle"))&"%' order by id desc"
    elseif not(isnull(request("classid"))) and request("classid")<>0 then
    classid=request("classid")
    sql="select * from Product Where"
    ClassIDz=split(men2(classid),",")
    for i = 1 to ubound(ClassIDz)
    If i = 1 then
    sql = sql & " ClassID="&ClassIDz(i)&""
    Else
    sql = sql & " or ClassID="&ClassIDz(i)&""
    End if
    next
    sql= sql & " order by ID desc"
    else
    sql="select * from Product order by ID desc"
    end if
    Set rs= Server.CreateObject("ADODB.Recordset")
    Set rs1= Server.CreateObject("ADODB.Recordset")
    rs.open sql,conn,1,1
    if rs.eof and rs.bof then
    response.write "

    还 没 有 任 何 产 品

    "
    else
    totalPut=rs.recordcount
    if currentpage<1 then
    currentpage=1
    end if
    if (currentpage-1)*MaxPerPage>totalput then
    if (totalPut mod MaxPerPage)=0 then
    currentpage= totalPut \ MaxPerPage
    else
    currentpage= totalPut \ MaxPerPage + 1
    end if
    end if
    if currentPage=1 then
    showpage totalput,MaxPerPage,"cp_mana.asp"
    showContent
    showpage totalput,MaxPerPage,"cp_mana.asp"
    else
    if (currentPage-1)*MaxPerPage rs.move (currentPage-1)*MaxPerPage
    dim bookmark
    bookmark=rs.bookmark
    showpage totalput,MaxPerPage,"cp_mana.asp"
    showContent
    showpage totalput,MaxPerPage,"cp_mana.asp"
    else
    currentPage=1
    showpage totalput,MaxPerPage,"cp_mana.asp"
    showContent
    showpage totalput,MaxPerPage,"cp_mana.asp"
    end if
    end if
    rs.close
    end if
    set rs=nothing
    conn.close
    set conn=nothing
    sub showContent
    dim i
    i=0
    %>












    <%
    dim rsRev,sqlRev,NumberT
    set rsRev=server.createobject("adodb.recordset")%>
    <%do while not rs.eof%>
    <%ID=rs("ID")%>
    <%
    sqlRev = "select Product_ID from Product_Revert Where Product_ID="&rs("ID")
    rsRev.open sqlRev,conn,1,1
    NumberT=rsRev.recordcount
    rsRev.close
    %>








    <%
    i=i+1
    if i>=MaxPerPage then exit do
    rs.movenext
    loop
    %>
    修改删除管理
    ID 名称 产品规格 类别 留言


    <%=rs("ID")%>

    &ClassID=<%=rs("ClassID")%>" title="点击编辑"><%=rs("namesv")%>
    &ClassID=<%=rs("ClassID")%>" title="点击编辑"><%=rs("Model")%> ">
    <%Men(rs("classid"))%>
    &classid=<%=rs("classid")%>"><%=NumberT%>





    <%
    end sub
    Function men1(ClassID,up)
    Set rsz = conn.execute("select * from ProductClass Where LoID="&ClassID)
    If rsz.EOF And rsz.BOF Then
    Response.Write ""
    Else
    While Not rsz.EOF
    if classid=cstr(rsz("classid")) then
    sel="selected"
    else
    sel=""
    end if
    Vcd = ""
    For i = 1 to up
    if i = up then
    If Rsz("LoID")=0 then
    Vcd = "⊙" + Vcd
    Else
    Vcd = "┣" + Vcd
    End if
    Else
    Vcd = "━" + vcd
    End if
    Next
    If rsz("ClassName")="T" Then
    Dc = "T(铁质)"
    ElseIf rsz("ClassName")="C" Then
    Dc = "C(铸钢)"
    ElseIf rsz("ClassName")="P" Then
    Dc = "P(不锈钢)"
    ElseIf rsz("ClassName")="W" Then
    Dc = "W(铜质)"
    ElseIf rsz("ClassName")="K" Then
    Dc = "K(球墨铸铁)"
    Else
    Dc = rsz("ClassName")
    End if
    ChildCount = conn.Execute("select count(*) from ProductClass where LoID="&rsz("ClassID"))(0)
    response.write ""+chr(13)+chr(10)
    If ChildCount>0 Then
    men1 rsz("ClassID"),up+1
    End If
    rsz.movenext
    Wend
    End if
    rsz.Close:Set rsz=Nothing
    End Function
    Function Men(classid)
    set rsv=conn.execute("select * from ProductClass where classid="&classid)
    If rsv("LoID") <> 0 then Men(rsv("LoID"))
    Response.Write rsv("classname")
    rsv.close:set rsv=nothing
    End Function
    Function men2(ClassID)
    ZZ = ""
    Set rsz = conn.execute("select * from ProductClass Where LoID="&ClassID)
    If not(rsz.EOF And rsz.BOF) Then
    While Not rsz.EOF
    ZZ = ZZ & men2(rsz("ClassID"))
    rsz.movenext
    Wend
    End if
    men2 = ZZ & "," & ClassID
    rsz.Close:Set rsz=Nothing
    End Function
    function showpage(totalnumber,maxperpage,filename)
    dim n
    if totalnumber mod maxperpage=0 then
    n= totalnumber \ maxperpage
    else
    n= totalnumber \ maxperpage+1
    end if
    response.write "
    "
    if CurrentPage<2 then
    response.write "首页 上一页 "
    else
    response.write "首页 "
    response.write "上一页 "
    end if
    if n-currentpage<1 then
    response.write "下一页 尾页"
    else
    response.write ""
    response.write "下一页
    尾页"
    end if
    response.write " 页次:"&CurrentPage&"/"&n&" "
    response.write ""&totalnumber&""&maxperpage&"篇/页

    "
    end function
    sub deleteannounce(id)
    sql="delete from Product where ID="&cstr(id)
    conn.execute sql
    sql="delete from Product_Revert where Product_ID="&cstr(id)
    conn.execute sql
    if err.Number<>0 then
    err.clear
    response.write "删 除 失 败 !
    "
    else
    response.write "操作成功!
    "
    end if
    End sub
    %>







    ______________________
    楼下的,还是不行呢.晕
    回答者:zwb001
    万蓝


    这里small和input没有空格吗?

    程强

    大概看了一下,像:
    elseif not(isnull(request("classid"))) and request("classid")<>0 then
    这样的判断很容易出现问题,前面是判断是否为NULL,即还未初始化的变量,后面又是判断是否为数值类型.建议分两步走,这里大概看得出来是必须是数字,且不得等于0,可以用"IsNumeric"函数:
    Dim TmpInt
    TmpInt=Request.QueryString("classid")
    If IsNumeric(TmpInt) then
    if TmpInt>0 then
    '符合大于0的条件
    else
    '小于等于0
    end if
    else
    '非数字
    end if
    如果classid没有值传过来,则TmpInt会得到一个空的字符串值,这是一个字符串类型的变量,如果你判断是否不等于0或使用CINT进行数据类型转换就会出错。
    注:代码太多,没有真正看完,我个人认为,还是将判断的代码先分离,不要一开始就合在一起,容易产生问题。如果处理的过程都正常了,再考虑做一些优化。(这个仅针对初学者,高手的代码一般写得比较严谨。)

    蔡漩
  • 相关提问