******************************************************************** * Description.......: CreateVNames - create View for Names application * Calling Samples...: * Parameter List....: pcTable * Created by........: Nadya Nosonovsky 07/27/2000 01:41:10 PM * Modified by.......: ******************************************************************** lparameters pcTable wait window nowait "Creating WorkFile for Names..." ***************** Begin View Definition VNAMES *************** create sql view "VNAMES" ; as select recnum, propid, stateuse, ; fullname1, fullname2, buyer1, buyer2, buyerrel, ; moditype, moditble, named, adcnames ; from &pcTable ; where adcnames = .f. ; order by fullname1, fullname2 dbsetprop('VNAMES', 'View', 'UpdateType', 1) dbsetprop('VNAMES', 'View', 'WhereType', 3) dbsetprop('VNAMES', 'View', 'FetchMemo', .t.) dbsetprop('VNAMES', 'View', 'SendUpdates', .t.) dbsetprop('VNAMES', 'View', 'UseMemoSize', 255) dbsetprop('VNAMES', 'View', 'FetchSize', 100) dbsetprop('VNAMES', 'View', 'MaxRecords', -1) dbsetprop('VNAMES', 'View', 'Tables', pcTable) dbsetprop('VNAMES', 'View', 'Prepared', .f.) dbsetprop('VNAMES', 'View', 'CompareMemo', .t.) dbsetprop('VNAMES', 'View', 'FetchAsNeeded', .t.) dbsetprop('VNAMES', 'View', 'FetchSize', 100) dbsetprop('VNAMES', 'View', 'Comment', "") dbsetprop('VNAMES', 'View', 'BatchUpdateCount', 1) dbsetprop('VNAMES', 'View', 'ShareConnection', .f.) *!* Field Level Properties for VNAMES * Props for the VNAMES.propid field. dbsetprop('VNAMES.propid', 'Field', 'KeyField', .f.) dbsetprop('VNAMES.propid', 'Field', 'Updatable', .t.) dbsetprop('VNAMES.propid', 'Field', 'UpdateName', pcTable+'.propid') dbsetprop('VNAMES.propid', 'Field', 'DataType', "I") * Props for the VNAMES.stateuse field. dbsetprop('VNAMES.stateuse', 'Field', 'KeyField', .f.) dbsetprop('VNAMES.stateuse', 'Field', 'Updatable', .t.) dbsetprop('VNAMES.stateuse', 'Field', 'UpdateName', pcTable+'.stateuse') dbsetprop('VNAMES.stateuse', 'Field', 'DataType', "C(3)") * Props for the VNAMES.fullname1 field. dbsetprop('VNAMES.fullname1', 'Field', 'KeyField', .f.) dbsetprop('VNAMES.fullname1', 'Field', 'Updatable', .t.) dbsetprop('VNAMES.fullname1', 'Field', 'UpdateName', pcTable+'.fullname1') dbsetprop('VNAMES.fullname1', 'Field', 'DataType', "C(40)") * Props for the VNAMES.fullname2 field. dbsetprop('VNAMES.fullname2', 'Field', 'KeyField', .f.) dbsetprop('VNAMES.fullname2', 'Field', 'Updatable', .t.) dbsetprop('VNAMES.fullname2', 'Field', 'UpdateName', pcTable+'.fullname2') dbsetprop('VNAMES.fullname2', 'Field', 'DataType', "C(40)") * Props for the VNAMES.buyer1 field. dbsetprop('VNAMES.buyer1', 'Field', 'KeyField', .f.) dbsetprop('VNAMES.buyer1', 'Field', 'Updatable', .t.) dbsetprop('VNAMES.buyer1', 'Field', 'UpdateName', pcTable+'.buyer1') dbsetprop('VNAMES.buyer1', 'Field', 'DataType', "C(25)") * Props for the VNAMES.buyer2 field. dbsetprop('VNAMES.buyer2', 'Field', 'KeyField', .f.) dbsetprop('VNAMES.buyer2', 'Field', 'Updatable', .t.) dbsetprop('VNAMES.buyer2', 'Field', 'UpdateName', pcTable+'.buyer2') dbsetprop('VNAMES.buyer2', 'Field', 'DataType', "C(25)") * Props for the VNAMES.buyerrel field. dbsetprop('VNAMES.buyerrel', 'Field', 'KeyField', .f.) dbsetprop('VNAMES.buyerrel', 'Field', 'Updatable', .t.) dbsetprop('VNAMES.buyerrel', 'Field', 'UpdateName', pcTable+'.buyerrel') dbsetprop('VNAMES.buyerrel', 'Field', 'DataType', "C(1)") * Props for the VNAMES.recnum field. dbsetprop('VNAMES.recnum', 'Field', 'KeyField', .t.) dbsetprop('VNAMES.recnum', 'Field', 'Updatable', .f.) dbsetprop('VNAMES.recnum', 'Field', 'UpdateName', pcTable+'.recnum') dbsetprop('VNAMES.recnum', 'Field', 'DataType', "I") * Props for the VNAMES.moditype field. dbsetprop('VNAMES.moditype', 'Field', 'KeyField', .f.) dbsetprop('VNAMES.moditype', 'Field', 'Updatable', .t.) dbsetprop('VNAMES.moditype', 'Field', 'UpdateName', pcTable+'.moditype') dbsetprop('VNAMES.moditype', 'Field', 'DataType', "C(1)") * Props for the VNAMES.moditble field. dbsetprop('VNAMES.moditble', 'Field', 'KeyField', .f.) dbsetprop('VNAMES.moditble', 'Field', 'Updatable', .t.) dbsetprop('VNAMES.moditble', 'Field', 'UpdateName', pcTable+'.moditble') dbsetprop('VNAMES.moditble', 'Field', 'DataType', "C(8)") * Props for the VNAMES.named field. dbsetprop('VNAMES.named', 'Field', 'KeyField', .f.) dbsetprop('VNAMES.named', 'Field', 'Updatable', .t.) dbsetprop('VNAMES.named', 'Field', 'UpdateName', pcTable+'.named') dbsetprop('VNAMES.named', 'Field', 'DataType', "C(1)") * Props for the VNAMES.adcnames field. dbsetprop('VNAMES.adcnames', 'Field', 'KeyField', .f.) dbsetprop('VNAMES.adcnames', 'Field', 'Updatable', .t.) dbsetprop('VNAMES.adcnames', 'Field', 'UpdateName', pcTable+'.adcnames') dbsetprop('VNAMES.adcnames', 'Field', 'DataType', "L") wait clearSeems fine. But for some unknown reason it doesn't set Tables correctly for the view. I spent time trying to make it work and finally I ended with cursorsetprop('Tables',pcTable). This solved the problem. But I still don't understand why it doesn't work in the program. It's a real mystery for me...