Ver Fonte

* Publish and observe port

git-svn-id: trunk@35419 -
michael há 8 anos atrás
pai
commit
faa70adcd3
1 ficheiros alterados com 12 adições e 2 exclusões
  1. 12 2
      packages/fcl-db/src/sqldb/interbase/ibconnection.pp

+ 12 - 2
packages/fcl-db/src/sqldb/interbase/ibconnection.pp

@@ -131,6 +131,7 @@ type
     property LoginPrompt;
     property LoginPrompt;
     property Params;
     property Params;
     property OnLogin;
     property OnLogin;
+    Property Port;
   end;
   end;
   
   
   { TIBConnectionDef }
   { TIBConnectionDef }
@@ -611,6 +612,8 @@ procedure TIBConnection.ConnectFB;
 var
 var
   ADatabaseName: String;
   ADatabaseName: String;
   DPB: string;
   DPB: string;
+  HN : String;
+  
 begin
 begin
   DPB := chr(isc_dpb_version1);
   DPB := chr(isc_dpb_version1);
   if (UserName <> '') then
   if (UserName <> '') then
@@ -625,8 +628,15 @@ begin
     DPB := DPB + Chr(isc_dpb_lc_ctype) + Chr(Length(CharSet)) + CharSet;
     DPB := DPB + Chr(isc_dpb_lc_ctype) + Chr(Length(CharSet)) + CharSet;
 
 
   FDatabaseHandle := nil;
   FDatabaseHandle := nil;
-  if HostName <> '' then ADatabaseName := HostName+':'+DatabaseName
-    else ADatabaseName := DatabaseName;
+  HN:=HostName;
+  if HN <> '' then 
+    begin
+    if Port<>0 then
+      HN:=HN+'/'+IntToStr(Port);
+    ADatabaseName := HN+':'+DatabaseName
+    end
+  else 
+    ADatabaseName := DatabaseName;
   if isc_attach_database(@FStatus[0], Length(ADatabaseName), @ADatabaseName[1],
   if isc_attach_database(@FStatus[0], Length(ADatabaseName), @ADatabaseName[1],
     @FDatabaseHandle, Length(DPB), @DPB[1]) <> 0 then
     @FDatabaseHandle, Length(DPB), @DPB[1]) <> 0 then
     CheckError('DoInternalConnect', FStatus);
     CheckError('DoInternalConnect', FStatus);