DBI:Sybase connect error
am 29.08.2007 16:32:16 von andrea.visinoni
I'm trying to log into a sql server 2005 express through perl using
DBI and DBD::Sybase module.
this is my freetds.conf file (located under /etc/freetds/freetds.conf)
[MyServer70]
host = 10.0.2.12
port = 1449
tds version = 7.0
running this simple script:
#!/usr/bin/perl
use DBI ;
$user = 'test_user' ;
$passwd = 'aaa' ;
$dbh = DBI->connect('DBI:Sybase:server=MyServer70', $user, $passwd);
i get:
DBI connect('server=MyServer70','test_user',...) failed: (no error
string) at test2.pl line 8
but if i call:
tsql -S MyServer70 -U test_user -I /etc/freetds/freetds.conf
or
tsql -H 10.0.2.12 -p 1449 -U test_user
i can successfully connect on the DB.
where is my problem?
thanks Andrea
Re: DBI:Sybase connect error
am 30.08.2007 05:46:58 von Ow.Mun.Heng
On Wed, 2007-08-29 at 14:32 +0000, vizzz wrote:
> I'm trying to log into a sql server 2005 express through perl using
> DBI and DBD::Sybase module.
> this is my freetds.conf file (located under /etc/freetds/freetds.conf)
>
> [MyServer70]
> host = 10.0.2.12
> port = 1449
> tds version = 7.0
>
> running this simple script:
>
> #!/usr/bin/perl
>
> use DBI ;
> $user = 'test_user' ;
> $passwd = 'aaa' ;
>
> $dbh = DBI->connect('DBI:Sybase:server=MyServer70', $user, $passwd);
Do you need freetds? I (think) i'm connecting natively using Sybase..
$dbh = DBI->connect
(
"DBI:Sybase:host=$mssql_server_name;
port=$mssql_server_port,
database=$mssql_default_db",
$mssql_user, $mssql_passwd,
{RaiseError => 0, PrintError => 0}
)
Re: DBI:Sybase connect error
am 30.08.2007 08:34:52 von andrea.visinoni
On 30 Ago, 05:46, Ow.Mun.H...@wdc.com (Ow Mun Heng) wrote:
> On Wed, 2007-08-29 at 14:32 +0000, vizzz wrote:
> > I'm trying to log into a sql server 2005 express through perl using
> > DBI and DBD::Sybase module.
> > this is my freetds.conf file (located under /etc/freetds/freetds.conf)
>
> > [MyServer70]
> > host = 10.0.2.12
> > port = 1449
> > tds version = 7.0
>
> > running this simple script:
>
> > #!/usr/bin/perl
>
> > use DBI ;
> > $user = 'test_user' ;
> > $passwd = 'aaa' ;
>
> > $dbh = DBI->connect('DBI:Sybase:server=MyServer70', $user, $passwd);
>
> Do you need freetds? I (think) i'm connecting natively using Sybase..
>
> $dbh = DBI->connect
> (
> "DBI:Sybase:host=$mssql_server_name;
> port=$mssql_server_port,
> database=$mssql_default_db",
> $mssql_user, $mssql_passwd,
> {RaiseError => 0, PrintError => 0}
> )- Nascondi testo tra virgolette -
>
> - Mostra testo tra virgolette -
solved...
stupid error i was modifying the wrong conf file installed from a
previous installation.
now works like a charm, even with your suggestion.
Thanks