Skip site navigation (1) Skip section navigation (2)

Source name not found

From: "Barry" <mail(at)polisource(dot)com>
To: pgsql-cygwin(at)postgresql(dot)org
Subject: Source name not found
Date: 2004-06-13 16:59:25
Message-ID: 1317. (view raw, whole thread or download thread mbox)
Lists: pgsql-cygwin
I'm a newbie to PostgreSQL and cygwin, and I'm having a problem with ODBC.

When I paste the path of the below script to Cygwin, to connect to a
database using Perl's DBD::PgPP module, it seems to work because I get no
error message, but when I comment-out the $dsn definition that uses PgPP
and uncomment any of the other $dsn definitions, which use ODBC, I recieve
the error:

"DBI connect('DSN','postgres',...) failed: [Microsoft][ODBC Driver
Manager] Data source name not found and no default driver specified
(SQL-IM002)(DBD: db_login/SQLConnect err=-1) at [file name] line 14"

I don't expect the code to do anything useful. I'm just getting started
with PostgreSQL and I wanted to test what little I learned so far.

At it says that the latest
DBD::ODBC versions fail for Windows, but I know that ActiveState's version
passes. I have ActivePerl installed along with Cygwin's Perl. When I
configured ActivePerl, I had .pl files be associated with it, and I'm not
sure what Perl is used when I paste "perl <path>" in Cygwin, or if there's
a conflict, or if my error is caused by Cygwin's version of DBD::ODBC not
working for Windows XP.

My search for DBD::ODBC using Cygwin's mailing list search tool returned
nothing, but searching Google got me the following Q and A from

>> Is there any pre-build perl modules for the perl in Cygwin?
Particularly DBD::Mysql, DBD::ODBC.

> No need for them to be pre-built. Get them from CPAN. Have a look at the
DBI mail list archives or these mail archives for any further

I have a feeling that information is out of date. Do I have to build



use DBI;
$user = 'postgres';
$password = 'omitted';

###$dsn = 'dbi:ODBC:DSN';
###$dsn = 'dbi:ODBC:dbname=template1';
###$dsn = 'dbi:ODBC:dbname=template1;host=localhost';

$dsn = 'dbi:PgPP:dbname=template1;host=localhost';

$dbh = DBI->connect($dsn, $user, $password, { RaiseError => 1, AutoCommit
=> 0 });


pgsql-cygwin by date

Next:From: Mike GDate: 2004-06-13 19:05:03
Subject: Re: Source name not found
Previous:From: Jason TishlerDate: 2004-06-13 15:27:46
Subject: Re: Updated Cygwin Package: postgresql-7.4.2-1

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group