Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi... i'm working with VB and Sql S 1

Status
Not open for further replies.

precimonito

Programmer
Jan 20, 2001
18
EC
Hi... i'm working with VB and Sql Server 7, and i use ADODB to stablish the connection,

i want to know if i can use an ADODB.Connection object as a parameter...

thanks in advance
Precimonito
 
You should be able to do that - just include the ByRef keyword in front of the parameter name when you define the function. This way you just pass a reference to the existing object.

Example:

Function PassTheConn(ByRef objConn As ADODB.Connection) As Long

' Do some stuff

End Function
 
thanks a lot, but i have another question, i can active the connection inside a function and then pass to another function... the connection is still active?

thanks in advance :)
 
Yes, since what you are actually passing is just a reference to the connection object already in memory whatever is the status of that object is the status of the object passed (because it actually is the same object).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top