How to connect with oracle ... using ip:port:service

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
[email protected]
Posts: 3
Joined: Fri 05 Aug 2011 10:36

How to connect with oracle ... using ip:port:service

Post by [email protected] » Fri 05 Aug 2011 11:02

How can I connect to Oracle withi uniDac
The connect dialog does NOT offer Port nor has a field for service ....

I have to connect to 192.168.200.30 Port 1521 Service BELVIS

Thanx

Beat

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Fri 05 Aug 2011 11:46

Hello,


You should use the Direct mode by setting TUniConnection in the following way:

Code: Select all

var
  UniConnection: TUniConnection;
begin
  UniConnection := TUniConnection.Create(nil);
  UniConnection.ProviderName := 'Oracle';
  UniConnection.SpecificOptions.Values['Direct'] := 'True';
// SID
  UniConnection.Server:= '192.168.200.30:1521:BELVIS';
//or
// Service Name
  UniConnection.Server:= '192.168.200.30:1521:sn=BELVIS';
  UniConnection.Username := 'scott';
  UniConnection.Password := 'tiger';
  UniConnection.Connect;
You can get more detailed information in the UniDAC help, the Using UniDAC with Oracle.Connecting in Direct mode topic.

[email protected]
Posts: 3
Joined: Fri 05 Aug 2011 10:36

Post by [email protected] » Fri 05 Aug 2011 12:18

Hi Alex

Whow, that was quick !

I tried to give port and service within the server string ... but obviousely the 'Direct' was missing!

It works - and now I found the option on uniConnection component setup page two ...

thanx a lot!

Regards from Germany
Beat

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Fri 05 Aug 2011 12:26

Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.

Post Reply