ASP下载次数问题

来源:百度知道 编辑:UC知道 时间:2024/06/10 09:12:11
'接收 id
id=request.form("id")

'从数据库中找到 id所在的行

strsql="select * from users where id='"&id&"'"

Set rs=Server.CreateObject("ADODB.Recordset")

'更新下载次数
strsql="update users set xiazaicishu=xiazaicishu +1 where id='"&id&"'"

'转到下载地址

response.Redirect("download\" & rs("email"))

%>
qq 和 WU 还是不行啊 再帮帮忙

是我的错误 不好意思 如果有错把错误贴出来
'更新下载次数
conn.execute("update users set xiazaicishu="&rs("xiazaicishu")+1&" where id='"&id&"'")

帮你改了个 试下:
<%

'接收 id
id=request.form("id")

'从数据库中找到 id所在的行

strsql="select * from users where id='"&id&"'"

Set rs=Server.CreateObject("ADODB.Recordset")
rs.open strsql,conn,1,1
if not rs.eof then
'更新下载次数
conn.execute("update users set xiazaicishu="&rs("xiazaicishu")&" +1 where id='"&id&"'")

'转到下载地址
response.Redirect("download\" & rs("email"))
end if
rs.close
set rs=nothing
%>

如果有错把错误贴出来,并发个信息给我呀