[unixODBC-support] odbc question from a noob
nick.gorham at easysoft.com
Thu Oct 18 17:40:48 BST 2007
> Greetings unixodbc support list. I’m a new member here with a bit of a
> problem and I am nearly out of ideas.
> I have a handful of Solaris 9 servers here configured with FreeTDS and
> UnixODBC. We use some Perl scripts to connect back to various MS SQL
> servers using ODBC connections through these packages. Everything
> currently setup works great, but I am trying to create a new DSN and
> am failing miserably. I know we have made changes to our odbc.ini and
> freetds.conf files in the past and been successful, so I’m not sure
> what the deal is here.
> Both my odbc.ini and freetds.conf are located in /usr/local/etc. We do
> not have any duplicates anywhere else on the server.
> I have attempted to edit them both manually, as well as with odbcinst.
> The changes appear to be identical.
> My new DSN is a nearly exact duplicate of a known working DSN, simply
> changing the database it connects to.
> My perl script is run from the command line, and returns the following
> DBI connect('dsnname','uername',...) failed: [unixODBC][FreeTDS][SQL
> Server]Unable to connect to data source (SQL-08001)(DBD:
> db_login/SQLConnect err=-1) at ./script.pl line 110
> cannot connect: at ./mi_flush_db.pl line 110.
> To troubleshoot, I’ve tried using tsql and isql both. Tsql connects
> great when I enter the hostname of the database server as well as the
> same credentials that I use with my script. Isql fails though when
> using the dsn name. I have also been listening to traffic going to the
> database server with snoop, and nothing is sent out when my failures
> occur, so I know it’s not the database server responding poorly.
> isql -v dsnname username password
> [S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
> [ISQL]ERROR: Could not SQLConnect
Check its reading the odbc.ini you expect, maybe use truss to see what
files its opening. If it is, try using dltest to check the driver can be
dltest /path/to/your/libdriver.so SQLConnect
More information about the unixODBC-support