分类:
2008-10-15 16:44:33
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