CREATE DATABASE testdbc IF MESSAGEBOX('Do you want to see the problem?',4,'Help!')=6 then CREATE TABLE test (f1 C(10) primary key, f2 C(10)) ELSE CREATE TABLE test (f1 C(10), f2 C(10)) ENDIF ***************** Begin View Definition VIEW1 *************** CREATE SQL VIEW "VIEW1" ; AS SELECT * FROM testdbc!test DBSetProp('VIEW1', 'View', 'UpdateType', 1) DBSetProp('VIEW1', 'View', 'WhereType', 3) DBSetProp('VIEW1', 'View', 'FetchMemo', .T.) DBSetProp('VIEW1', 'View', 'SendUpdates', .T.) DBSetProp('VIEW1', 'View', 'UseMemoSize', 255) DBSetProp('VIEW1', 'View', 'FetchSize', 100) DBSetProp('VIEW1', 'View', 'MaxRecords', -1) DBSetProp('VIEW1', 'View', 'Tables', 'testdbc!test') DBSetProp('VIEW1', 'View', 'Prepared', .F.) DBSetProp('VIEW1', 'View', 'CompareMemo', .T.) DBSetProp('VIEW1', 'View', 'FetchAsNeeded', .T.) DBSetProp('VIEW1', 'View', 'FetchSize', 100) DBSetProp('VIEW1', 'View', 'Comment', "") DBSetProp('VIEW1', 'View', 'BatchUpdateCount', 1) DBSetProp('VIEW1', 'View', 'ShareConnection', .F.) *!* Field Level Properties for VIEW1 * Props for the VIEW1.f1 field. DBSetProp('VIEW1.f1', 'Field', 'KeyField', .T.) DBSetProp('VIEW1.f1', 'Field', 'Updatable', .T.) DBSetProp('VIEW1.f1', 'Field', 'UpdateName', 'testdbc!test.f1') DBSetProp('VIEW1.f1', 'Field', 'DataType', "C(10)") * Props for the VIEW1.f2 field. DBSetProp('VIEW1.f2', 'Field', 'KeyField', .F.) DBSetProp('VIEW1.f2', 'Field', 'Updatable', .T.) DBSetProp('VIEW1.f2', 'Field', 'UpdateName', 'testdbc!test.f2') DBSetProp('VIEW1.f2', 'Field', 'DataType', "C(10)") SELECT test =CURSORSETPROP("Buffering", 5) USE view1 IN 0 AGAIN SELECT view1 =CURSORSETPROP("Buffering", 5) SET DELETED OFF SELECT view1 REQUERY() INSERT INTO view1(f1) VALUES ('Hey!') =TABLEUPDATE(.f.,.t.,'view1') replace view1.f1 WITH 'What?' IN view1 =TABLEUPDATE(.f.,.t.,'view1') IF DELETED('view1') then =MESSAGEBOX('This newly inserted record is deleted... Why?',0,'Hmmm.') ELSE =MESSAGEBOX('Everything is ok.',0,':)') ENDIF BROWSE SELECT view1 USE SELECT test USE CLOSE DATABASES all SET SAFETY OFF DELETE database testdbc.dbc deletetables