Chinaunix首页 | 论坛 | 博客
  • 博客访问: 743224
  • 博文数量: 769
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 4985
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-15 16:37
文章分类

全部博文(769)

文章存档

2011年(1)

2008年(768)

我的朋友

分类:

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


--------------------next---------------------

阅读(292) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~