ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Testing  >>  Automation Testing  >>  QTP
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions
 Load Runner interview questions  Load Runner Interview Questions
 QTP interview questions  QTP Interview Questions
 Test Director interview questions  Test Director Interview Questions
 Rational TestSuite interview questions  Rational TestSuite Interview Questions
 Silk Test interview questions  Silk Test Interview Questions
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions
Question
How to connect to data base?
 Question Submitted By :: Arpillai
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to connect to data base?
Answer
# 1
QTP supports interaction with Database using ADODB.

Set con = createobject("ADODB.Connection")
Set rs = createobject("ADODB.Recordset")

'Create DSN(DataSourceName) for your database and specify 
the DSN here
'You can also establish connection using Provider name

con.open "DSN=MyDsn;UID=ravi;PWD=sample123"

con.execute "Insert into emp values(2500, 'Ravi')"

'Retrieve data from database
rs.open "select * from emp", con
while not rs.eof
  msgbox "ID = " & rs(0) & " Name = " & rs(1)
  rs.movenext
wend
 
Is This Answer Correct ?    1 Yes 0 No
Ravi
 
  Re: How to connect to data base?
Answer
# 2
You can write OLEDB script:

Set Con =CreateObject("ADODB.Connection")
ConString="Provider:SQLNCLI;Server=plantdev;DataBase=QAServe
r;UID=patil;PWD=password1"
Con.ConnectionString=ConString
Con.Open
 
Is This Answer Correct ?    0 Yes 1 No
M.s.patil
 
 
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
What is the difference between Dim And Redim IBM3
What scripting language QTP of?  4
i m tryed to use qtp in a user registration form but at the "image enter"part it gives a error when i run the qtp bcz the image is changed every time so it gives a error when i use regukar expreesion fot this it still gives a error value bcoz it reads the image code bt nt reconige the image which i enter in the image verification text box.so hw can i automate qtp for this function.plz give me a answer  1
How to identify flash application when the qtp is not identifying the flash application objects.  2
how i can get the value of label box , please any body tell me script of that code  1
how you test broken link using the automated tool QTP ? Oracle3
what is the abbrivation of .mtr in action reposirtory? GE5
How do we Access, retriew and edit the runtime objects in Automation Testing using QTP IBM3
wt is the xtension of the QTP result view file?  4
what are the disadvantages of descriptiveprograming GE4
What are the Mandatory Properties of WebTable Object and Link Object in Web testing using QTP iLink2
What is Environment Variable and when we apply this in QTP?  3
Is there any site to download QTP....otherwise tell me the way how to get the QTP sofware??????????????????? Thnx in advance Cegonsoft5
what is a file system object in QTP  3
In a web site, Protocal has been changed http: to https: what is your approach?  2
What is meant by Pseudo Code? Satyam4
i'm using QTP 8.2, How should i select(browse) object repository from desktop(or from local local drives like C:\,D:\)?. Note:- object repository to select(browse) is been sent by some other person who is using QTP 9.0  1
What the differences are and best practical application of each.  1
How to record objects of Windows taskbar RoboSoft2
How you automate testscripts one by one or moduelwise or all at once  2
 
For more QTP Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com