I have proceeded further (Thanks Tom). I had a blank local file (~/.odbc.ini) and I removed it. Now I'm getting a "Connection refused" error, so at least it's trying to talk to the server.
Any thoughts? Here is the output from CPAN's 'install DBD::ODBC' command: cpan> install DBD::ODBC CPAN: Storable loaded ok Going to read /.cpan/Metadata Database was generated on Mon, 02 May 2005 07:56:55 GMT Running install for module DBD::ODBC Running make for J/JU/JURL/DBD-ODBC-1.13.tar.gz CPAN: Digest::MD5 loaded ok CPAN: Compress::Zlib loaded ok Checksum for /.cpan/sources/authors/id/J/JU/JURL/DBD-ODBC-1.13.tar.gz ok Scanning cache /.cpan/build for sizes x DBD-ODBC-1.13, 0 bytes, 0 tape blocks x DBD-ODBC-1.13/Changes, 32299 bytes, 64 tape blocks x DBD-ODBC-1.13/dbdimp.c, 127985 bytes, 250 tape blocks x DBD-ODBC-1.13/dbdimp.h, 7559 bytes, 15 tape blocks x DBD-ODBC-1.13/dbivport.h, 1253 bytes, 3 tape blocks x DBD-ODBC-1.13/fixup_c.h, 251 bytes, 1 tape blocks x DBD-ODBC-1.13/fixup_t.h, 243 bytes, 1 tape blocks x DBD-ODBC-1.13/Makefile.PL, 16670 bytes, 33 tape blocks x DBD-ODBC-1.13/MANIFEST, 1216 bytes, 3 tape blocks x DBD-ODBC-1.13/MANIFEST.SKIP, 126 bytes, 1 tape blocks x DBD-ODBC-1.13/META.yml, 343 bytes, 1 tape blocks x DBD-ODBC-1.13/mytest, 0 bytes, 0 tape blocks x DBD-ODBC-1.13/mytest/coltest.pl, 758 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/contest.pl, 669 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/joetest.pl, 2281 bytes, 5 tape blocks x DBD-ODBC-1.13/mytest/joetest2.pl, 808 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/joetest4.pl, 790 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/joetest5.pl, 1210 bytes, 3 tape blocks x DBD-ODBC-1.13/mytest/joetest6.pl, 259 bytes, 1 tape blocks x DBD-ODBC-1.13/mytest/joetest7.pl, 1692 bytes, 4 tape blocks x DBD-ODBC-1.13/mytest/leakcheck.pl, 2140 bytes, 5 tape blocks x DBD-ODBC-1.13/mytest/listtabs.pl, 899 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/longbin.pl, 2631 bytes, 6 tape blocks x DBD-ODBC-1.13/mytest/moreresults.pl, 810 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/proctest1.pl, 2125 bytes, 5 tape blocks x DBD-ODBC-1.13/mytest/proctest2.pl, 2442 bytes, 5 tape blocks x DBD-ODBC-1.13/mytest/proctest3.pl, 1052 bytes, 3 tape blocks x DBD-ODBC-1.13/mytest/randombind.pl, 2945 bytes, 6 tape blocks x DBD-ODBC-1.13/mytest/sqltmptabs.pl, 690 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testconn.pl, 2406 bytes, 5 tape blocks x DBD-ODBC-1.13/mytest/testconnspeed.pl, 916 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testdatasources.pl, 156 bytes, 1 tape blocks x DBD-ODBC-1.13/mytest/testdestruction.pl, 2319 bytes, 5 tape blocks x DBD-ODBC-1.13/mytest/testerrhandler.pl, 692 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testfunc.pl, 3286 bytes, 7 tape blocks x DBD-ODBC-1.13/mytest/testgetinfo.pl, 366 bytes, 1 tape blocks x DBD-ODBC-1.13/mytest/testigparams.pl, 1745 bytes, 4 tape blocks x DBD-ODBC-1.13/mytest/testinout.pl, 1742 bytes, 4 tape blocks x DBD-ODBC-1.13/mytest/testkeys.pl, 944 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testmulti.pl, 698 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testproc.pl, 916 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testproc2.pl, 1226 bytes, 3 tape blocks x DBD-ODBC-1.13/mytest/testproc3.pl, 1183 bytes, 3 tape blocks x DBD-ODBC-1.13/mytest/testspmulti.pl, 1063 bytes, 3 tape blocks x DBD-ODBC-1.13/mytest/testundef.pl, 682 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testundef2.pl, 986 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testundef3.pl, 707 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testver.pl, 627 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testxml.pl, 1974 bytes, 4 tape blocks x DBD-ODBC-1.13/mytest/timetest.pl, 1264 bytes, 3 tape blocks x DBD-ODBC-1.13/ODBC.h, 1914 bytes, 4 tape blocks x DBD-ODBC-1.13/ODBC.pm, 30728 bytes, 61 tape blocks x DBD-ODBC-1.13/ODBC.xs, 6203 bytes, 13 tape blocks x DBD-ODBC-1.13/README, 5906 bytes, 12 tape blocks x DBD-ODBC-1.13/README.adabas, 1298 bytes, 3 tape blocks x DBD-ODBC-1.13/README.hpux, 965 bytes, 2 tape blocks x DBD-ODBC-1.13/README.informix, 1057 bytes, 3 tape blocks x DBD-ODBC-1.13/README.RH9, 498 bytes, 1 tape blocks x DBD-ODBC-1.13/t, 0 bytes, 0 tape blocks x DBD-ODBC-1.13/t/01base.t, 377 bytes, 1 tape blocks x DBD-ODBC-1.13/t/02simple.t, 7466 bytes, 15 tape blocks x DBD-ODBC-1.13/t/03dbatt.t, 5340 bytes, 11 tape blocks x DBD-ODBC-1.13/t/05meth.t, 2451 bytes, 5 tape blocks x DBD-ODBC-1.13/t/07bind.t, 4947 bytes, 10 tape blocks x DBD-ODBC-1.13/t/08bind2.t, 3070 bytes, 6 tape blocks x DBD-ODBC-1.13/t/09multi.t, 4811 bytes, 10 tape blocks x DBD-ODBC-1.13/t/20SqlServer.t, 15944 bytes, 32 tape blocks x DBD-ODBC-1.13/t/30Oracle.t, 1534 bytes, 3 tape blocks x DBD-ODBC-1.13/t/ODBCTEST.pm, 7502 bytes, 15 tape blocks Removing previously used /.cpan/build/DBD-ODBC-1.13 CPAN.pm: Going to build J/JU/JURL/DBD-ODBC-1.13.tar.gz Useless use of private variable in void context at Makefile.PL line 431. Configuring DBD::ODBC ... >>> Remember to actually *READ* the README file! And re-read it if you have any problems. Using DBI 1.48 (for perl 5.006001 on sun4-solaris) installed in /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/ Using ODBC in /usr/local/unixODBC Umm, this looks like a unixodbc type of driver manager. We expect to find the sql.h, sqlext.h and (which were supplied with unixODBC) in $ODBCHOME/include directory alongside the /usr/local/unixODBC/lib/libodbc.so library. in $ODBCHOME/lib Checking if your kit is complete... Looks good Injecting selected odbc driver into cc command Using DBI 1.48 (for perl 5.006001 on sun4-solaris) installed in /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/ Writing Makefile for DBD::ODBC The DBD::ODBC tests will use these values for the database connection: DBI_DSN=dbi:ODBC:mallard e.g. dbi:ODBC:demo DBI_USER=mallard [EMAIL PROTECTED]@R /usr/bin/perl -I/usr/local/lib/perl5/5.6.1/sun4-solaris -I/usr/local/lib/perl5/5.6.1 -MExtUtils::Command -e mkpath blib/lib/DBD/ODBC rm -f blib/lib/DBD/ODBC/Changes.pm cp Changes blib/lib/DBD/ODBC/Changes.pm cp ODBC.pm blib/lib/DBD/ODBC.pm /usr/bin/perl -p -e "s/~DRIVER~/ODBC/g" /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI//Driver.xst > ODBC.xsi /usr/bin/perl -I/usr/local/lib/perl5/5.6.1/sun4-solaris -I/usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/5.6.1/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.6.1/ExtUtils/typemap ODBC.xs > ODBC.xsc && mv ODBC.xsc ODBC.c Warning: duplicate function definition 'data_sources' detected in ODBC.xs, line 202 gcc -c -I/usr/local/unixODBC/include -I. -I/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/ -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"1.13\" -DXS_VERSION=\"1.13\" -fPIC -I/usr/local/lib/perl5/5.6.1/sun4-solaris/CORE -I/usr/local/unixODBC/include ODBC.c gcc -c -I/usr/local/unixODBC/include -I. -I/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/ -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"1.13\" -DXS_VERSION=\"1.13\" -fPIC -I/usr/local/lib/perl5/5.6.1/sun4-solaris/CORE -I/usr/local/unixODBC/include dbdimp.c Running Mkbootstrap for DBD::ODBC () chmod 644 ODBC.bs rm -f blib/arch/auto/DBD/ODBC/ODBC.so LD_RUN_PATH="/usr/local/unixODBC/lib" gcc -G -L/usr/local/lib ODBC.o dbdimp.o -o blib/arch/auto/DBD/ODBC/ODBC.so -L/usr/local/unixODBC/lib -lodbc chmod 755 blib/arch/auto/DBD/ODBC/ODBC.so cp ODBC.bs blib/arch/auto/DBD/ODBC/ODBC.bs chmod 644 blib/arch/auto/DBD/ODBC/ODBC.bs Manifying blib/man3/DBD::ODBC.3 /usr/ccs/bin/make -- OK Running make test PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.1/sun4-solaris -I/usr/local/lib/perl5/5.6.1 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/01base.........ok t/02simple.......ok 1/36src/tds/login.c: tds_connect: 10.10.12.67:4000: Connection refused t/02simple.......dubious Test returned status 0 (wstat 139, 0x8b) DIED. FAILED tests 3-36 Failed 34/36 tests, 5.56% okay t/03dbatt........ok 1/24src/tds/login.c: tds_connect: 10.10.12.67:4000: Connection refused t/03dbatt........dubious Test returned status 0 (wstat 139, 0x8b) DIED. FAILED tests 3-24 Failed 22/24 tests, 8.33% okay t/05meth.........ok 1/8src/tds/login.c: tds_connect: 10.10.12.67:4000: Connection refused t/05meth.........dubious Test returned status 0 (wstat 139, 0x8b) DIED. FAILED tests 2-8 Failed 7/8 tests, 12.50% okay t/07bind.........ok 1/11src/tds/login.c: tds_connect: 10.10.12.67:4000: Connection refused t/07bind.........dubious Test returned status 0 (wstat 139, 0x8b) DIED. FAILED tests 2-11 Failed 10/11 tests, 9.09% okay t/08bind2........ok 1/5src/tds/login.c: tds_connect: 10.10.12.67:4000: Connection refused t/08bind2........dubious Test returned status 0 (wstat 139, 0x8b) DIED. FAILED tests 3-5 Failed 3/5 tests, 40.00% okay t/09multi........ok 1/7src/tds/login.c: tds_connect: 10.10.12.67:4000: Connection refused t/09multi........dubious Test returned status 0 (wstat 139, 0x8b) DIED. FAILED tests 4-7 Failed 4/7 tests, 42.86% okay t/20SqlServer....ok 1/37src/tds/login.c: tds_connect: 10.10.12.67:4000: Connection refused t/20SqlServer....dubious Test returned status 0 (wstat 139, 0x8b) DIED. FAILED tests 3-37 Failed 35/37 tests, 5.41% okay t/30Oracle.......ok 1/4src/tds/login.c: tds_connect: 10.10.12.67:4000: Connection refused t/30Oracle.......dubious Test returned status 0 (wstat 139, 0x8b) DIED. FAILED tests 3-4 Failed 2/4 tests, 50.00% okay Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------ ------- t/02simple.t 0 139 36 68 188.89% 3-36 t/03dbatt.t 0 139 24 44 183.33% 3-24 t/05meth.t 0 139 8 14 175.00% 2-8 t/07bind.t 0 139 11 20 181.82% 2-11 t/08bind2.t 0 139 5 6 120.00% 3-5 t/09multi.t 0 139 7 8 114.29% 4-7 t/20SqlServer.t 0 139 37 70 189.19% 3-37 t/30Oracle.t 0 139 4 4 100.00% 3-4 Failed 8/9 test scripts, 11.11% okay. 117/137 subtests failed, 14.60% okay. *** Error code 11 make: Fatal error: Command failed for target `test_dynamic' /usr/ccs/bin/make test -- NOT OK Running make install make test had returned bad status, won't install without force cpan> q No history written (no histfile specified). Lockfile removed. Thanks, Mark Mark Vaughan Programmer III Direct: +1 303 802 2426 Cell: +1 303 601 4434 Fax: +1 303 802 1420 [EMAIL PROTECTED] Evolving Systems, Inc. 9777 Pyramid Court, Suite 100, Englewood, CO USA 80112 www.evolving.com -----Original Message----- From: Thomas A. Lowery [mailto:[EMAIL PROTECTED] Sent: Monday, May 02, 2005 5:53 PM To: Mark Vaughan; DBI users Subject: Re: Newbie problem connecting to MS SQL Server Mark Vaughan wrote: >Amonotod, >Yes, that helped tremendously. > >Now I've moved on to the next problem. > >I installed unixODBC and the tsql command worked (no errors), although >it replied with a 1> prompt and didn't seem to do anything unless I >typed 'quit', in which case it did just that. >I was able to run isql and get data from a table. > >I installed freetds and it seems to work okay because I can use the isql >command with the dsn (isql gunnison user pass). > >Now the problem: I'm using perl to connect to the DB (see below) and >here is the snippet of code that fails: > my $dbh = DBI->connect( "DBI:ODBC:gunnison", "user", 'pass'); > > > <snip> >I'm trying to use the ODBC data source as listed above. ><snip> > > >SQLDriverConnect failed: >SQLConnect 'gunnison', 'mv' >dbd_error: err_rc=-1 rc=0 s/d/e: 0/8052744/8294408 >dbd_error: SQL-IM002 (native 0): [unixODBC][Driver Manager]Data source >name not found, and no default driver specified (SQL-IM002) >dbd_error: err_rc=-1 rc=0 s/d/e: 0/0/8294408 >db_login/SQLConnect error -1 recorded: [unixODBC][Driver Manager]Data >source name not found, and no default driver specified (SQL-IM002)(DBD: >db_login/SQLConnect err=-1) > <- connect= undef at > > > <snip> >Can anyone offer any suggestions? > Is "gunnison" defined in either your global odbc.ini file or local ~/.odbc.ini? Is ODBCINI set? If ODBCINI is not set then defining gunnison in either the global or local should work. If ODBCINI is set make sure it points to the odbc.ini file that contains gunnison. Tom This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Evolving Systems TIS at [EMAIL PROTECTED] and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. To ensure regulatory compliance and for the protection of our clients and business, Evolving Systems may monitor and read e-mails sent to and from its servers. Although Evolving Systems routinely screens for viruses, addressees should scan this e-mail and any attachments for viruses. Evolving Systems makes no representation or warranty as to the absence of viruses in this e-mail or any attachments. Registered Office: 9777 Mt. Pyramid Ct Suite 100, Englewood, CO 80112