What the genaric function to connect Sql Server using Sql
Server Authentication and Windows Authentication



What the genaric function to connect Sql Server using Sql Server Authentication and Windows Authen..

Answer / kotike

Function DBConnect(Constr)
set oCon=CreateObject("ADODB.Connection")
oCon.open Constr
if oCon.State=0 then
msgbox "connection not opened"
end if
set DBConnect=oCon
End Function

where ever required just call this function and define the
connection string.

ex: set con=DBConnect("Driver=;Server=;database=;user
id=;passwoerd=")

Regards,
mahi.kotike@gmail.com

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

Please have a look at this: a = Browser("Travel Boutique Online").Page("Travel Boutique Online_2").webelement("innerhtml:=2622").getroproperty("y") a=a+9 msgbox a Browser("Travel Boutique Online").Page("Travel Boutique Online_2").image("alt:=check","y:=a").click Now please let me explain. As clear from code I am trying to enter value of variable 'a' as Property y. But each time QTP AND MY SYSTEM stops responding when this line is execcuted. But When i enter some number in place of 'a' in the last line. it works fine. Please let me know what I am doing wrong at time of entering the variable in last line. Thanks a lot

3 Answers  


What is the use of "Registeruserfunc" when should we use it? Note:Please do not copy paste the date from QTP help. I tryed it.But I don't Understand where should we use exactly.

5 Answers   Livetek,


Hi Every body please explain me in steps to use checkpoints and object Repositories in QTP for Flight Reservation application please tell me the steps for this its urgent pls thanx for urs answers

0 Answers  


How can we disable smart identification at the time of recording? Ideally, smart identification should be enabled only at the run-time.

3 Answers  


Please clarify Automation and QTP both(names) are same or diff?

1 Answers  






Hi Guys, here I am posting one question. Wen u r working with Notepad. If it is not responding in the middle of TEst...what u will do.

7 Answers  


how can we retrieve ten rows from the data table using loop concept?

3 Answers  


Suppose one object is changed in a project after delivering the project.Where we will update that object? it can be present in many scripts so can we update all the scripts?

1 Answers   IBM,


Have you used TD?

2 Answers  


Write VB script to test given number is Prime Number

5 Answers   Oracle,


wht type of User defined functions or Java Releated functions Do we write in VB scripting

0 Answers  


What are associated files in QTP?

2 Answers  


Categories