|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ADO.net and VC++.net 2005I'm writing a VC++.net 2005 application and i would like to use the ODBC connector. I would like to allow user to choose the DB he wants to have (MS SQL, PostgreSQl, MySQL, Oracle,...) by choosing the write ODBC driver. After that, i want to create a system DSN with information enter by user. But how can i do that ? i did not find something in OdbcConnection for creating a system DSN. do you have some information regarding this topic ? 1. i would like to display all ODBC driver available (like that user can choose 2. after chosing ODBC driver and setting up connectionstring data, application should create a Systen DSN. thanks for help. Maileen The DSN is largely a dead concept. All a DSN file is is the connection string
in a specific format. If you mean system or user DSN, which is this information stored in the system, I am sure there are APIs to set that up. There are also much better methods of generic data access than ODBC, unless you will have to support an ODBC only data source (there are some, but most, including most open source databases, have OLEDB providers). As ODBC is slower, I would consider carefully whether it is the best way to go. It may be, in your instance, but examine the choices. To create a generic layer, whether ODBC or OLEDB, you can simply use connection strings. There is no reason to create the additional overhead of a DSN, at least not in the majority of applications, so you should also examine this direction. For system DSNs, if you are sure that is your correct direction, I would look at the platform SDK, as there is likely an interface to store system DSNs somewhere in the SDK. This link shows how to do this in C++, but it is not a managed solution: http://www.codeguru.com/Cpp/data/mfc_database/microsoftaccess/article.php/c4345/ -- Show quoteGregory A. Beamer MVP; MCP: +I, SE, SD, DBA *************************** Think Outside the Box! *************************** "Maileen" wrote: > Hi, > > I'm writing a VC++.net 2005 application and i would like to use the ODBC > connector. > > I would like to allow user to choose the DB he wants to have (MS SQL, > PostgreSQl, MySQL, Oracle,...) by choosing the write ODBC driver. > After that, i want to create a system DSN with information enter by user. > > But how can i do that ? > > i did not find something in OdbcConnection for creating a system DSN. > do you have some information regarding this topic ? > > 1. i would like to display all ODBC driver available (like that user can > choose > 2. after chosing ODBC driver and setting up connectionstring data, > application should create a Systen DSN. > > thanks for help. > > Maileen > |
|||||||||||||||||||||||