設計家園--設計資源,ASP,PHP,JSP,ASP.NET,Dreamweaver,Flash,Fireworks,Photoshop,SQLSERVER,MYSQL,ACCESS
阿新 • • 發佈:2019-01-30
用如下方法可以直接得到影響的行數:
<%
dim conn
dim sql
dim lngrecs
sql="update table1 set field1='good'"
set conn=server.createobject("adodb.connection")
conn.open dsn
conn.execute sql,lngrecs
conn.close:set conn=nothing
response.write lngrecs
%>
用儲存過程也有同樣的功能:
<%
dim cmd
dim lngrecs
dim sql
sql="update table1 set field1='good'"
set cmd=server.createobject("adodb.command")
with cmd
.activeconnection=dsn
.commandtype=adcmdstoredproc
.commandtext=sql
.execute lngrecs,,adexecutenorecords
end with
set cmd.activeconnection.nothing
set cmd=nothing
response.write lngrecs
%>
來源:http://www.dwww.cn/new/2006681833492169.html