芜湖网站建设芜湖网站优化、模板建站、微信小程序开发的网站定制服务由芜湖芝麻开门网络科技有限公司为您服务。
建站电话

0553-7552712

asp 执行 update 返回更新条目数

标签:芜湖网站建设 2021/1/22 

asp在 操作 sql server 的update时 返回 更新条目数可以在 connection的execute方法中放入一个参量,调用方法如 conn.execute(sql,i),这个i就记录了

更新的条目数,示例代码:


set conn = server.CreateObject("adodb.connection")
conn.open connSQLServerStr
id = request("id")
sql ="update test set name= 'hello' where id= '"& id &"'"
conn.execute sql, i
response.Write("更新数目为: " & i)


connection对象execute方法的参考资料链接为:http://www.w3school.com.cn/ado/met_conn_execute.asp