Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
share adodb connection in excel
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 onl ???? thank -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. -- |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
share adodb connection in excel
in my module i want to have variable with connection parameters
for example i want to once describe this variable somewhere in module cons = "provider=Microsoft.Jet.OLEDB.4.0;" & _ "data source=db.mdb;" and after that i simply want to use this string variable in each sub maybe i must to use constants -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
share adodb connection in excel
Marek wrote ...
in my module i want to have variable with connection parameters for example i want to once describe this variable somewhere in module cons = "provider=Microsoft.Jet.OLEDB.4.0;" & _ "data source=db.mdb;" and after that i simply want to use this string variable in each sub maybe i must to use constants ? Sure, that's what I'd do: Private Const CONN_STRING As String = "" & _ "provider=Microsoft.Jet.OLEDB.4.0;" & _ "data source=db.mdb;" although it's unlikely to be needed by multiple subs e.g. if you have a property that supplies the ADO Connection object. Jamie. -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ADODB Connection | Excel Worksheet Functions | |||
Trying to simulate 2 separate users in connection with a Share Wor | Excel Discussion (Misc queries) | |||
Trying to simulate 2 separate users in connection with a Share Wor | Excel Discussion (Misc queries) | |||
Virus - importing excel via adodb connection | Excel Programming | |||
ADODB Connection to Access | Excel Programming |