KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

ODBC in a different Machine #2523

Open paulo opened this topic on on Jan 6, 2022 - 8 comments

paulo commented on Jan 6, 2022

Hi there, this is a random question which I don't really know if it makes sense technically speaking.

I am using reporting without any issues with MySql. Challenge starts when connecting to Interbase. So, my local machine is on Windows. My Interbase Machine is on Windows. However, my application runs on Ubuntu.
I was able to create an ODBC on my local machine and connect KoolReport using my localmachine through ODBC to the Interbase database server and pull a report. However, ODBC and Interbase on Ubuntu don't seem to talk/easy task... I tried different ways, tried to use thirds party drivers etc

Is there a way KeepReport can connect to a 'remote' ODBC driver/machine? If it would be possible, I would have an ODBC installed on a windows machine, and KoolReport running on Ubuntu would connect to that remove machine for connection. It would be a bit slow, but at least I would get what I need done :)

thank you very much and sorry for the random question Paulo

Sebastian Morales commented on Jan 7, 2022

Can you install pdo firebird extension for your Ubuntu's PHP and create a pdo connection to your remote Interbase?

paulo commented on Jan 7, 2022

Thank you very much for your response, and sorry again for the random question. This is the challenge I am finding, Interbase is so complicated, I can't find anywhere a place to download the PDO extension and the ones I tried on my Window it didn't work. Mysql is not a problem, very straight forward, but this Interbase seems SOOO old and complicated ! any ideas / help would be appreciated? I think the extension needs to match exactly the version of interbase. Do you recommend a firebird extension ? I can give it a try again. thanks

Sebastian Morales commented on Jan 10, 2022

I think it depends on your Interbase and PHP Firebird extension versions. But yes, we would suggest you trying to connect to Interbase with PHP Firebird.

paulo commented on Jan 12, 2022

Thanks, ok on Ubuntu, I ran : foreach (PDO::getAvailableDrivers() as $driver) {

            Log::debug("TRAMSTESTPDO ==== $driver");
        }

And I get firebird as available driver. When I try to run a report I get the error "SQLSTATE[HY000] [335544721] Unable to complete network request to host "c"." Under the line ConnectionString:

        $this->connection = new PDO(
            $connectionString,
            $username,
            $password,
            $options
        );
        PdoDataSource::$connections[$key] = $this->connection;

My Connection String: firebird:host=IP;dbname=c:\ProgramData\Trams\Database\trams.ib;charset=UTF8 where IP is the IP of the server. I also tried path: c:/ProgramData/Trams/Database/trams.ib;charset=UTF8 it didn't work.

WINDOWS Same code. but I am getting: "SQLSTATE[HY000] [335544721] Unable to complete network request to host "xnet://Global\FIREBIRD"."

thank you very much for your help! Paulo

Sebastian Morales commented on Jan 13, 2022

Hi Paulo, pls try the following connection string format:

$connectionString = "firebird:dbname=hostname/port:/path/to/dbfile.ext";

For example:

$connectionString = "firebird:dbname=127.0.0.1:C:/PATH/DBNAME.ib"; //127.0.0.1 for localhost, replace it with your db server's ip; use forward slash / instead of \ in path
$connectionString = "firebird:dbname=localhost/3050:/path/to/db.fdb"; // 3050 is the port
paulo commented on Jan 13, 2022

thanks a lot. It seems we are getting closer - both systems now (Windows and Ubuntu) shows the error message: ""SQLSTATE[HY000] [335544421] connection rejected by remote interface""

I guess it would be some sort of settings on the server side? I can ping the IP address, I can load things using API...

thanks any help is appreciated!

Sebastian Morales commented on Jan 14, 2022

Pls check that the port which you use is not blocked by firewall as well as make sure that the db file path, username, and password are all correct case sensitively. Finally, check for WireCrypt option on both your db server and firebird client. Rgds,

paulo commented on Jan 14, 2022

Thank you. I will check those things !

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None