com.servoy.j2db.dataprocessing.DataException: Cannot insert explicit value for identity column in table ‘users’ when IDENTITY_INSERT is set to OFF.
Googling for the error comes up with lots of MS SQL info so I assume you are using MS SQL.
It seems you can’t set your own PK values when IDENTITY_INSERT is off.
Do you use Servoy sequences ? if so I guess you need to change that setting like this:
SET IDENTITY_INSERT users ON;
Fire that piece of SQL to the database and it should work.
Now however if you don’t use Servoy sequences and want to use the db sequences/identities (and still want to be able to pass the PK in an insert) you need to set it OFF again right after your insert.
MSSQL will update it’s ID’s and will make sure there will be no duplicates.
(at least that is the info I read on the internet)
Resources:
http://blogs.msdn.com/sqlservercompact/ … n-off.aspx
http://p2p.wrox.com/topic.asp?TOPIC_ID=27178
Hope this helps.
Or in short: the table’s pk is set to db identity, but in Servoy it is set to Servoy sequence. Servoy wants to write a value to the PK column, but the database wants to take care of that as well. You can set that column to “DB Identity” in Servoy and Servoy will not mess with that.