How do u connect database through QTP
tell me both Ms Access and SQL

Answer Posted / prasanth

we can connect to database in QTP using "ADODB" connection
object.

Sample code for SQL Server:

set mycon = createobject("ADODB.Connection")

mycon.open("driver=SQLserver;server=localhost;database=
(database name);trusted_connection=yes")

set myresult=mycon.execute("select * from sample")

while myresult.EOF <> TRUE
msgbox.myresult.fields(0)
myresult.movenext
Wend


you can get the connection strings
for "connectionstrings.com"


Kumar.rnv@gmail.com
Broadridge

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define Environment Variable in UFT and its uses?

810


When QTP object wait time is 10 seconds, and in test script wait time is 5 seconds and in function library wait time is 2 seconds how much time does the wait occur? or which is given priority.

1903


hi guys, pls tell me for testing institution training hub, hitech city is best or not?

1587


What are the differences between qtp and winrunner?

745


what is the advantages and disadvantages of using functions instead of re usable actions

1674


I hav installed QTP8.2, im working on webapplication, while running the script giving error msg like "QTPro.exe generated errors and will be closed by windows. You will restart the program. An error log is being created". Pls anybody what is the problem, what i have to do for this? Thanks...

1950


Explain QTP using different development techniques ?

728


What is the extension of qtp local repository?

782


Do you know how to connect database? Can you tell me the procedures?

762


I want to capture data(using keyword) from msdos application using QTP?... Below is little work i could do on it... /* Set app=CreateObject("Wscript.shell") SystemUtil.run ("C:\Users\Agent\Desktop\pumpsim\PUMPSIM.EXE") Window(“PUMPSIM.EXE”).Activate wait(3) app.sendkeys "N" */ Thanks in advance...!!!

1627


Name the different types of recording modes?

791


Which features or drawbacks of QTP lead to the upgrade for a newer version?

769


What is keyword driven framework?

861


An action has both shared and local or associated to it and both have the same object in them. In the test which one will be considered?

881


Hi All, I have QTP installed on my machine but the application under test is on remote machine. I need to automate the scenarios which consist of automatically enter the remote machine through IP address ,record the application in remote machine and run it also when played. Can some one tell how to record the application in remote machine.

1803