例如:
set rs=conn("update tb_name set x='"&name&"',y='"&email&"' where id=" & id)
如果name 、email不是空的时候一切正常,如有一为空,马上报错;
还有当更新某直为空时,("update tb set x='' where id="&id )也会出错。这是为什么啊?
help me!
例如: set rs=conn("update tb_name set x='"&name&"',y='"&email&"' where id=" & id) 如果name 、email不是空的时候一切正常,如有一为空,马上报错; 还有当更新某直为空时,("update tb set x='' where id="&id )也会出错。这是为什么啊? help me!
function checkStr(str) '过滤非法字符
if isnull(str) then
checkStr = ""
exit function
end if
checkStr=replace(str,"'","''")
end function
if checkStr(name) <> "" and checkStr(email) <> "" then '判断name和email 是否为空
set rs=conn("update tb_name set x='"&name&"',y='"&email&"' where id=" & id)
end if