注册 登录
编程论坛 ASP技术论坛

寻求if 判断问题!

zhy328 发布于 2008-01-31 16:15, 540 次点击
<%set rs=server.createobject("adodb.recordset")                     
sql="select * from SMT_price order by SMT_id desc"
rs.open sql,conn,1,1     
set rs1=server.CreateObject("adodb.recordset")
sql="select * from SMT_member where SMT_company_id="& ypid
rs1.open sql,conn,1,1
%>
<td><%if rs1("SMT_comphone")="" then
response.write rs("SMT_phone")
else
response.write rs1("SMT_comphone")
end if%></td>
提示是错误类型:(0x80020009)发生意外
哪里出现问题了?
2 回复
#2
madpbpl2008-01-31 16:18
sql="select * from SMT_member where SMT_company_id="& ypid
rs1.open sql,conn,1,1
改成
sql1="select * from SMT_member where SMT_company_id="& ypid
rs1.open sql1,conn,1,1

<td><%if rs1("SMT_comphone")="" then
response.write rs("SMT_phone")
else
response.write rs1("SMT_comphone")
end if%></td>
改成
<td><%if isnull(rs1("SMT_comphone")) then
response.write rs("SMT_phone")
else
response.write rs1("SMT_comphone")
end if%></td>
#3
heyufu2008-01-31 17:31
支持楼上的
1