PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at mbay dot net>
Subject: Sybase SQL Anywhere and Perl
Date: Apr 30 1998 8:58PM

goutam writes:
 > 
 > 
 > Dear All,
 > 
 >  I don't have any idea of Open Server gateway. Is it a free product or
 > ships with Sybase or so on..
 > Connecting using the DBI or DBD might require OSG .
 > 
 > I have Sybase Sql Anywhere server on NT 4.0
 > 
 > How about using Perl WinODBC ?
 > Pls. help...
 > 
 > I have written the following script :
 > 
 > use DBI::Sybase;
 > BEGIN  {
 >    $ENV{SYBASE} = "d:\sybase";
 >   }
 > 
 > #sybase is residing in d directory
 > 
 > my $dbh=connect("dbi:sybase:db_server","dba","sql");
 > 
 > The following error occurs :
 > 
 > Open Client Message :
 > Message Number : Layer=(1) ORIGIN=(1) SEVERITY=(4) NUMBER=(118)
 > Message String : it_init():Unable to find file
 >            D:sybase\locales\english\cp850\ctlib.loc
 > 
 > An Exception occurs & program is terminated.

Try moving the BEGIN {} block before use DBI. Somthing like:

#!/usr/local/bin/perl -w

use strict;

BEGIN {
	$ENV{SYBASE} = "d:\sybase";
}

use DBI;

my $dbh = DBI->connect('dbi:Sybase:db_server', $user, $pwd);

etc...

where db_server is the name of your SQL Anywhere server should work, I 
think (I don't use SQL Any. myself (although I have it sitting on a
shelf here - courtesy of the International Sybase User Group :-)

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@datamig.com    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com