28,391
社区成员
发帖
与我相关
我的任务
分享
function getrow(area)
rowsqlstr="select d_coding,d_name from hydepart h where len(d_coding)=6 and isdzx='"&area&"' "
rowsqlstr=rowsqlstr+"and d_coding in (select left(d_coding,6) from hydepart where len(d_coding)>6 "
rowsqlstr=rowsqlstr+"and d_coding in (select pb_dep from purchasebill where pb_flag=1))"
set rowRs=server.CreateObject("adodb.recordset")
rowRs.Open rowsqlstr,conn,3
If not rowRs.EOF then
RTT=rowRs.RecordCount
else
RTT=0
end if
getrow=RTT
rowRs.Close
set rowRs=nothing
end function
<%
getrow("东")
%>
上面是自己写的方法,用来读行数
下面调用,很简单的
可是为什么就是报“类型不匹配”呢?
找不到问题所在啊,所以来请教大家咯!
function getrow(area)
rowsqlstr="select d_coding,d_name from hydepart h where len(d_coding)=6 and isdzx='" & area & "' "
rowsqlstr=rowsqlstr & "and d_coding in (select left(d_coding,6) from hydepart where len(d_coding)>6 "
rowsqlstr=rowsqlstr & "and d_coding in (select pb_dep from purchasebill where pb_flag=1))"
set rowRs=server.CreateObject("adodb.recordset")
rowRs.CursorLocation = 3
rowRs.Open rowsqlstr,conn,1,1
If not (rowRs.EOF AND rowRs.BOF) then
RTT = rowRs.RecordCount
else
RTT = 0
end if
getrow=RTT
rowRs.Close
set rowRs=nothing
end function