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   To Refer this Site to Your Friends   Click Here
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 do you connect to database ,What is the script to
connect DATA BASE?
 Question Submitted By :: Nagireddy Sn
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How do you connect to database ,What is the script to connect DATA BASE?
Answer
# 1
u need to installed "mysql-connector-odbc-3.51.27-win32",
then write down below code, 

Dim objCon, ObjRecordSet
ConnString = "Driver=MySQL ODBC 3.51 Driver; server=ServerIP"
ConnString = ConnString &";database=DBName"
ConnString = ConnString &";user=DBusername"
ConnString = ConnString &";password=DBPassword"
Set objCon = createobject("ADODB.Connection")
objCon.Open(ConnString)
Set ObjRecordSet = CreateObject("ADODB.Recordset")
ObjRecordSet.Open CStr("Select * From tbName Where Id =
'1'),objCon
If (not ObjRecordSet.EOF) then
	For I = 0 To ObjRecordSet.Fields.Count - 1
		If I = 0 Then
			On Error Resume Next
			GetSQLData = Trim(Cstr(ObjRecordSet.Fields(I)))
		Else
			On Error Resume Next
			GetSQLData = Trim(CStr(GetSQLData)) & "," &
Trim(CStr(ObjRecordSet.Fields(I)))
		End If
	Next 
End If
ObjRecordSet.close
objCon.close
Set ObjRecordSet = Nothing
Set objCon = Nothing
DataBaseConnection = GetSQLData
GetSQLData = ""




-----------
Sandip Gami
+91-9714177088
 
Is This Answer Correct ?    0 Yes 0 No
Sandipgami84
 
  Re: How do you connect to database ,What is the script to connect DATA BASE?
Answer
# 2
u need to put above code in "GetSQLData" Function
 
Is This Answer Correct ?    0 Yes 0 No
Sandipgami84
 
 
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
can some one help me how to compare the values from one sheet to values in another sheet? suposse i have a feild called Temp in action1 and i also have temp in action2. i want to compare the values of those two actions sheets data table? how can i do it using descriptive programming?  1
Hi, Am trying to download QTP 8.2 version.its not supporting Windows Vista.Can you please help me out from this.Which QTP version supports this. Thanks in Advance.  2
Function to convert lowercase to uppercase in QTP Pls anybody can give the answer.. Thanks in advance... Navis1
Why QTP is termed as a Record and Playback tool?  1
I want different types of discriptive programming statments coded for different types of web-objects?Give syntax and example?  1
Hi Friends, Can you please answer these questions of QTP Certification? 1.) What are bitmap checkpoints sensitive to? A. Image size and object type B. Object type and image type C. Screen resolution and object type D. Screen resolution and image size 2.)What are the phases in the QuickTest workflow? A. Plan, Record, Enhance, Run B. Prepare, Record, Verify, Run C. Plan, Create, Verify & Enhance D. Prepare, Create, Verify & Enhance, Integrate 3.) What are the two most commonly used ADO objects? A. Fields B. Execute C. Connection, RecordSet D. Open, ConnectionString 4.)What options are available to filter objects in the Target Object Repository pane when merging object repositories? A. Show all objects or Show only objects with conflicting object types B. Show all objects or Show only objects with conflicting descriptions C. Show only objects with conflicting logical names or Show only objects with conflicting object types D. Show only objects with conflicting logical names or Show only objects with conflicting descriptions 5.)Which of the following is an example of a missing resource? A. An object B. Run Results C. A Regular Action D. An External Action 6.)What method is used to retrieve the number of columns in the query results? A. Fields.Count B. Fields.Item(EOF) C. Fields.Count(BOF) D. Fields.Count.Value 7.)In VB Script functions, which one is false among the following a. Variables must be declared before use b. Variables may not be declared before use c. Variables may be declared without data types None  1
please send detail navigation for merging of object ripositories in QTP 8.2 Ordain-Solutions3
How to load a object repository(using VBScript) ... very urgent....  4
what ar the challenges do we face while testing webbased applications using the automation tool qtp or any? TCS4
Can we use same virtual objects in many number of tests? TCS1
Plz explain about InTERNAl Environment variable, External environment variable,builtin environment variables with examples? TCS1
what r the drawbacks and limitations of QTP? NIIT1
what is the test object?  1
In QTP whether is it possible to call a function from one action to another action?  1
How to call .vbs functions in QTP? plz Explain indetail Wipro3
How to create runtime property for an object?  6
When there is descriptive programming, why do we go for Object repository for desigining scripts.?? why cant we use descriptive programming instead of using the Object repository..?? DST-Global-Solutions2
What is driver script and driver script in qtp frame work???? IBM1
what is smart identification?  1
How i can change shared repository to per test repository in qtp  1
 
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