I don't know legacy primary key web2py feature, but it is strange if your premarykey fields are writable=false how could it be possible to fill those records since they will not be accessible in your form?
At the end of the section about legacy table in the book : http://web2py.com/books/default/chapter/29/06?search=primary+key#Legacy-databases-and-keyed-tables It says this : At the time of writing, we cannot guarantee that the primarykey attribute works with every existing legacy table and every supported database backend. For simplicity, we recommend, if possible, creating a database view that has an auto-increment id field. So maybe MSSQL adapter is not working properly with keyed table?! If you only want to consult those data you maybe can create a view at the backend with a id field and use this view to access the information... Hope it helps Richard On Fri, Mar 22, 2013 at 2:19 PM, Raul Monares <[email protected]> wrote: > I have a MSSQL database with a 4 column primary key: > > dbcomercial.define_table('libros', > Field('bloque',writable=False), > Field('grupo',writable=False), > Field('sector',writable=False), > Field('libro',writable=False), > Field('estatus'), > Field('id_movil'), > primarykey=['bloque','grupo','sector','libro'], > migrate=False > ) > > This gives me an error: 'Table' object has no attribute '_id'. > If I only specity on column in primarykey, I get no error, but can't do > any updates. > Using w2p 2.4.5 > > -- > > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

