我使用以下代码从数据库中检索值:
if( !rs.bof ){
rs.MoveFirst();
while ( !rs.eof ){
output.innerHTML += rs.fields( "Name" ) + ","
output.innerHTML += rs.fields( "Address" ) + "<br>"
rs.MoveNext();
}
}
但是如果地址为空,那么它会写:
Sherlock Holmes, 221B Baker Street
James Moriarty, null
我试过使用:
if( rs.fields( "Address" ) != null && rs.fields( "Address" ) != "" )
我应该怎么做才能使空值显示为空字符串?