Connection strings for Oracle

You can use these alternative connection strings to connect to your Oracle Database. These are useful if you have a connection problem or if you use another driver for example ODBC or OLE DB.

.NET Oracle connection providers

Standard Security:

Connection string type:Oracle
Connection string:Data Source=MyOracleDB; User Id=myUsername;Password=myPassword;

Trusted Connection:

  • OS Authenticated connection ('Id=/'):
    Connection string type:Oracle
    Connection string:Data Source=MyOracleDB;User Id=/;Password=;

  • OS Authenticated connection using OSAuthent:
    Connection string type:Oracle
    Connection string:Data Source=MyOracleDB;OSAuthent=1;

ODBC Driver for Oracle

Using the current ODBC driver from Microsoft:

Connection string type:ODBC
Connection string:Driver={Microsoft ODBC for Oracle};Server=OracleServer.world; Uid=MyUsername;Pwd=MyPassword;

Using the older ODBC driver from Microsoft:

Connection string type:ODBC
Connection string:Driver={Microsoft ODBC Driver for Oracle};ConnectString=OracleServer.world;Uid=myUsername;Pwd=myPassword;

OLE DB Provider for Oracle

Standard Security:

Connection string type:OLE DB
Connection string:Provider=OraOLEDB.Oracle;Data Source=MyOracleDB; User Id=myUsername;Password=myPassword;

Trusted Connection:

  • OS Authenticated connection ('Id=/'):
    Connection string type:OLE DB
    Connection string:Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=/;Password=;

  • OS Authenticated connection using OSAuthent:
    Connection string type:OLE DB
    Connection string:Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;OSAuthent=1;

Info: Please provide the 'Data Source=' a Net8 name which uses a standard naming method like Local Naming or Oracle Names. Local Naming is the alias in the tnsnames.ora file. The Oracle Name is the Net8 Service name.

More information