Subject Re: [IBO] Specifying a Port #
Author Helen Borrie
At 01:42 AM 16/08/2005 +0000, you wrote:
>Hi All,
>
>I've been trying to specify a port other than 3050 for connections and
>haven't found a working solution yet. I've changed the firebird.conf
>to use port 3051 but my connections don't work.
>
>TIB_Connection1.Server := (MyServer + '/' + IntToStr(3051) + ':');

This is wrong. Leave the colon off the end. And make sure you have valid
settings for Protocol and Path. This is how it works:

Server: 'Hostname/nnnn'
Path: 'd:\databases\MyDB.fdb'
Protocol: cpTCP_IP

IBO constructs these properties in the correct connection string for the
given protocol In this case it will be 'Hostname/nnnn:d:\databases\MyDB.fdb'


>I also need to use TIBOBackupService, TIBORestoreService, and
>TIBOValidationService. Could someone please give me a working example
>of how to specify a connection string using a different port for these
>components?

It's just the same, except the Server property applies to the service.

>What properties need to be set and what is the syntax?
>Since the components don't have a ConnectionString property, it isn't
>clear how this is done.

There's no "Connectionstring" property, anyway. A service only has to
connect to a server. Actually, as well as the surfaced properties, the
service comps also have the old Params property as a legacy from the
BDE. The allowed values for the Params (a stringlist) are -- annoyingly! -
not documented anywhere, so it's a case of wild guessing. You can mix and
match if need be. There does seem to be a bit of a bug in some of the
IBOAdmin comps, where the Params are sought and the properties
ignored. Hence why the following code has a bit of both:

procedure TfrmMain.btnAddUserClick(Sender: TObject);
begin
with ss do // ss is an IBOSecurityService object
begin
Params.Add('USER_NAME=' + edtLoginName.Text);
Params.Add('PASSWORD=' + edtLoginPswd.Text);
ServerName := ibc.Server;
UserName := edtAddUser.Text;
Password := edtAddUserPswd.Text;
Protocol := ibc.Protocol;
LoginPrompt := False; // this is important if you are supplying login
params
try
Attach;
try
if not Active then
begin
Active :=True;
ServiceStart;
end; // required logic here might vary depending on how you want
it to work
AddUser;
MessageDlg('User added successfully', mtInformation, [mbOK], 0);
except
ibc.IB_Session.HandleException(Sender);
SysUtils.Abort;
end;
finally
Detach;
end;
end;
end;

Be aware that, even though you are specifying the alternative port, it
isn't going to work unless 1) the Firebird service is actually listening on
that port; and
2) port 3051 is opened in the firewall for the part of the network that
needs to access it.

For 1) (which you can do via firebird.conf) follow the instructions in the
Fb 1.5 release notes, "Configuring the Port Service on Client and Server"
(starting at P. 58).
For 2) since your wire access to the server is limited, you'll have to
enlist the aid of the server admin.

Following your postings in fb-support, you are also going to have to deal
with the problem of your application users looking for a client named
"gds32.dll" in their <system32> directory. If they are actually still
running apps that have to access IB 7.1 then they will need to find the IB
client library of that name in that location. Your Firebird apps have to
find the Firebird client, which means either
a) they have to find fbclient.dll; or
b) they have to find an fbclient.dll renamed to gds32.dll in a path that
the system reads before it reads <system32>.

For a) this topic has been covered over and over in this list.
For b) you'll have to cut your coat to suit the cloth. If your users have
(or might have) multiple apps that need to access Firebird databases, put
your client library in its own path somewhere on the C drive and prepend
this location to the user's PATH environment variable and/or compile your
apps to load the client from there. If there's only one app, or you'll
have all the executables in one directory, put the client library there.

Helen