Toni
sqlexec(lnHndl,"insert table (column) values (value);select @@identity as mypk","cursor")
lnPk = cursor.mypk
sqlexec(lnHndl,"select * from table where mypk = lnPk
this works unless you have a trigger that is inserting a row in another table then you have do some things that will give you the correct @@identity.
>Hi everybody
>
>I am using ms sql server as back end together with VFP 6. I have problem with updating new entered data via SPT.
>
>
>Index key in the table is defined as IDENTITY. I can enter the data and Tableupdate(.T.) writes data to the back end. Problem is if I make changes to previously appended record. Identity field in grid is still 0.
>
>I get error Update conflict (Error 1585): An optimistic locking conflict has been detected while trying to update a view.
>
>All other records which were apended earlier they have IDENTITY > 0 can be changed, problem is yust with record which is new for VFP.
>
>
>Thanks in advance
>
>
>Toni