当前位置:编程学习 > asp >>

读取字段的时候判断是否为空

答案: <%
if isnull(rs(字段名))=true or rs(字段名)="" then
    'true表示为空
else
    'false表示不为空
end if

if rs(字段名) is null or rs(字段名)="" then
    '表示为空
else
    '表示不为空
end if

if not rs(字段名) isnull or rs(字段名)<>"" then
    '表示不为空
else
    '表示为空
end if
%>

上一个:SQL数据库的连接方式
下一个:asp解压Zip文件(Wscript.Shell和Winzip command line;Java组件)

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,