set Databasename in IBXquery inside report at runtime
Hello,
Im am using a IBXDatabse inside FastReport. The Database can be installed anywhere and correct hostname/databasenae are only known at runtime.
I Use this code to set the connection-parameters:
When I start the Report I see the message showmessage( <Hostname>+':'+<DBName>); with the correct values but after that there is an exception "Databasename not defined in IBXDatabase1".
If I define a "dummy" databasename in IBXDatabase1 the exception is "can not open file [dummy-filenam]".
IBXDatabase1 is set conected=false in the report-template, so I don't know why FastReport tries to connect it without or before the code runs.
How to setup the report so that it does open the database AFTER setting the right databasename?
Regards,
Siegbert
Im am using a IBXDatabse inside FastReport. The Database can be installed anywhere and correct hostname/databasenae are only known at runtime.
I Use this code to set the connection-parameters:
begin
showmessage( <Hostname>+':'+<DBName>);
  IBXDatabase1.connected:=false;
  if <Hostname>='' then
    IBXDatabase1.DatabaseName := <DBName>
  else
    IBXDatabase1.DatabaseName := <Hostname>+':'+<DBName>;     Â
  IBXDatabase1.connected:=true;                           Â
end.
When I start the Report I see the message showmessage( <Hostname>+':'+<DBName>); with the correct values but after that there is an exception "Databasename not defined in IBXDatabase1".
If I define a "dummy" databasename in IBXDatabase1 the exception is "can not open file [dummy-filenam]".
IBXDatabase1 is set conected=false in the report-template, so I don't know why FastReport tries to connect it without or before the code runs.
How to setup the report so that it does open the database AFTER setting the right databasename?
Regards,
Siegbert
Comments