51Testing软件测试论坛
标题:
新手求助QTP操作oracle时表或视图不存在
[打印本页]
作者:
yaoleicara
时间:
2012-10-23 11:24
标题:
新手求助QTP操作oracle时表或视图不存在
Dim adoConn
Dim ConnectionStr
ConnectionStr ="Provider=MSDAORA.1;User ID=test;Password=test;Data Source=ORCL;Persist Security Info=False"
sqlStr = "select * from CORE_APP_DEPARTMENT"
Set adoConn = CreateObject("ADODB.Connection")
adoConn.Open ConnectionStr
if adoConn.state <> 0 Then
msgbox "数据库连接成功!"
Set adoRst = adoConn.Execute(sqlStr)
For i=1 to adoRst.Fields.Count
MsgBox adoRst.Fields.Item("DEPARTNAME").Value
adoRst.MoveNext
Next
msgbox adoRst.Fields.Count
End If
adoConn.Close
Set adoConn = nothing
复制代码
sql语句是从plsql里直接拷出来的,plsql里可以查询出数据
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2