dhlhmgc 发表于 2009-12-1 20:45:16

如何得到ado的Execute执行所影响的记录数?

Dim $Cn1 = ObjCreate("Adodb.Connection")
Dim $CountRecord=0
With $Cn1
    .Provider = "Microsoft.Jet.OLEDB.4.0;"
    .ConnectionString = "Data Source=" & @ScriptDir & "\数据库.mdb;"
    .CursorLocation = 3                ;3=adUseClient
    .Open
    .Execute("UPDATE a SET a1=1", $CountRecord)
EndWith
msgbox (0,0,$CountRecord)

注:数据库中有记录,$CountRecord 中没有返回数据库修改记录数量!??
页: [1]
查看完整版本: 如何得到ado的Execute执行所影响的记录数?