Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
GPO GPO is offline
external usenet poster
 
Posts: 12
Default VBA to check for existence of a DSN

XL 2000
Can anyone point me to a bit of VBA that checks a user's PC for the
existence of a DSN?

Cheers

GPO
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default VBA to check for existence of a DSN

You'll need to look in these three places.

file DSN's,
%ProgramFiles%\Common Files\ODBC\Data Sources

system DSN's
You'll need to get the subkey with the DSN names
HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources

and also the subkey for each DSN
HKLM\SOFTWARE\ODBC\ODBC.INI\

Also look for user DSN's in;

HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources

and also the subkey for each DSN
HKCU\SOFTWARE\ODBC\ODBC.INI\

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"GPO" wrote:
| XL 2000
| Can anyone point me to a bit of VBA that checks a user's PC for the
| existence of a DSN?
|
| Cheers
|
| GPO


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default VBA to check for existence of a DSN

GPO,
One way is read the registry. e.g enumerate the values at :
HKEY_CURRENT_USER\Software\ODBC\ODBC.INI
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI

See http://www.vb-helper.com/howto_create_dsn.html for examle.

NickHK

"GPO" wrote in message
...
XL 2000
Can anyone point me to a bit of VBA that checks a user's PC for the
existence of a DSN?

Cheers

GPO



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
co existence assaf1978 Excel Discussion (Misc queries) 2 December 23rd 08 12:38 PM
Check for existence CWillis Excel Discussion (Misc queries) 3 May 31st 06 01:20 PM
Check File Existence Catalin[_2_] Excel Programming 5 May 10th 06 10:20 AM
How do I check for existence of a worksheet? LizzieHW Excel Worksheet Functions 1 July 19th 05 06:22 PM
Code to check existence No Name Excel Programming 2 November 4th 04 01:50 PM


All times are GMT +1. The time now is 01:59 PM.

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

About Us

"It's about Microsoft Excel"