Click to See Complete Forum and Search --> : How to start DSN window and get ODBC names?


Andi
January 2nd, 2005, 12:05 PM
hi all,

i am searching for a while and havenīt found the solution.....

is there a way to open the DSN administrator window and receive the selected ODBC name (or better all the ODBC source infos)?

if yes.....please let me know how.

thanx al ot,
andi

mmetzger
January 2nd, 2005, 01:38 PM
Yeah, it's pretty easy. Just create a .udl file at a given location and do a Process.Start on it. It will startup the DSN Admin and let the user configure it.

You can then use the UDL file to create your db connection.

Andi
January 3rd, 2005, 02:36 AM
hi mmetzger,

thank you for your response!

i have never heard from udl files....whatīs that and how can i do this?

thanx a lot!
andi

mmetzger
January 3rd, 2005, 08:30 AM
I forget the exact acronym, but it's something like "Universal Data Language" or some such. To see what they do, just right click on the desktop and choose "Create text document" but rename it to test.udl. Double click on it and it will start the DSN wizard. You can do the same thing in code to create them via the method I described previously. If you look in the OleDb Connection object, there's a constructor that can reference a UDL file for creating the db connection.

Andi
January 3rd, 2005, 10:46 AM
ok, thanx a lot!

regards,
andi