lnHandle=SQLCONNECT("MyDataSource") lnResult=SQLEXEC(lnHandle,[SELECT * FROM MyTable],"MyTable") IF lnResult<1 =AERROR(Errors) && Handle errors gracefully =oErrors.Msg() && if something goes wrong RETURN lnResult ENDIF llResult=CURSORSETPROP("Tables","MyTable","MyTable") IF llResult=.F. =AERROR(Errors) =oErrors.Msg() RETURN lnResult ENDIF *** * lcUpdateList comes in handy if you have a lot of fields * lcFields1="Field1 TableName.Field1,....Field(n) Tablename.Field(n)" * Because of FP string-length limitations you then have to do a * lcUpdateList=lcFields1+lcFields2+...lcFields(n) * Below is the simple version *** lcUpdateList="Field1 MyTable.Field1,Field2 MyTable.Field2" llResult=CURSORSETPROP("UpdateNameList",lcUpdateList,"MyTable") IF llResult=.F. =AERROR(Errors) =oErrors.Msg() RETURN lnResult ENDIF llResult=CURSORSETPROP("KeyFieldList","Field1,Field2,"MyTable") IF llResult=.F. =AERROR(Errors) =oErrors.Msg() RETURN lnResult ENDIF llResult=CURSORSETPROP("UpdatableFieldList","Field1,Field2","MyTable") IF llResult=.F. =AERROR(Errors) =oErrors.Msg() RETURN lnResult ENDIF llResult=CURSORSETPROP("Buffering",5,"MyTable") IF llResult=.F. =AERROR(Errors) =oErrors.Msg() RETURN lnResult ENDIFNow you can insert, update, delete and what not, and in the end just issue
llResult=TABLEUPDATE(2,.T.,"MyTable",Errors)and lo and behold, if all goes well, your stuff is updated!