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