[DB-SIG] Accessing MSSQL from Python

Kevin Jacobs jacobs@penguin.theopalgroup.com
Wed, 28 Aug 2002 07:39:22 -0400 (EDT)


On Wed, 28 Aug 2002, Marcos S=E1nchez Provencio wrote:
> Thank you very much, that would be perfect for me. So, all I need is:
>=20
> freeTDS
> Sybase module

Make sure you get the current CVS version of FreeTDS.  The last release i=
s
useless.

> Do i need any proprietary sw? What were the changes that you had to mak=
e?
> Any gotchas?

That all.  There is only one important change I needed to make:

diff -ur sybase-0.35pre1/Sybase.py sybase-kbj/Sybase.py
--- sybase-0.35pre1/Sybase.py   Sun Apr 21 02:00:03 2002
+++ sybase-kbj/Sybase.py        Tue Jul  9 17:49:41 2002
@@ -136,7 +136,7 @@
     raise DatabaseError(_fmt_client(msg))

 def _servermsg_cb(ctx, conn, msg):
-    if msg.msgnumber not in (5701,):
+    if msg.msgnumber not in (5701,5703):
         raise DatabaseError(_fmt_server(msg))

 def _row_bind(cmd, count =3D 1):

I have a few more patches that I am still testing that fix some locking
issues with the Python driver.  Let me know if you run into those and I c=
an
send them too.

Good luck,
-Kevin

>=20
> TIA
>=20
> > On Wed, 28 Aug 2002, Marcos S=E1nchez Provencio wrote:
> >> Is there some portable way (I mean non-MS) to access MSSQL from
> >> Python? FreeTDS has a Python page which is absolutely blank.
> >
> > I was able to compile David Cole's Sybase module (with very few
> > changes) with FreeTDS using the TDS version 7 protocol.  I was then
> > able to connect to a MSSQL 2000 server and run queries very reliably.
> >
> > -Kevin
> >
> > --
> > Kevin Jacobs
> > The OPAL Group - Enterprise Systems Architect
> > Voice: (216) 986-0710 x 19         E-mail: jacobs@theopalgroup.com Fa=
x:
> >   (216) 986-0714              WWW:    http://www.theopalgroup.com
> >
> >
> > _______________________________________________
> > DB-SIG maillist  -  DB-SIG@python.org
> > http://mail.python.org/mailman/listinfo/db-sig
>=20
>=20
>=20

--=20
--
Kevin Jacobs
The OPAL Group - Enterprise Systems Architect
Voice: (216) 986-0710 x 19         E-mail: jacobs@theopalgroup.com
Fax:   (216) 986-0714              WWW:    http://www.theopalgroup.com