PDA

Click to See Complete Forum and Search --> : Direct connect Oracle without ODBC


lamng
Nov 1st, 2000, 10:41 AM
Hi:

Is it possible to connect Oracle without ODBC or Sql Net using ADO?
I need to develop a vb application witch run on desktop, and no need to configure DSN or sql net.
My oracle 8i is install in a linux server, and client side running win98.

Thanks fro any help!
Lam

ShIzO
Nov 1st, 2000, 12:30 PM
oracle has it's own odbc tool you can use for remote connections.

btw: i think you can get microsoft ODBC to talk to oracle. you better check that.

Orpheus
Nov 2nd, 2000, 11:00 AM
If you do not wish to be configuring SQL Net for every database on every client, the accepted way is to configure Net/8 to use a central names server. You can then configure the names and locations of your databases in a central location and they will automatically propogate out to the clients.

You could use server host names in older versions of Oracle, however I have had a lot of problems making this work under 8i, hence the above solution. The older host name system also experienced problems when there was more than one instance of the Orale database server running on a single host.

Nov 3rd, 2000, 10:43 AM
yes it is possible to connect oracle without any odbc using ADO !!, but you allways need the oracle Client (Net8).

when you install the Oracle Client the setup install an Oracle-Provider too (the name of the componet in the setup.menue= Oracle Objects for OLE 8.x.x.x.x)

Sample for the connection if you have the Provider



Public Function GetConnOracle() As ADODB.Connection
On Error GoTo Err_GetConn

Dim cn As ADODB.Connection, strConnect As String, strUserId As String
Dim strDatabase As String, strServer As String

strConnect = "Provider=MSDAORA.1;Password=YourPassword;" & _
"User ID=YourUsername;Data Source=Database Alias (Declare in TNSNames.Ora)" & _
";Persist Security Info=True"

Set cn = New ADODB.Connection
cn.CursorLocation = adUseClient
cn.Open strConnect

Set GetConnOracle = cn
Set cn = Nothing

Exit Function

Err_GetConn:
Set cn = Nothing
Set GetConnOracle = Nothing
Select Case Err
Case Else: Err.Raise Err, "GNSDataImport.MGlobal.GetConnOracle", Err.Description
End Select

End Function