字号: 小 中 大 |
推荐给好友
上一篇 |
下一篇
软件测试工具robot里连接数据库的例子
发布: 2009-12-17 16:33 |
作者: 网络转载 |
来源:
领测软件测试 |
查看: 45次 | 进入软件测试论坛讨论
领测软件测试网
软件测试工具robot里连接数据库的例子
Sub Main Dim Result As Integer dim strconn as string dim conn as Object dim rs as Object dim testnumber1 as integer dim testnumber2 as integer 'Initially Recorded: 2006-3-27 11:14:23 'scrīpt Name: ado on error goto qq StartApplication "C:\WINNT\system32\calc.exe" Window SetContext, "Caption=计算器", "" strconn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\ado.mdb;Persist Security Info=False" set conn=createobject("ADODB.Connection") conn.open strconn set rs=createobject("ADODB.Recordset") rs.open "select number1,number2 from test\", conn rs.MoveFirst Window SetContext, "Caption=计算器", "" do while not rs.eof testnumber1=rs.fields(0).value testnumber2=rs.fields(1).value msgbox testnumber1 msgbox testnumber2 inputkeys str(testnumber1) inputkeys "{+}" inputkeys str(testnumber2) inputkeys "{=}" rs.MoveNext loop Window CloseWin, "", "" rs.close conn.close set rs=nothing set conn=nothing exit sub qq: resume '恢复到出错位置下一个记录 End Sub |
文章来源于领测软件测试网 https://www.ltesting.net/