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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Can anyone tell me how i used QTP 9.2 use for GIS based S/w with an example?

1882


Why do we use breakpoints in QTP?

796


What is the latest version of qtp?

779


Explain the features of quick test pro(qtp)?

762


Define Error Pane of UFT?

859


Hi can anybody send me the QTP material, To my email ID: nuve1284@gmail.com ?

1892


hi in real time who will execute the qtp test scripts? my faculty said, in a companty automation testers are written the test scripts and manual testers are execute the test scripts...IS IT RIGHT OR NOT?

3195


Can the user toggle between using Local OR and shared OR for the same action?

735


how to disable the pop ups through QTP using a script

1936


How do you capture tooltip using QTP?

806


whenever U using QTP,Test Director, Why we using separate Bug tracking tool?

1828


Can QTP be used for GUI testing ?, We are using Java with MySQL and Operating system is Linux. We are NOT using the web.

2128


What is Distributed testing? How does UFT support it?

795


How to perform cross platform testing and cross browser testing using qtp? Can you explain giving some example?

746


I have written a code to fetch values fro access db and place in the fields. Iam using GetROProperty to fetch runtime values. Now i want to add runtime values to the access db in field v3. please help me. Its not writting in the db. Option explicit Dim con,rs,db,c Set con=createobject("adodb.connection") Set rs=createobject("adodb.recordset") con.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=D:\Sales.mdb" rs.open "select * from tax",con Do while not rs.eof Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("incost").Set rs.fields("v1") Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("intax").Set rs.fields("v2") c=Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("outtax").GetROProperty("value") rs.MoveNext print c Loop Do while not rs.EOF rs.EditMode rs.Fields("v3").Value="3" rs.Update rs.MoveNext Loop Set rs=nothing Set con=nothing

1703