Creating True OLEDB Connectivity
Posted on 2007-08-10
I have an application that needs to be able to connect to any OLEDB enabled database.
The application utilizes the MSDASC.dll connection screen to generate the connection strings. That works fine.
Currently, the various connection string fields are stored in the application's database "Provider", "Data Source", "UserID", "Initial Catalog", etc. So, when the user needs to connect to that database again, the application puts the connection string back together using each field. This also is working.
My problem is that I need a simple way to store all of the connection strings. If we continue to use this method for storing the connection strings, I'm going to have to write a routine to piece the connection string back together for every kind of OLEDB database that exists. (e.g. MS Access uses Provider, Data Source, User ID and Password while MS SQL uses Provider, Data Source, Initial Catalog, Integrated Security, etc)
This would kind of cut down on the connectability, as users would only be able to connect to platforms for which I had specifically written code.
Can anyone think of a better way to store and retreive the connection string information?
Thanks in advance,