From owner-freebsd-questions@FreeBSD.ORG Thu Aug 26 22:23:27 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 285F916A4CE for ; Thu, 26 Aug 2004 22:23:27 +0000 (GMT) Received: from out010.verizon.net (out010pub.verizon.net [206.46.170.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9ACF943D46 for ; Thu, 26 Aug 2004 22:23:26 +0000 (GMT) (envelope-from pgollucci@ejpress.com) Received: from [192.168.1.5] ([141.156.110.104]) by out010.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20040826222326.UXCB14383.out010.verizon.net@[192.168.1.5]>; Thu, 26 Aug 2004 17:23:26 -0500 Message-ID: <412E6315.6010708@ejpress.com> Date: Thu, 26 Aug 2004 18:24:21 -0400 From: "Philip M. Gollucci" Organization: eJournalPress User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: questions@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out010.verizon.net from [141.156.110.104] at Thu, 26 Aug 2004 17:23:25 -0500 Subject: PERL + DBD::ODBC/iODBC/freetds -> MSSQL Server 2000 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2004 22:23:27 -0000 Hi All, PLEASE CC pgollucci@ejournalpress.com in the reply my work address is not subscribed :) Error Message: =============== perl db_test.pl "DBI:ODBC:ejp05_pnas" xxxx xxxx DBI connect('ejp05_pnas','xxxxxx',...) failed: [iODBC][Driver Manager]Driver's SQLAllocEnv() failed (SQL-IM004)(DBD: db_login/SQLConnect err=-1) at db_test.pl line 31 at db_test.pl line 22 I am sure that ejp05_pnas is a valid database and my user/name/password in $ARGV[1], $ARGV[2] are correct. What am I missing. I believe this error message means I didn't authenticate correct. I can connect to this database via a System ODBC DSN on Win2k using an MSSQL 2000 connection successfully. Thanks in advance. P.S. I've tried some googling (web and groups), most of this is for php but applies. Not much actually say how to fix this problem other then to try different combinations such as DBD-Sybase or unixODBC. db_test.pl: ============ ===-[START]-=== #!/usr/bin/perl -w use strict; use warnings FATAL => 'all'; use Carp; use DBI qw (:sql_types); my $db_attrs = { RaiseError => 1, PrintError => 0, Taint => 1, AutoCommit => 0, ShowErrorStatement => 1, NAME_lc => 1 }; my $dbh = eval { DBI->connect($ARGV[0], $ARGV[1], $ARGV[2], $db_attrs); }; confess $@ if $@; print "Connected\n"; my $rc = $dbh->disconnect(); confess $rc unless $rc; print "Disconnected\n"; ===-[END]-=== uname: ======= FreeBSD 5.2.1-RELEASE-p9 Ports: ====== perl5.8.5 p5-DBD-ODBC-1.09/ libiodbc-3.51.2/ freetds-0.62.3/ Configuration files: ==================== /usr/local/etc/libiodbc/iodbc.ini ===-[START]-=== [ODBC] Debug = Yes Trace = Yes DebugFile = /usr/home/philip/bin/odbc-debug.log TraceFile = /usr/home/philip/bin/odbc-trace.log TraceAutoStop = 1 [ODBC Data Sources] ejp05_pnas = my pnas database [ejp05_pnas] Driver = /usr/local/lib/libtds.so.3 Description = ejp05_pnas Host = 192.168.1.5 ServerName = ejp05 ServerType = MSSQL 2000 FetchBufferSize = 99 ReadOnly = no [Default] Driver = /usr/local/lib/libtds.so.3 ===-[END]-=== /usr/local/etc/freetds.conf ===-[START]-=== [global] tds version = 4.2 initial block size = 512 swap broken dates = no swap broken money = no try server login = yes try domain login = no dump file = /usr/home/philip/bin/freetds.log debug level = 10 [ejp05] host = 192.168.1.5 port = 1433 tds version = 4.2 ===-[END]-=== END --------------------------------------------------------------------------- eJournalPress DBA / Software Engineer / System Administrator E-Mail: pgollucci@ejournalpress.com URL : http://www.ejournalpress.com Phone : 301.530.6375 $Id: .signature,v 1.5 2004/08/01 23:46:37 philip Exp $