How to connect to data base?

Answers were Sorted based on User's Feedback



How to connect to data base?..

Answer / jayadev acharam

Using ADODB Object
Example
DB_Connect=CreateObject(ADODB.Connection)

Is This Answer Correct ?    4 Yes 0 No

How to connect to data base?..

Answer / akshay

Public Function database(Str,SQLstr,outResult1,outResult2)

'//Variable Declarations
Dim objConn, rsOut

'//Create a connection object.
Set objConn = CreateObject("ADODB.Connection")

'//Create a ResultSet Object to store the results.
Set rsOut = CreateObject("ADODB.Recordset")

'//Open the Created Connection object
objConn.Open Str

'//Pass the SQL query string and retrieve the Results
through the connection object
rsOut.Open SQLstr,objConn

If rsOut.EOF <> True AND rsOut.BOF <> True Then

'//Store the different column values
retrieved from a record in different variables.
outResult1=rsOut("col1")

outResult2=rsOut("col2")

rsOut.movenext
End If

End Function

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More QTP Interview Questions

Explain the new feature of UFT regarding the export of test results?

1 Answers  


How many test scripts are prapare in ur project(HeathCare Insurance).

1 Answers   Virtusa,


what is run-time object property in Object spy in QTP9?

3 Answers  


Which scripting language QTP is using?

6 Answers  


Is there any MS Access addin in QTP?

7 Answers  


I want to test my vb.net solution file using qtp. Does Qtp test only .exe file?

1 Answers  


what is the difference between invoke application and system.util.run

24 Answers   HP, Syntel,


how do u handle an object without name using QTP 9.2?

0 Answers   CTS,


What is Data driven Testing Frame work.Anybody can expain it in Detail.. Pls anybody can give the answer.. Thanks in advance...

1 Answers   Navis,


Could you please any one give code for the following ? Scenario : Suppose a excel file contains 10 records and earch have 5 fields. how can i input this excel file for datadrive wizard ? Please explain

1 Answers  


QTP 9.2, Issue: Creating Shared Object repository. I recorded 2 scripts. I exported the Object Repository to a shared location for the first script. Associated the exported repository to the first script and deleted the Local Repository for the First Script. Now Opened the Second script and try to Add the Local Object Repository of 2nd Script to Exported Object Repository. But I fail. Can anyone please help in providing steps that need to be followed in creating a shared object repository? Thanks in Advance.

3 Answers   Google, UHG,


In Test Director , You can store Test cases or vb Script . Why we need VSS?

2 Answers  


Categories