I don't normally use Perl, but with some trial and error I installed DBD::Firebird and made a small test saved as connect.pl
:
use DBI;
$dbh = DBI->connect("dbi:Firebird:db=employee;host=localhost", "sysdba", "masterkey");
$sth = $dbh->prepare("SELECT country, currency FROM country");
$sth->execute();
while ( @row = $sth->fetchrow_array ) {
print "@row\n";
}
If I don't have the 32 bit fbclient.dll
installed, then perl connect.pl
results in an error:
install_driver(Firebird) failed: Can't load 'D:/DevSoft/Strawberry/perl/site/lib/auto/DBD/Firebird/Firebird.xs.dll' for module DBD::Firebird: load_file:The specified module could not be found at D:/DevSoft/Strawberry/perl/lib/DynaLoader.pm line 193.
at (eval 8) line 3.
Compilation failed in require at (eval 8) line 3.
Perhaps a required shared library or dll isn't installed where expected
at connect.pl line 3.
With the 32 bit fbclient.dll
installed, then this works (result is the COUNTRY
table of the Employee example database included with Firebird):
USA Dollar
England Pound
Canada CdnDlr
Switzerland SFranc
Japan Yen
Italy Euro
France Euro
Germany Euro
Australia ADollar
Hong Kong HKDollar
Netherlands Euro
Belgium Euro
Austria Euro
Fiji FDollar
Russia Ruble
Romania RLeu
To install the 32 bit fbclient.dll, you can do one of the following:
- Download and run the 32 bit installer for Firebird, and use the 'Minimum client install - no server, no tools' installation option;
- If you already have a 64 bit Firebird installed on your machine, then open an Administrator Command Prompt, and go to the
SysWoW64
folder of your Firebird install (this folder contains the 32 bit client library), and execute instclient i f
;
- Download and unzip the 32 bit Firebird zip kit, open an Administrator Command Prompt and go to the location of the unzipped zip kit, and execute
instclient i f
.