Skip to main content

Posts

Showing posts with the label ADODB.recordSet

Getting Record Count Using ADODB Connection in QTP

When you get the Record Count as  -1 Change the CursorLocation to 3 or 2 or 1(mostly 3 ll work) Sample Code:  strConnectionString =  "Driver= {Microsoft ODBC for Oracle}; " &_                   "ConnectString=(DESCRIPTION=" &_                   "(ADDRESS=(PROTOCOL=TCP)" &_                   "(HOST=hostName) (PORT=1234))" &_                   "(CONNECT_DATA=(SERVICE_NAME=ABCD)));uid=userName; pwd=Password;" strQuery = "Select * From Table" Set objCon = CreateObject("Adodb.Connection") objCon.CursorLocation = 3 Set objRs = CreateObject("Adodb.Recordset")  objCon.Open strConnectionString Set objRs = objCon.Exe...