Page 1 of 1

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

Posted: 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

Posted: Fri 05 Aug 2011 11:46
by AlexP
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.

Posted: 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

Posted: Fri 05 Aug 2011 12:26
by AlexP
Hello,

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