QTP连接Oracle数据库

Dim rs,sq
set conn=createobject("adodb.connection")
set rs=createobject("adodb.recordset")

conn.open="Driver={Microsoft ODBC for Oracle};Server=SID_HOST.DOMAIN.COM;Uid=mssqa;Pwd=password;"
sql="select * from CLIENT_TABLE"
rs.open sql,conn,3,3

do while not rs.eof
values=rs("CLIENT_NAME")
if values<>"State Street Corporation" then
Reporter.ReportEvent 2, "ClientNameSearched:"&" "&values, ""
rs.movenext
else
Reporter.ReportEvent 0, "ClientNameFound:"&" "&values,""
exit do
end if
Loop

rs.close
set rs=nothing
conn.close
set conn=nothing

posted @ 2014-01-06 14:35  赏客  阅读(376)  评论(0编辑  收藏  举报