PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
DSN, Check if exists
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
DSN, Check if exists
![]() |
DSN, Check if exists |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
My application needs to run at many different sites and I need to depend on
a DSN set up by another application, so I want to check for the DSN's existance right up front before bothering to do anything else. I found this link http://groups.google.com/group/micr...work.odbcnet/br owse_thread/thread/5fe8e285241d87a/f6b7bb38bced6cb9? lnk=st&q=.net+check+if+dsn+exists&rnum=1&hl=en#f6b7bb38bced6cb9 Where Paul provided a great example of how to grab the list of all DSNs and then walk through the list. Is there better way in VS05 to check for a single DSN? Thanks, Bernie |
|
|
|
#2 |
|
Guest
Posts: n/a
|
On Sun, 09 Apr 2006 07:26:49 -0700, Bernie Hunt <bhunt@optonline.net> wrote:
¤ My application needs to run at many different sites and I need to depend on ¤ a DSN set up by another application, so I want to check for the DSN's ¤ existance right up front before bothering to do anything else. ¤ ¤ I found this link ¤ http://groups.google.com/group/micr...work.odbcnet/br ¤ owse_thread/thread/5fe8e285241d87a/f6b7bb38bced6cb9? ¤ lnk=st&q=.net+check+if+dsn+exists&rnum=1&hl=en#f6b7bb38bced6cb9 ¤ ¤ Where Paul provided a great example of how to grab the list of all DSNs and ¤ then walk through the list. ¤ ¤ Is there better way in VS05 to check for a single DSN? The only other way I know of would be to query the Registry sub key (with your DSN name) under: HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI Paul ~~~~ Microsoft MVP (Visual Basic) |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Thanks Paul!
I'll stick with your previous example. It works fine and doesn't take a lot of time. Bernie Paul Clement <UseAdddressAtEndofMessage@swspectrum.com> wrote in news:58pk329r1f22js6ntmv5i8o3okrpergm4j@4ax.com: > On Sun, 09 Apr 2006 07:26:49 -0700, Bernie Hunt <bhunt@optonline.net> > wrote: > > ¤ My application needs to run at many different sites and I need to > depend on ¤ a DSN set up by another application, so I want to check > for the DSN's ¤ existance right up front before bothering to do > anything else. ¤ > ¤ I found this link > ¤ http://groups.google.com/group/micr....framework.odbc > net/br ¤ owse_thread/thread/5fe8e285241d87a/f6b7bb38bced6cb9? > ¤ lnk=st&q=.net+check+if+dsn+exists&rnum=1&hl=en#f6b7bb38bced6cb9 > ¤ > ¤ Where Paul provided a great example of how to grab the list of all > DSNs and ¤ then walk through the list. > ¤ > ¤ Is there better way in VS05 to check for a single DSN? > > The only other way I know of would be to query the Registry sub key > (with your DSN name) under: > > HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI > > > Paul > ~~~~ > Microsoft MVP (Visual Basic) > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

