Using a DSN with OldDB

  • Thread starter Thread starter M K
  • Start date Start date
M

M K

I currenlty have my .Net code using OleDB connections with Connection
Strings. I would like to switch over to using a DSN instead of having the
strings in my code. How can I do this? Do I have to change all my OleDB code
to ODBC?
 
Yup. If you want to use DSNs (for any reason) you'll have to switch to the
Odbc .NET Data Provider. Why not use UDLs?



--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Hi Mark,

You don't have to resort to the option of changing your code from OleDb to ODBC just because you don't want to use connection strings. Not sure why, but maybe for security
reasons I would imagine. Bill's suggestion to use a UDL file is excellent, however here are other option to where you can store your connection string:

- In Application configuration file.
- In the Windows Registry
- In a custom file
- In the COM+ catalog by using construction strings (for Serviced Components Only).

I'm sure selecting one of the above options is much easier than changing the code. By changing the code from OleDb to ODBC, you may run into issues where syntax
changes are required or issues related to the fact that you are using different provider (for example from Sqloledb provider to SQL Server ODBC driver) to communicate with
the back end database so heavy re-testing of the App is a must.

I hope this helps!


Thanks,
Hussein Abuthuraya
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
 
Back
Top