asp判断数据是否已经记录
来源:百度知道 编辑:UC知道 时间:2024/06/17 18:45:38
if Request.Cookies("SQL_dd")("UUL" & ID)<>"yes" then
conn.execute "UPDATE [User] SET points = pandeid where userid="&uid
response.Cookies("SQL_dd")("UUL" & ID)="yes"
这是以缓存判断是否记录,我想改成使用数据库记录判断,求asp高手,给个简单代码的提示
conn.execute "UPDATE [User] SET points = pandeid where userid="&uid
response.Cookies("SQL_dd")("UUL" & ID)="yes"
这是以缓存判断是否记录,我想改成使用数据库记录判断,求asp高手,给个简单代码的提示
do while not rs.eof
rs.movenext
if rs.eof then
response.write "最后一条"
end if
loop
if conn.Execute("select count(*) from[User] where id = "&uid)(0) = 0 then
不存在
else
存在
end if
exec="select * from [User] where userid="&userid&""
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
if rs.bof and rs.eof then
'证明没有
else
'有
end if
在数据库中增加一字段,用来记录yes和NO