找回密码
 加入
搜索
查看: 1408|回复: 3

AU3操作MSSQL2000中的奇怪现象

[复制链接]
发表于 2009-12-25 11:36:17 | 显示全部楼层 |阅读模式
本帖最后由 awingu 于 2010-1-4 14:45 编辑
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Outfile=aaaa.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
$pro = ObjCreate("ADODB.Connection")
$RS = ObjCreate("ADODB.Recordset")
$pro.Open("driver={SQL Server};server=192.168.128.129;uid=sa;pwd=mima;database=awingu_soft_0001")
$RS.ActiveConnection = $pro
;$sql = "Create Table ABCD (AABB TEXT)"
$RS.Open("Update GusetBook set Visitor='112233' where BB='2'") ;################看这里##########
;$RS.Execute("select * from gusetbook")
While (Not $RS.eof And Not $RS.bof)
        $a = $RS.Fields(0).value
        MsgBox(0, "", $a & " | " & $RS.Fields(1).value & " | " & $RS.Fields(2).value)
        $RS.movenext
WEnd
$RS.close
$pro.close
更新数据、添加数据等,都是使用$RS.Open("......")

如果使用$RS.Execute(".....")则出错。不知道没有没有人知道为什么。
发表于 2009-12-27 17:59:53 | 显示全部楼层
$pro = ObjCreate("ADODB.Connection")
你应该用 $pro.Execute() 而不是$rs
 楼主| 发表于 2010-1-4 14:45:55 | 显示全部楼层
谢谢,现在我算是明白怎么回事了。
发表于 2010-1-4 15:20:44 | 显示全部楼层
例子中的 $RS是记录集对象!不能使用$RS.Execute
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-26 16:51 , Processed in 0.071075 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表