Troubles with SQLDict

R

Rony Steelandt

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.connect('192.168.1.13:dblisamaster:sa')

db = SQLDict.SQLDict(c)


class VAT(SQLDict.ObjectBuilder):
table = 'TBLVat'
columns = ['VATID','VATLabel']
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\lib\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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,362
Latest member
OrderTrimKetoBoost

Latest Threads

Top