我将iis网站从Windows 2003 iis6移至2008 iis 7.出于某种原因,此代码停止工作。我启用了跟踪,这是我得到的:将asp网站从iis6移植到iis7 windows 2008
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"))
%>
你尝试过“如果cint(broj)> 0' – John
您可以使用该代码开放SQL注入,您可能需要清理它,即使它是内部的。 John的上述答案是正确的,无论出于何种原因,数据似乎都以字符串形式返回,而不是int形式。 – silver