----- Original Message -----
From: Jenda Krynicky <[EMAIL PROTECTED]>
Date: Monday, October 18, 2004 6:52 pm
Subject: Re: SQL2000
> From: Mark Goland <[EMAIL PROTECTED]>
> > > ----- Original Message -----
> > > From: "Jenda Krynicky" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, October 18, 2004 6:24 PM
> > > Subject: Re: SQL2000
> > >
> > >
> > > > Subject: SQL2000
> > > > > Hi all,
> > > > >
> > > > > Not sure if this is the right list to ask this question but
> > > > > this is the best list to get answares so I am going to
> give it
> > > > > a shot. I am trying to connect to SQL2000 server from a winXP
> > > > > box. I keep on failing with same error, any help would be
> > > > > apreciate
> > > > > d
> > > > >
> > > > > #!PERl
> > > > > use warnings;
> > > > > use strict;
> > > > > use Net::MySQL;
> > > >
> > > > I thought you said SQL2000 and meant Microsoft SQL Server 2000!
> > > >
> > > > > use DBI;
> > > > > $|=1;
> > > > >
> > > > >
> > > > > my $user='xxx';
> > > > > my $password = '....';
> > > > > my $database = "nnsdata_ptest";
> > > > > my $hostname='somehost.com;
> > > > > my $port = '1444';
> > > > >
> > > > >
> > > > > my $dsn = "host=$hostname;port=$port";
> > > > > my $dbh = DBI->connect("DBI:mysql:$dsn", $user, $password);
> > > >
> > > > Again I thought you meant MS SQL Server 2000, not mysql.
> > > > That's a completely different and totally incompatible database!
> > > >
> > > > You want to use DBD::ODBC, not DBD::mysql
> > > >
> > > > Try:
> > > >
> > > > my $DSN = "driver=SQL
> Server;Server=$hostname;Database=$database';> > > my $dbh = DBI-
> >connect("DBI:ODBC:$dsn", $user, $password);
> > Hmm Still fails, now I get :
> > main::count() called too early to check prototype at
> > C:\temp\perl\te.pl line 64. DBI connect('driver=SQL
> > Server;Server=mysite.com;Database=nnsdata_ptest','username',...)
> > failed: at C:\t emp\perl\te.pl line 24
>
> Strange. Could you resend the whole test script?
Sure,
While looking at my code, looks like its trying to connect to default port. I am
unable to get it to connect to my port [ 1444 ], here is the code
#!PERl
use warnings;
use strict;
$|=1;
use DBI;
my $user='username';
my $password = ''pwd';
my $database = "nnsdata_ptest";
my $hostname='myhost.com';
my $port = '1444';
my $dsn = "driver=SQL Server;Server=$hostname;Database=$database;Port=$port";
my $dbh = DBI->connect("DBI:ODBC:$dsn", $user, $password);
>
> Jenda
> ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
> When it comes to wine, women and song, wizards are allowed
> to get drunk and croon as much as they like.
> -- Terry Pratchett in Sourcery
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>