ASP问题错误显示问题

来源:百度知道 编辑:UC知道 时间:2024/06/18 03:49:38
if webtype="" then
set rs=hx.Execute(sql)
elseif webtype>0 then
condition = condition & " and webtype="&webtype
end if

我想这个webtype=""等于空的时候输出这个set rs=hx.Execute(sql)错误
但是等于0的时候不输出这个错误而是
Microsoft VBScript 运行时错误 '800a000d'

类型不匹配: '[string: ""]'

\list.asp, line 78
Public Function Execute(Command)
If Not IsObject(Conn) Then ConnectionDatabase
On Error Resume Next
Set Execute = Conn.Execute(Command)
If Err Then
If IsDeBug = 1 Then
Response.Write "你执行的语句是:" & Command
Response.Write "<BR>错误信息为:" & Err.description
Else
Response.Write "查询数据的时候发现错误,请检查您的查询代码是否正确。"
End If
Err.Clear
CloseDatabase
Response.End
End If

未知你是否使用变量强制声明,

1、如果有,使用Str(webtype)转换

2、" and webtype="&webtype 改成" and webtype=" & webtype ,

我以前试过,用DW写程序时,&号和后面的变量没有空格分开,会出错。