Troubles with SQLDict

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rony Steelandt

    #1

    Troubles with SQLDict

    I would like to use SQLDict against a MS SQL server database, but got stuck
    at the very beginning

    import pymssql

    import SQLDict

    # Connect to database

    c=pymssql.conne ct('192.168.1.1 3:dblisamaster: sa')

    db = SQLDict.SQLDict (c)


    class VAT(SQLDict.Obj ectBuilder):
    table = 'TBLVat'
    columns = ['VATID','VATLab el']
    update_columns = columns
    indices = [('ID',['VATID'])]

    VAT().register( db)
    db.TBLVat.loc['1']

    the last instruction gives me the error :
    ------------------------------------------------------------------
    Traceback (most recent call last):
    File "./bureau/test.py", line 19, in ?
    db.TBLVat.loc['1']
    File "C:\Python24\li b\SQLDict.py", line 155, in __getattr__
    return getattr(self.db , attr)
    AttributeError: pymssqlCnx instance has no attribute 'TBLVat'
    ------------------------------------------------------------------

    This is allmost a copy of the instructions in the module, so I have no idea
    what goes wrong.
    Any ideas ?

    tia

    Rony Steelandt


Working...