Skip to Content.
Sympa Menu

freetds - Re: [freetds] [unixODBC][FreeTDS][SQL Server]Unable to connect to data source (SQL-08001)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] [unixODBC][FreeTDS][SQL Server]Unable to connect to data source (SQL-08001)
  • Date: Fri, 14 Dec 2012 21:02:59 -0500

On Thu, 13 Dec 2012 18:34:49 +0530
Sankar G <geoinnovate AT gmail.com> wrote:

> Using ODBC-Combined strategy
> DSN [SERVER] has servername "" (from /usr/local/etc/odbc.ini)

I'm not sure your connection string is right in your DBD connection,
but it's always a good idea to make test your ODBC setup with osql, as
you did. And it seems you either tickled a bug in osql or maybe
there's something else amiss.

What's odd is that osql finds the right stanza
in /usr/local/etc/odbc.ini:

[SERVER]
Driver = FreeTDS
Description = ODBC connection via FreeTDS
ServerName = SERVER

but then reports:

DSN [SERVER] has servername "" (from /usr/local/etc/odbc.ini)

Looking at the osql script, I can only guess your awk works differently
from mine. What does the following show on your computer? I get:

$ SERVER_LINE='ServerName = SERVER'
$ echo ${SERVER_LINE} | awk -F '=[[:space:]]*' '{print $2}'
SERVER

If yours doesn't also print 'SERVER', we need to modify osql so it
does. If it does print 'SERVER', I don't understand how osql could
find the right line and not parse it correctly.

To isolate yourself from Perl *and* osql bugs, you could always try

$ TDSVER=7.2 bsqlodbc -S SERVER -U username -P password

(sudo shouldn't be necessary.)

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page