photo_cs数据类型为varchar
我想判断photo_cs值为<NULL>时就更新数据
这是我目前用的代码:
if(rs("photo_cs")="") Then
这段代码当清除<NULL>时能更新数据,列表为<NULL>时则不能更新。
if(rs("photo_cs")=null) Then
if rs("photo_cs")=null or rs("photo_cs")="" then
if rs("photo_cs")=null Then
这样也试过了还是当列表为<NULL>时则不能更新。
请教大家!!
我想判断photo_cs值为<NULL>时就更新数据
这是我目前用的代码:
if(rs("photo_cs")="") Then
这段代码当清除<NULL>时能更新数据,列表为<NULL>时则不能更新。
if(rs("photo_cs")=null) Then
if rs("photo_cs")=null or rs("photo_cs")="" then
if rs("photo_cs")=null Then
这样也试过了还是当列表为<NULL>时则不能更新。
请教大家!!
--sql
update tb set col= case when photo_cs is null then 'value' end
特请朋友们再次帮忙看看(另+10分)
'更新数据库
If (loveb>=abs(cspicup_num)) Then
'读取数据库
set rs = server.CreateObject("adodb.recordset")
rs.open "select * from xt_main where username='"&username&"'",conn,1,1
if(rs("photo_cs")="") Then conn.execute"update xt_main set pic_count=pic_count+1,photo_cs='"&picname&"' where username='"&username&"'"'更新主表相册数量
conn.execute"update xt_main set loveb=loveb"&cspicup_num&" where username='"&username&"'"
call msg("上传成功!")
else
call msg("您已上传过图片了")
End If
Else
call msg("你的金币不足"&abs(cspicup_num)&",无法上传相片!\n\n请充值!","-1")
End If
set file=nothing
set upload=nothing