Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion buildout-based install with freetds and unixodbc

Received: by 10.101.175.10 with SMTP id c10mr2480694anp.46.1278338948368;
        Mon, 05 Jul 2010 07:09:08 -0700 (PDT)
X-BeenThere: pyodbc@googlegroups.com
Received: by 10.101.11.8 with SMTP id o8ls7154101ani.6.p; Mon, 05 Jul 2010 
	07:09:08 -0700 (PDT)
Received: by 10.101.128.33 with SMTP id f33mr2498656ann.6.1278338948094;
        Mon, 05 Jul 2010 07:09:08 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.91.133.13 with SMTP id k13mr218679agn.33.1278096714932; Fri, 
	02 Jul 2010 11:51:54 -0700 (PDT)
Received: by v21g2000prd.googlegroups.com with HTTP; Fri, 2 Jul 2010 11:51:54 
	-0700 (PDT)
Date: Fri, 2 Jul 2010 11:51:54 -0700 (PDT)
In-Reply-To: <AANLkTikyaQhAZXKljQH07cty1sleUCt0pLSsb5sct9ui@mail.gmail.com>
X-IP: 67.51.55.98
References: <97b719fa-683e-4eff-b817-13b37ea5b06a@x20g2000pro.googlegroups.com> 
	<AANLkTikyaQhAZXKljQH07cty1sleUCt0pLSsb5sct9ui@mail.gmail.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; 
	rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3,gzip(gfe)
Message-ID: <6be7e9ee-029e-4fb8-af70-6ff5b9ebe7eb@v21g2000prd.googlegroups.com>
Subject: Re: buildout-based install with freetds and unixodbc
From: fulv <fulviocas...@gmail.com>
To: pyodbc <pyodbc@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I get the same error with

>>> conn =3D pyodbc.connect("DSN=3Ddatabase;UID=3Dusername;PWD=3Dpassword")

I have tried what you said, defining a server instance in
freetds.conf, a driver in odbcinst.ini and a db instance in odbc.ini.
The thing is, when I run the command line tools tsql (from freetds/
bin) and isql (from unixodbc/bin), it all works great.

Is there any way to see which path pyodbc is searching for DSNs or
other configuration files?

Thanks!

On Jul 2, 7:48=A0am, Alec Shaner <asha...@chumpland.org> wrote:
> I don't think it's an issue of pyodbc not seeing unixODBC, rather a
> configuration problem. If I try to connect like your example I get the sa=
me
> error. If you can't figure it out, you can try it like this:
>
> >>> import pyodbc
> >>> conn =3D pyodbc.connect("DSN=3Ddatabase;UID=3Dusername;PWD=3Dpassword=
")
>
> where the "database" matches an entry from your odbc.ini file.
>
> Define a server instance in freetds.conf (host, port, tds version)
> Define a driver in odbcinst.ini
> Define a database instance in odbc.ini - where the Driver matches one fro=
m
> odbcinst.ini and the Servername matches one from freetds.conf
>
> If you want to see examples of each config let me know.On Fri, Jul 2, 201=
0 at 12:25 AM, fulv <fulviocas...@gmail.com> wrote:
> > I have freetds and unixodbc, and they both work fine, as I verified
> > with tsql and isql. =A0But I have a problem with pyodbc:
>
> > >>> import pyodbc
> > >>> conn =3D
> > pyodbc.connect("DRIVER=3D{TDS};Server=3D......;Database=3D......;UID=3D=
.....;PWD=3D....")
> > Traceback (most recent call last):
> > =A0File "<stdin>", line 1, in ?
> > pyodbc.Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source
> > name not found, and no default driver specified (0)
> > (SQLDriverConnectW)')
>
> > The bigger picture is that I am trying to install this in a Zope
> > buildout, and I have pysql in the eggs list for the instance, but I
> > have freetds and unixodbc built by the following buildout parts:
>
> > [freetds]
> > recipe =3D zc.recipe.cmmi
> > url =3D
> >ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
> > extra_options =3D --with-tdsver=3D8.0
>
> > [unixodbc]
> > recipe =3D zc.recipe.cmmi
> > url =3Dhttp://www.unixodbc.org/unixODBC-2.3.0.tar.gz
>
> > Could it be that pyodbc does not see the buildout-made unixodbc? =A0And
> > if so, how do I change buildout to make pyodbc build correctly?
>
> > Or what else could be the problem?
>
> > Thanks!
>
> > --
> > You received this message because you are subscribed to the Google Grou=
ps
> > "pyodbc" group.
> > To post to this group, send email to pyodbc@googlegroups.com.
> > To unsubscribe from this group, send email to
> > pyodbc+unsubscribe@googlegroups.com<pyodbc%2Bunsubscr...@googlegroups.c=
om>
> > .
> > For more options, visit this group at