johnf escreveu:
> On Wednesday 15 April 2009 04:03:10 am Pedro Vale de Gato wrote:
>
>> self.super(src._cnx)
>>
>
> I'm sorry I'm being dumb but where is 'src._cnx' defined?
>
In pymssql.py:482 you can see the right way to create a pymssqlCursor is
using connection._cnx as parameter!
_cnx itself is defined in pymssql.py:428
pymssql docs suggest this:
cur = conn.cursor(), but dabo cannot use this easely, and works
flawlessly with my changes (as far as i know, if it causes problems,
please inform me)
You can see the this with a very simple script:
import pymssql
conn = pymssql.connect(host='192.168.1.15', user='sa', password='',
database='MDI0001')
# this works!!
cur = pymssql.pymssqlCursor(conn._cnx)
# this does not
# cur = pymssql.pymssqlCursor(conn)
# this is the recomended way to do it, dabo cannot use this
# cur = conn.cursor()
cur.execute('select table_name from INFORMATION_SCHEMA.TABLES where
table_catalog = \'MDI0001\' and table_type = \'BASE TABLE\' order by
table_name')
row = cur.fetchone()
while row:
print "%s" % row[0]
row = cur.fetchone()
conn.close()
Regards,
Pedro Vale de Gato
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]