How do you connect to database ,What is the script to
connect DATA BASE?
Answers were Sorted based on User's Feedback
Answer / sandipgami84
u need to put above code in "GetSQLData" Function
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / sandipgami84
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 ? | 2 Yes | 1 No |
Explain roles and responsibilites of 2yrs Automation qtp engineer.
What are the different scripting languages you could use when working with QTP ?
Can we Script any test case with out having Object repository? or Using Object Repository is a must
Among all the check points what is the most important checkpoint?
Can the mode of object repository be change during run time? Eg. if the mode is per-action during design time can i change it to shared and vice-versa? Any scripting possible?
some times we write user define functions.where we write main and sub program,how,where to insert the functions in qtp?
What are different versions in Win Runner ,QTP ,Load Runner and Test Director till now and atleast please let me know new features for each version. Ex QTP8.2,QTP 8.5.QTP9.2 supports Mozilla 2.0
how can we test load time of an page in webtesting?
what is the diffrence between script and Language ? (Chandana)
What does VBS file contain...??? what is VBS file.. ???
What is the difference between two actions?
how to do the batch testing in test director using manual testing procedure?