tag it will preserve the tabbing. >></XMP> >>> >> >> >> <pre> >>>select (tcTableName) >>>dime aFlds(1) >>>nNoFields = afield(aFlds) >>> >>>for lnKnt = 1 to nNoFields >>> lcFieldName = tcViewName + "." + aFlds(lnKnt,1) >>> lcUpdateField = tcTableName + "." + aFlds(lnKnt,1) >>> lcFieldType = aFlds(lnKnt,2) + ; >>> "(" + alltrim(str(aFlds >> >>It looks like here that the keyfield is not updatable but the rest are. >>I thinks you want all of your fields updatable. >> >>(lnKnt,3)) + ")" ) >>> if aFlds(lnKnt,1) = cIDField >>> DBSetProp(lcFieldName, 'Field', 'KeyField', .t.) Changed this lin >>> DBSetProp(lcFieldName, 'Field', 'Updatable', .t.) >>> else >>> DBSetProp(lcFieldName, 'Field', 'KeyField', .f.) >>> DBSetProp(lcFieldName, 'Field', 'Updatable', .t.) >>> endif >>> DBSetProp(lcFieldName, 'Field', 'UpdateName', lcUpdateField) >>> DBSetProp(lcFieldName, 'Field', 'DataType', lcFieldType) >>>endfor >> >>>HTH