请ASP高手指点,下面数据修改为什么保存不了数据?

来源:百度知道 编辑:UC知道 时间:2024/05/27 04:49:03
<%
dim rs,product,kd,total

kd=session("englishonlingname")
total=session("total")
set rs=server.createobject("adodb.recordset")
rs.open "select * from company where username='"&kd&"'",conn,1,1
rs("issuance")=total
product=rs("product")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write ""&product&""
response.write ""&total&""
%>
<%=session("total")%>
<%=session("englishonlingname")%>

不知道上面代码那里错了!session("englishonlingname"),session("total")都有临时值,奇怪的是product,total,session("total"),session("englishonlingname")运行代理时四个值都能显示,最终就是不能修改数据库的数值,issuance的值改为total的值!不知道为什么,请教高手!

rs.open "select * from company where username='"&kd&"'",conn,1,1
这里的1,1表示只读的意思,你要修改应改为可写模式,把1,1改为1,3或2,3都可以

rs.open "select * from company where username='"&kd&"'",conn,1,1
改成
rs.open "select * from company where username='"&kd&"'",conn,1,3

权限不够,rs.open那里的1,1改为1,3