CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 1999
    Location
    Pittsburgh
    Posts
    16

    ADO, ODBC, SQLServer/Oracle

    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.



  2. #2
    Join Date
    Aug 2000
    Location
    KY
    Posts
    766

    Re: ADO, ODBC, SQLServer/Oracle

    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





  3. #3
    Join Date
    Nov 1999
    Location
    Pittsburgh
    Posts
    16

    Re: ADO, ODBC, SQLServer/Oracle

    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.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured