How do you connect to database ,What is the script to
connect DATA BASE?
Answer Posted / 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 |
Post New Answer View All Answers
how will you load the test cases in ddt?
i need qtp tutorial. pls send it to sridhar.k151@g mail.com
Hi All, I have QTP installed on my machine but the application under test (AUT) is on remote desktop.My scenarios is like that,it should contain following steps. 1)Automatically it should click on start and then on remote desktop connection. 2)it should enter the IP address and then connect to remote desktop. 3)and then it should be able to record the application in remote machine and then run it also. Can somebody tell me how to record the application which is in remote machine.
how will load the object during runtime?
if our qtp vb Script may be Currepted then What we want do?
How to find Operating system information using QTP script?
Who uses qtp tool?
What is data driver in qtp? Where we use it?
after initiating one project for testing, when exacltly QTP tester role starts?
Where is the resultset of a sqlquery (which is fired by rsobj.open sqlquery,xxxx,xxxx) stored ?
What are the types of properties that quick test learns while recording?
After executing the script in qtp suppose i found some script execute successfully and found some error.So how to report the status for both (i.e pass and fail report)in test director. For "fail" We use "defect tab" in testdirector. But for "pass" how to report it to TL.what is the process plz anybody ans
what type of framework u r using in ur organization
iam working in QTP for 2+ of exp if i attend the interview what r questions asked in perfomence testing{loadrunner} ? pls any one can say answer to this question?
1.How do u prepare the test suits in QC? 2.How do u convert requirements to test plan in QC?