Connection Object

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I want to create a function that accepts the ServerName parameter, gets the connection to the server and returns the CONNECTION OBJECT to the calling function/procedure. How do I do this? I don't think it's as simple as writing a function like.... Public Function GetConnection(strServerName) As Connection

Thanks
JP
 
You have the start for this function, but be aware that you can't pass a
Connection across processes (to another program or anther tier). It takes
more than the server name to establish a connection. It takes credentials or
a SSPI setting (at least) and (optionally) the initial catalog (always a
good idea), and other arguments.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

JP said:
Hi,

I want to create a function that accepts the ServerName parameter, gets
the connection to the server and returns the CONNECTION OBJECT to the
calling function/procedure. How do I do this? I don't think it's as simple
as writing a function like.... Public Function GetConnection(strServerName)
As Connection.
 
Back
Top