Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating QTP Script to run on TOAD
#3
Not Solved
Hello ;

Here a exemple how using ODBC to connect to Orale database and execute and get the results:

Const adOpenStatic = 3
Code:
    Const adLockOptimistic = 3
    Const adUseClient = 3

    Set objConnection = CreateObject("ADODB.Connection")
    Set objRecordset = CreateObject("ADODB.Recordset")
    
    objConnection.Open "DRIVER={Microsoft ODBC for Oracle};Server=" & sG_Database & ";UID=" & sG_DBUser & ";PWD=" & sG_DBPwd
    objRecordset.CursorLocation = adUseClient
    objRecordset.CursorType = adopenstatic
    objRecordset.LockType = adlockoptimistic[hr]
This is the second part of the previeus script:

Code:
ObjRecordset.Source="Select column from Table " ' Exemple of Query'
    
ObjRecordset.ActiveConnection=ObjConnection
ObjRecordset.Open


If ObjRecordset.recordcount>0 then
i = 1                
Do Until ( i > iRowId Or ObjRecordset.EOF )

DataTable("Col" , dtGlobalSheet) = ObjRecordset("Column").Value
DataTable.SetCurrentRow (i)
ObjRecordset.MoveNext

i = i+1
Loop
End if
Remarke : Befor you can use this you have to install oracle ODBC client 10.2 for exemple if oracle database is 10.2 and less
Reply


Messages In This Thread
Creating QTP Script to run on TOAD - by kikoman16 - 03-12-2009, 03:58 PM
RE: Creating QTP Script to run on TOAD - by elsekra - 09-28-2009, 04:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to send/pass UFT Run Error Dialog as output value to main driver script lravi4u 0 349 11-05-2023, 03:55 PM
Last Post: lravi4u
  How do you Change Run mode mid script? Caleytown 6 6,564 03-25-2021, 08:27 AM
Last Post: RB26578
  How to run driver script to kick off scripts stored in QC? shipu 0 3,398 04-30-2014, 02:39 AM
Last Post: shipu
  Creating Random String SomeIntern 0 4,785 08-21-2013, 09:10 PM
Last Post: SomeIntern
  Flight API does not run and QTP not recording the script Ruch 0 2,500 08-15-2013, 04:57 AM
Last Post: Ruch

Forum Jump:


Users browsing this thread: 1 Guest(s)