Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How to give a call to another action from one action?

1133


What is parameter in qtp?

1140


what is stepin & stepout?

1900


what is key word driven frame work ? why it is called like that ? what is the diference between keyword driven and data driven frame work ?

2045


Explain in brief about the quicktest professional automation object model?

1004


Hi could some one explan what is the use of the function Defination generator, And how to use the function defination generator.. Explan with the example..

1868


Can any one tell me.......How the test engg's start testing in the compy environment.....real time tester PLSSSS help me i need in depth information regarding this...

2033


How do I lauch my test website using code from qtp in different environmet, uat and PPTE?

2076


Consider one application is open, clicking one menu will open another application in another browser. QTP does not catch the URL of the second browser(second application). can we capture it ?

1991


What are the factors on which script execution time is dependent?

1101


What is difference between Recording time object identification and Run time (Execution) time.

1708


Hi there, I've installed a trial version of QTP to see if it works with my product but I cant automate selecting windows from a tree view? Can anyone give me any pointers? Many Thanks

1902


What is Curd testing?

2354


write a script to verify links on any web page by using descriptive method by creating a description object (give a filter condition only link) ... need to verify expected like name by reading

1922


What is method name to compare two XML files.

2021