Subject Problems using DatabaseName with aliases
Author pcalin@rdsor.ro
Hello everyone.

I've encountered a problem converting an old app to IBO4 related to
DatabaseName and aliases.

If I set the databasename to an alias on the local machine it does
not set the path and database property. This means that you cannot
connect to the database if you are using an alias as long as you use
DatabaseName.

After looking through the code I found this in IB_Components:

procedure TIB_Connection.SetDatabaseName( const AValue: string );
var
tmpCN: TIB_Connection;
ii: integer;
begin
if ( Pos( '.', AValue ) > 0 ) or
( Pos( '\', AValue ) > 0 ) or
( Pos( ':', AValue ) > 0 ) or
( Pos( '@', AValue ) > 0 ) then
begin
Database := AValue;
FDatabaseName := '';
end
else
if FDatabaseName <> AValue then
...
end;

In my case the alias is 'mydb' and it does not contain any of those
characters.

Does anyone know of a reason why the Database preperty is not set
whenever you change the DatabaseName?

If I set the database property to 'C:\ThisDBdoesnotexist' and then
set the DatabaseName to a correct alias ('myDB') then IB_connection
will try to connect to the old invalid
database 'C:\ThisDBdoesnotexist'.

I think this is wrong and I would like to understand why there is a
condition there.
Why not set the Database property all the time, regardless of
DatabaseName?

Thank you,
Ciao.