Dim OraStr As String = "Data Source=Oracle8i;Integrated Security=yes"

OR

dim OraStr As String = "Provider=""MSDAORA.1"";User ID=dev;Data Source=testdb;Password=dev"

I am using oracle8i but that should be provider shouldn't it? the MSDAORA.1 is for the OLEDB so I assume it is wrong also. Any Ideas?

Dani AI

Generated

— the two styles shown in the thread come from different providers/technologies (one is a simple Data Source style, the other is an explicit OLE DB provider). The Microsoft OLE DB provider for Oracle (MSDAORA) is old, has known limitations and was never produced as a 64‑bit provider; it is not recommended for modern apps. (ftp.zx.net.nz)

For .NET projects prefer Oracle-supplied drivers instead of MSDAORA. The two sensible choices today are:

  • ODP.NET (Oracle Data Provider for .NET) — use the managed driver (Oracle.ManagedDataAccess) when possible because it is AnyCPU, easier to deploy, and avoids needing a full Oracle client on the machine. (docs.oracle.com)
  • Oracle Provider for OLE DB (OraOLEDB.Oracle) when you must use OLE DB. Also note Microsoft’s built-in System.Data.OracleClient has been deprecated; Microsoft recommends third‑party/Oracle providers. (learn.microsoft.com)

Practical connection examples (change host/port/service/user/password to your values):

' ODP.NET managed (recommended for .NET)
Dim cs1 As String = "User Id=MYUSER;Password=MyPass;Data Source=//dbhost:1521/ORCLPDB1"
' Oracle OLE DB provider (if you need OLE DB)
Dim cs2 As String = "Provider=OraOLEDB.Oracle;User Id=MYUSER;Password=MyPass;Data Source=ORCL_ALIAS;OLEDB.NET=True"

(ODP.NET accepts TNS alias, full DESCRIPTION strings, or EZCONNECT-style //host:port/service; see Oracle docs for examples.) (docs.oracle.com)

Quick troubleshooting checklist:

  • If your app runs 64‑bit and you try MSDAORA you’ll typically get "provider not registered" errors — use Oracle’s provider or run the process as 32‑bit. (stackoverflow.com)
  • For unmanaged Oracle providers install the matching Oracle client/ODAC (32 vs 64 bit must match the process). For the managed ODP.NET driver you usually only need the managed DLL (NuGet or XCopy). (docs.oracle.com)

As suggested, ODBC is a viable fallback, but for .NET apps ODP.NET (managed) gives the best compatibility and performance for modern Oracle versions.

Here is an awesome site for Connection Strings (under Technology)

Here is the ODBC Method:

' VB.NET
Imports System.Data.Odbc
...
	Dim oODBCConnection As OdbcConnection
	Dim sConnString As String = _
			 "Driver={Microsoft ODBC for Oracle};" & _
			 "Server=OracleServer.world;" & _
			 "Uid=myUsername;" & _
			 "Pwd=myPassword"
oODBCConnection = New Odbc.OdbcConnection(sConnString)
oODBCConnection.Open()

On the MVP site there is a like to an Oracle Add-in for .NET for use...check it out.

:cool:

Dim OraStr As String = "Data Source=Oracle8i;Integrated Security=yes"

OR

dim OraStr As String = "Provider=""MSDAORA.1"";User ID=dev;Data Source=testdb;Password=dev"

I am using oracle8i but that should be provider shouldn't it? the MSDAORA.1 is for the OLEDB so I assume it is wrong also. Any Ideas?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.