Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB Connection fi.or.jp.de Excel Worksheet Functions 0 September 9th 09 09:23 PM
Trying to simulate 2 separate users in connection with a Share Wor Matthew S Excel Discussion (Misc queries) 3 August 30th 05 12:21 PM
Trying to simulate 2 separate users in connection with a Share Wor Mike Excel Discussion (Misc queries) 0 August 29th 05 09:56 PM
Virus - importing excel via adodb connection Jim M[_4_] Excel Programming 1 May 15th 04 08:09 AM
ADODB Connection to Access Cindy Excel Programming 1 February 27th 04 11:51 AM


All times are GMT +1. The time now is 12:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"