Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: Oracle Service Names
Oracle Service Names
Posted: 2008/01/29 03:38
 
Hi!

I want to get Oracle service names before I connect. It is managed to me but only when I connected. My function listed below. Anyone can help me?




Function TForm1.GetServiceNames(Con : TADConnection) : String;
Var FConnectionDef: IADStanConnectionDef;
oMeta: IADPhysManagerMetadata;
oDrv: IADPhysDriverMetadata;
i : Integer;
iLogin: Integer;
sName, sType, sDef, sCaption: String;

begin
Result:='';
FConnectionDef:=Con.ResultConnectionDef;
ADPhysManager.CreateMetadata(oMeta);
oMeta.CreateDriverMetadata(FConnectionDef.DriverID, oDrv);
for i := 0 to oDrv.GetConnParamCount(FConnectionDef.Params) - 1 do
begin
oDrv.GetConnParams(FConnectionDef.Params, i, sName, sType, sDef, sCaption, iLogin);
if (iLogin <> -1) and (LowerCase(sCaption)='service') then
begin
Result:=sType;
end;
en
Re:Oracle Service Names
Posted: 2008/01/29 03:44
 
Try following code smaple:

 uses   daADPhysOraclWrapper; .....   oLib := TOCILib.Create(''''nil);   try     oLib.GetTNSServicesList(ListBox1.Items);   finally     oLib.Free;   end;

Re:Oracle Service Names
Posted: 2008/01/29 03:53
 
Hi Diman!

Thx 4 the fast answer!!!!!!!!!