Most Viewed Pages

31.5.14

How to work with QC OTA - Example 3 - Function to Run a Query on QC Database

'------------------------------------
' Function Name:         funcRunQueryOnOC
' Description:               This function will run a query on the QC database and then return the recordset containing the results
' Input Parameters:     sQCQuery - The query to be run on the QC database
' Output Parameters:  The QC RecordSet Object
' Author:                      Ashish Jaiswal
'------------------------------------

Function funcRunQueryOnOC(sQCQuery)

    'Getting the QC Connection Object. Refer earlier post about the implementation of this function.
    Set oALMConnObj = funcGetALMConnectionObj (sQCServer, sQCUsername, sQCPassword, sQCDomain, sQCProject)

    'Getting the Command object to run the query
    Set oQCCommand = oALMConnObj.Command

    oQCCommand.CommandText = sQCQuery
    'Sample query: "Select * from Bug where BG_BUG_ID = 9295"

    Set oQCRecordSet = oQCCommand.Execute

    'Now returning the recordset
    Set funcRunQueryOnOC = oQCRecordSet

End Function 
'------------------------------------

No comments:

Post a Comment