Re: Python-Sybase instalation problems

MichaƂ Sawicz <[email protected]> Tue, 25 Jan 2011 23:00:29 +0100
Newsgroups gmane.comp.python.sybase
Message-ID <[email protected]>
--===============2119458982052117826==
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-gVKSmk0MimpnoOPz91b3"


--=-gVKSmk0MimpnoOPz91b3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Dnia 2011-01-25, wto o godzinie 15:49 -0600, Robert Boehne pisze:
> Micha=C5=82 Sawicz wrote:
> > I also tried tsql itself, which seemed to connect (I got a 1> prompt)
> > but regardless of what query I tried to execute, I got no response,
> > dropping me to another prompt (2>).
> >  =20
> did you type "go" at the 2nd prompt and hit <Enter> ?

Right, new to Sybase, thanks for that - it worked.

> It sounds like you're not specifying the right arguments to allow these=
=20
> pieces of software to connect to the server.
> Normally, you need a hostname, port, username and password.  How you=20
> combine those to get a connection would depend on the specific software=
=20
> you're using.
>=20
> Post the details of how you create the connection - better yet - try and=
=20
> connect with explicit arguments, after you make sure you know what to=20
> set where.

OK, so:

> tsql -S asademo -U DBA

works.

But in python, either of:

> conn =3D pymssql.connect(host=3D'asademo', user=3D'DBA', password=3D'SQL'=
,
> database=3D'asademo')

> conn =3D pymssql.connect(host=3D'asademo', user=3D'DBA', password=3D'SQL'=
)

result in:

> -------------------------------------------------------------------------=
--
> InterfaceError                            Traceback (most recent call las=
t)
>=20
> /root/<ipython console> in <module>()
>=20
> /usr/lib/pymodules/python2.6/pymssql.pyc in connect(dsn, user, password, =
host, database, timeout, login_timeout, trusted, charset, as_dict, max_conn=
)
>     607                 raise OperationalError, e[0]
>     608         except _mssql.MssqlDriverException, e:
> --> 609                 raise InterfaceError, e[0]
>     610=20
>     611         # default query timeout
>=20
>=20
> InterfaceError: Could not set connection properties

Using dsn:

> conn =3D pymssql.connect(dsn=3D'asademo', user=3D'DBA', password=3D'SQL',
> database=3D'asademo')

or

> conn =3D pymssql.connect(dsn=3D'asademo', user=3D'DBA', password=3D'SQL')

both yield:

> -------------------------------------------------------------------------=
--
> InterfaceError                            Traceback (most recent call las=
t)
>=20
> /root/<ipython console> in <module>()
>=20
> /usr/lib/pymodules/python2.6/pymssql.pyc in connect(dsn, user, password, =
host, database, timeout, login_timeout, trusted, charset, as_dict, max_conn=
)
>     607                 raise OperationalError, e[0]
>     608         except _mssql.MssqlDriverException, e:
> --> 609                 raise InterfaceError, e[0]
>     610=20
>     611         # default query timeout
>=20
>=20
> InterfaceError: Connection to the database failed for an unknown reason.

Hope that clears things up...

BTW, here's a relevant part of my freetds.conf:

> [asademo]
>         host =3D 127.0.0.1
>         port =3D 2638
>         tds version =3D 5.0
>         dump file =3D /tmp/freetds.log
>         debug flags =3D 0xffff

I can provide the freetds.log file, if it would help, of course.

Thanks for the fast response,
--=20
Micha=C5=82 Sawicz <[email protected]>

--=-gVKSmk0MimpnoOPz91b3
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)

iEYEABECAAYFAk0/R/0ACgkQzQlUjpZYlbe6RQCgmMFEl0SW8Jfv1Lae0bNMk9OV
llEAoLCPsGhvhwE04Ej7jZvX2Fu5fSiF
=jUO/
-----END PGP SIGNATURE-----

--=-gVKSmk0MimpnoOPz91b3--



--===============2119458982052117826==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
--===============2119458982052117826==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Python-sybase-misc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-sybase-misc

--===============2119458982052117826==--