Establishing SQL Connectivity

How to establish SQL Connection other than using QTP Wizard for SQL Connectivity?

Questions by vijay3080

Showing Answers 1 - 3 of 3 Answers

You can use the following code

'Creating objects of type ADODB
Set DBConn = CreateObject("ADODB.Connection")
Set RecordSet = CreateObject("ADODB.Recordset")


' setting up connection to the data base
DBConn.Open DRIVER={<Driver Name>};SERVER=<ServerName>;UID=<userid>; PWD=<password>;


'Checking whether connection is established or not
 If DBConn.State = 1 then
 DBConnection = Pass

Regards,
Vaibhav Tavarageri

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions