Skip to main content

Posts

Showing posts from March, 2013

Create DSN using VB Script in ODBC

    'Create the Filesystem Object     Const SystemFolder= 1     Set oFso = CreateObject("Scripting.FileSystemObject")     Set SysFolder =oFso.GetSpecialFolder(SystemFolder)     SysFolderPath= SysFolder.Path     'Set the Driver details     DriverPath = SysFolderPath & "\sqora32.dll"     DriverName = "Oracle in Oraclient11g_home4"     'get the required details     DataSourceName = "Sample Source Name"     DatabaseName = "DB Name"     sDescription = "Odbc Desc " & DatabaseName        tnsNames = "Tns Names"     userId  = "User name"             'Create Shell Object     Set WshShell = CreateObject("WScript.Shell")     'Set the Key in the register of DSN ...

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