Home All Groups Group Topic Archive Search About
Author
9 Apr 2006 2:26 PM
Bernie Hunt
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/microsoft.public.dotnet.framework.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

Author
10 Apr 2006 2:03 PM
Paul Clement
On Sun, 09 Apr 2006 07:26:49 -0700, Bernie Hunt <bh***@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/microsoft.public.dotnet.framework.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)
Author
10 Apr 2006 3:40 PM
Bernie Hunt
Thanks Paul!

I'll stick with your previous example. It works fine and doesn't take a
lot of time.

Bernie



Paul Clement <UseAdddressAtEndofMess***@swspectrum.com> wrote in
Show quote
news:58pk329r1f22js6ntmv5i8o3okrpergm4j@4ax.com:

> On Sun, 09 Apr 2006 07:26:49 -0700, Bernie Hunt <bh***@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/microsoft.public.dotnet.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)
>

AddThis Social Bookmark Button