lcSQL="select * from salman" lnSelect=sqlexecute(lnConn,lcSQL,"cuSalman")Then get it ready for updates
CURSORSETPROP("Tables","salman","cuSalman") CURSORSETPROP("UpdateName","sls_no salman.sls_no","cuSalman") CURSORSETPROP("UpdateName","sls_nm salman.sls_nm","cuSalman") CURSORSETPROP("KeyFieldList","sls_no","cuSalman") CURSORSETPROP("UpdatableFieldList","sls_no,sls_nm","cuSalman") CURSORSETPROP("SendUpdates",.t.,"cuSalman")If I then browse this cursor and add a record like sls_no=50 and sls_nm="Test Salesman", and then committ the record (move off the record), if their isn't a record with sls_no=0, it will committ the new record but change the sls_no to zero (but doesn't display the change to zero in VFP, subsequent queries shows the sls_no as zero). If I then try to add another record like sls_no=100 and sls_nm="Test Salesman Again" I will get an error that I violated the primary key of the table, because VFP is trying to committ sls_no again as zero. If I just enter a new sls_no field I get the error "Cannot insert an empty row from a view or CursorAdapter into base table(s)", although the sls_nm field can accept null values in mySQL.
>APPEND BLANK >BLANK >TABLEUPDATE() >