On Dec 6, 2012, at 5:55 AM, Carey Gagnon <[email protected]> wrote:

> Now there's some useful info. Here's the tarceback:
> 
> Traceback (most recent call last):
>  File "C:\src\ide\wizards\AppWizard\AppWizard.py", line 313, in onLeavePage
>    tables = cursor.getTables()
>  File "C:\src\dabo\db\dCursorMixin.py", line 2379, in getTables
>    return self.BackendObject.getTables(self.AuxCursor, includeSystemTables)
>  File "C:\src\dabo\db\dbMsSQL.py", line 108, in getTables
>    cursor.execute(sql % {'db':dbName})
>  File "C:\src\dabo\db\dCursorMixin.py", line 406, in execute
>    _records = self.fetchall()
>  File "C:\src\dabo\db\dbMsSQL.py", line 61, in fetchall
>    return tuple([{col: row[col]} for col in row if type(col) != int
> UnboundLocalError: local variable 'row' referenced before assignment

        That certainly helps. The line that raises the error is incredibly 
difficult to read, so it's hard to tell what's going wrong. Can you edit it so 
that it looks like the following, and then post what it prints out?

 51         if self.dbapi.__version__ >= "2.0.0":
 52             class ConCursor(self.dbapi.Cursor):
 53                 def __init__(self, *args, **kwargs):
 54                     # pymssql requires an additional param to be passed
 55                     # to its __init__() method
 56                     kwargs["as_dict"] = True
 57                     super(ConCursor, self).__init__(*args, **kwargs)
 58                 def fetchall(self):
 59                     # In dictionary mode both column numbers and names are 
used
 60                     # as keys. We need to filter them and leave name based 
keys only.
 61                     superrows = super(ConCursor, self).fetchall()
 62                     print "-" * 80
 63                     print type(superrows), superrows
 64                     print "-" * 80
 65                     return tuple([{col: row[col]} for col in row
 66                             for row in superrows
 67                             if type(col) != int])

        I want to make sure that there is actually something coming back from 
fetchall() call.


-- Ed Leafe



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to