【发布时间】:2013-06-19 00:38:37
【问题描述】:
我将 iis 网站从 windows 2003 iis6 移至 2008 iis 7。由于某种原因,此 asp 代码停止工作。我启用了跟踪,这就是我得到的:
ErrorCode 800a000d 描述类型不匹配。
我在If broj > 0 Then 线上得到它。这是因为经典的 asp 不能在 IIS7 上工作吗?
<%
Dim cate, SQL, broj
cate = Request("cate")
SQL = "select count(*) as count from members where category_id = '" & cate & "' and status_flag <> 'NON-MEMBER' and status = 'APPROVED' order by company;"
rs.Open SQL,Con,adOpenKeyset,adLockOptimistic
broj = rs("count")
If broj > 0 Then // <-- this is the line where i get error ErrorCode 800a000d Description Type mismatch//
rs.close
rs.PageSize = 3
rs.CursorLocation = adUseClient
SQL = "select * from members where category_id = '" & cate & "' and status_flag <> 'NON-MEMBER' and status = 'APPROVED' order by company;"
rs.Open SQL,Con
datum = MonthName(Month(rs("last_updated"))) & " " & Day(rs("last_updated")) & ", " & Year(rs("last_updated"))
%>
【问题讨论】:
-
你试过'if cint(broj) > 0'
-
您对该代码的 SQL 注入持开放态度,您可能希望清理它,即使它是内部的。约翰上面的回答是正确的,无论出于何种原因,数据似乎都以字符串而不是 int 的形式返回。
标签: iis-7 asp-classic