Click to See Complete Forum and Search --> : ADO, ODBC, SQLServer/Oracle


Murugan Kannan
July 3rd, 2001, 10:39 AM
Question regarding accessing SQL Server and Oracle from VB via ADO.
Do I have to hardwire the connection string (.open = "provider=oracle/sqlserver blah blah) based on the database I am connecting to?
Is there any GOOD ODBC Driver that talks both to SQL server and Oracle?

Reason is, I may not know which database I am talking to.
How do I go about doing it via ADO?

Thanks much.

dfwade
July 3rd, 2001, 12:26 PM
Is there any GOOD ODBC Driver that talks both to SQL server and Oracle? NO, drivers only talk to one database. DO NOT hard code your connection string if you have to support multiple databases. It it not a good way to do it in any case, as the database infor may change. Use a FILE DSN so that you can change the configuration parameters. You might want to consider using a command line switch to select the database. Or ask for the type of database in an installation script and then write the information to the registry and read it when you come back in.
Hope this helps

Murugan Kannan
July 5th, 2001, 09:27 AM
Thanks.
I was wondering hardwiring via OLEDB or to go via
ODBC/DSN. As a database newbie, I was overwhelmingly suggested to go with ODBC.
Thanks again.