Connect to an Oracle 10g database with Microsoft ODBC for Oracle

后端 未结 3 764
余生分开走
余生分开走 2020-12-18 09:49

I\'m trying to connect to an Oracle 10g database using the built in Microsoft ODBC for Oracle driver. I want to use an dnsless connection, so I grab my connection string fr

相关标签:
3条回答
  • 2020-12-18 10:06

    I'm not sure how kosher it is to answer your own question, but I found a connection string that is more what I'm looking for:

    "Driver={Microsoft ODBC for Oracle}; " & _
                                     "CONNECTSTRING=(DESCRIPTION=" & _
                                     "(ADDRESS=(PROTOCOL=TCP)" & _
                                     "(HOST=myserver)(PORT=1521))" & _
                                     "(CONNECT_DATA=(SERVICE_NAME=servicename))); " & _
                                     "uid=username;pwd=password;
    
    0 讨论(0)
  • 2020-12-18 10:18

    With 10g, you can use the EZCONNECT feature. To connect to an Oracle instance named ORCL on the server myServer, the connection string would look like this :

    Driver={Microsoft ODBC for Oracle};Server=myServer:1521/ORCL;Uid=myUsername;Pwd=myPassword;
    
    0 讨论(0)
  • 2020-12-18 10:20

    You need to add an entry in your tnsnames.ora file for the service to which you want to connect. Alternatively, you can go to the gui interface for that file at

    Start->Programs->Oracle->Configuration and Migration Tools->Net Configuration Assistant
    

    and set up your oracle connection there. Then, ODBC will be able to resolve the service name.

    0 讨论(0)
提交回复
热议问题