主题:  为何此语句不执行?

水木

职务:普通成员
等级:1
金币:0.0
发贴:145
#12004/4/23 14:14:30
今天写了个修改用户名密码 的句子, 可是发现此语句不执行也不报错.
折腾了好久, 只好让大家帮帮忙:

set conn = Server.CreateObject("ADODB.Connection"
conn.open connstr
sql2 = "update useradmin set username = 'zhonghua', password = 'antiques' where adminid=1"
set conn = Server.CreateObject("ADODB.Connection"
conn.open connstr
conn.execute(sql2)

小生多谢了!



冷雨狂舞

职务:普通成员
等级:5
金币:15.6
发贴:2554
#22004/4/23 16:28:00
sql2 = "select * from useradmin where adminid=1"
set rs=server.createobject("adodb.recordset")
rs.open sql2,conn,1,3
rs("username")="zhonghua"
rs("password")="antiques"
rs.update
=========
这样试试看。



janlay

职务:管理员
等级:7
金币:28.0
发贴:7244
#32004/4/23 18:00:13
set conn = Server.CreateObject("ADODB.Connection")
conn.open connstr
sql2 = "update useradmin set username = 'zhonghua', password = 'antiques' where adminid=1"
set conn = Server.CreateObject("ADODB.Connection")
conn.open connstr
dim intEffected
conn.execute(sql2,intEffected)
Response.Write intEffected
如果输出 0,则表明没有更新任何行,请检查匹配记录