QTP 依次读取文本中的各行数据
2016-06-24 15:34
746 查看
Dim strarray(1000) Dim i i=0 Set fso = CreateObject("Scripting.FileSystemObject") Set openfile=fso.OpenTextFile("C:/TP131205KF.TXT",1,True) Do Until openfile.AtEndOfStream strarray(i)=openfile.ReadLine msgbox strarray(i) ‘加到这里就能显示 i= i+1 Loop openfile.Close Set fso=Nothing
Dim adoconn
set adoconn=Createobject("adodb.connection")
connectionstr="" '数据库连接字符串
adoconn.open connectionstr
set amd=createobject("adoconn.command")
amd.ActiveConnection=connectionstr
for j=0 to i-1
amd.commandText=strarry(j)
amd.command Type=1 'command Type 为1是sql查询,4为sql存储
set adorst=adoconn.Execute()
Next
相关文章推荐
- QTP 数据库连接字符串动态赋值
- qtp执行文本中的sql语句/脚本
- Qt资料大全
- Qt资料大全
- MQTT 客户端应用及常见问题(C#)
- MQTT客户端搭建及应用(Nodejs)
- http://emqtt.com/
- Qt获取本机IP地址和名称
- QT QTreeWidget 选中某行并设置背景色高亮
- QTcrateor 编译 ROS
- Qt5实现串口通信
- 使用QProcess调用另一个程序
- qt5集成libcurl实现tftp和ftp的方法一:搭建环境(五篇文章)
- Qt中的信号和槽
- Qt之QImageReader
- Qt之QImageReader
- Qt之QImageWriter
- Qt之QImageWriter
- [Q学习]14 Qt状态机框架——进入和退出状态3
- [Q学习]14 Qt状态机框架——进入和退出状态2