View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default share adodb connection in excel

Marek wrote ...

people in asp i can share adodb connection in GLOBAL .asa file

but i dont want to dedscribe adodb connection in each sub procedure

where in excel i can place my adodb connection desciption once only
????


Dim the connection variable at the top of the code module (General
Declarations) e.g.

Private m_Con As ADODB.Connection

If the connection is required in more than one code module, provide a
Property Get e.g.

Friend Property Get Connection() As ADODB.Connection
Set Connection = m_Con
End Property

Jamie.

--