Skip to main content

Posts

Showing posts with the label ADODB

Working with BLOB or CLOB Objects in QTP

The below Code will Insert the CLOB or BLOB objects in  Oracle DB using QTP. Sample Code: 'CLOB or BLOB file Path strClobFileName = "C:\Jay\SampleInputs\BLOBorCLOB.txt" 'Connection String strOracleConnectionString =  "Driver= {Microsoft ODBC for Oracle}; " &_                   "ConnectString=(DESCRIPTION=" &_                   "(ADDRESS=(PROTOCOL=TCP)" &_                   "(HOST=hostName) (PORT=1234))" &_                   "(CONNECT_DATA=(SERVICE_NAME=ABCD)));uid=userName; pwd=Password;" 'Create Required Objects Set objCon = CreateObject("Adodb.Connection") Set objRs = CreateObject("Adodb.Recordset") Set objCom = CreateObj...

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...