How to connect to the Database from QTP?

Answer Posted / manjula b

Set odb=createobject("ADODB.connection")
Strpath="c:usershappydesktopdesktop31database2.mdb"
Odb.connection string="provider=microsoft.jet.oledb.4.0;datasource="&strpath
Odb.open
Sql1="select *from employees"
Set orec=odb.execute(sql1)
Dountil orec.eof=true
Print orec.fields("employee name")
Orec.move next
Loop
Odb.close

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the various automation frameworks available in qtp?

499


When you open QTP, how many sheets you can see?

645


Can QTP be used for GUI testing ?, We are using Java with MySQL and Operating system is Linux. We are NOT using the web.

1940


Key word driven framework

1682


give me an example where u used good judgement and logic in solving a problem

3346






How many types of recording modes in the qtp?

585


How can i initiate the objects to find uniquely in OR

1456


Hi can anybody send me the QTP material, To my email ID: nuve1284@gmail.com ?

1679


How to record application running on the Virtual machine?

634


What is recovery scenario manager? When you go for recovery scenario manager? Tell me one scenario were your used recovery scenario in your project?

566


Limitations in QTP?

1735


What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?

690


Hi, I am using OutputCheckPoint for 2 webelements Bed:4 and Bath:2 Full,1 partial in my result page and I am storing the value in the data table. I dont need the string Bed:4,I would like to get only the no 4. How can I get it? Even though I highlight only 4,It is seleting the full value "bed 4". Same thing happend for second webelement Bath:2 Full,1 partial I need only the No 2. I used the following to split MyArray = Split(UIBathResult, " ", -1, 1) But it is giving the value My Array(0)=Bath:2full,1Partial I need the only the nos for further comparision.Any help? Thanks Uma

3229


how can we compare descriptive programing with a regular expression

1912


What kind of performance is expected on the client side (e.g., how fast should pages appear, how fast should animations, applets, etc. load and run)?

585