Error while connecting to sybase database using dbd:sybase

1k views Asked by At

I have compiled dbd-sybase module(1.07) to add it to my perl(5.12.3) on windows. However, when I trying to use it using following script:

use DBI;
DBD::Sybase;
 $ENV{SYBASE} = 'E:\Sybase';
 $ENV{SYBASE_OCS} = 'OCS-15_0';
$ENV{SYBASE_ASE} = 'ASE-15_0';
$SERVER="ABC";
$DATABASE="dadw";
$USER_NAME="";
$PASSWORD="";

$dbh = DBI->connect("dbi:Sybase:server=$SERVER;databse=$DATABASE",$USER_NAME, $PASSWORD);

I am getting following error message:

install_driver(Sybase) failed: DBD::Sybase initialize: cs_ctx_alloc(113) failed
at c:/perl/lib/DynaLoader.pm line 223.
Compilation failed in require at (eval 4) line 3.

 at b.pl line 11

Can someone help in solving this error message.

2

There are 2 answers

2
Mike Gardner On

It appears that the driver is using CT-Connect libraries, so I would guess it needs to have valid server information in the interfaces file.

On windows the file is usually located in C:/sybase/interfaces.ini

Check this answer for more details on creating interface file entries.

Using Sybase ASE BCP to a Remote Server

0
tricia On

In Sybase, the interfaces file in Windows is called sql.ini and it is located in the c:Sybase/ini/ folder.