Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / April 2006

Tip: Looking for answers? Try searching our database.

DSN, Check if exists

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bernie Hunt - 09 Apr 2006 15:26 GMT
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
Paul Clement - 10 Apr 2006 15:03 GMT
¤ 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)
Bernie Hunt - 10 Apr 2006 16:40 GMT
Thanks Paul!

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

Bernie

> ¤ 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
[quoted text clipped - 18 lines]
> ~~~~
> Microsoft MVP (Visual Basic)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.