Hi!
Just append blank and tableupdate(). You require to assure your view is set up to use identity field as a key field for view, and this field should not be marked as updatable.
Also, you probably want to update your record by that ID from server that is generated after tableupdate(). You can do following:
1. tableupdate()
2. run command: SQLEXEC(CursorGetProp("ConnectHandle","MyRemteViewName"),"SELECT @@IDENTITY as nn", "TempCursor")
3. TempCursor is retruned with the last Identity field value. Do REPLACE MyRemteViewName.IDField with TempCursor.nn in MyRemteViewName
4. tableupdate()... again! Yes, its true,tableupdate() it again. Because you changed (locally) only ID field, there are no any pending changes in your view that should be sent to server (ID field is marked as not updatable). So this second tableupdate() would not generate any command for SQL Server. however, it is require to mark ID field as not changed (Se GetFldStat() function in help), so VFP would not revert it next time user changes something in new record and then cancel tehse changes.
Note that when your connection is asynchronous, then step 2 might require certain adjustments...
HTH.
>How can I add a record to MSSQL database using an Identity key as a primary key?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.