in a certain scenario, i was trying to use the select query inside QTP (More specifically QTP Using VB script) But the code is not working.
Option Explicit
Dim con,rs
Set con=createobject("adodb.connection")
Set rs=createobject("adodb.recordset")
con.open "Driver={Microsoft ODBC for Oracle};Server=myServer; Uid=USERNAME;Pwd=PASSWORD;"
rs.open "SELECT B.STATUS FROM STUDENT B WHERE B.BATCHCODE='FIRST' ",con
Do while not rs.eof
DataTable.GlobalSheet.AddParameter.RawValue = rs.fields("v1")
rs.movenext
Loop
Release objects
Set rs= nothing
Set con= nothing
Please help me knowing which section of the code is getting script result fail.
DataTable
? Have you tried using a vbs file to see if the problem is related to UFT? – Pigweedcon.open "Driver={Microsoft ODBC for Oracle};Server=myServersIPAddress; Uid=USERNAME;Pwd=PASSWORD;"
also, i have added a watch for the same and found that there are 2 objects in the Error Tab for variable con. – Otter