cfile = 'c:\db\prg\menu\past.DBF' use past if 'thh05'$cfile = .F. wait window "already changed"+CHR(13)+"Click to close" else Alter Table c:\db\prg\menu\past.DBF Rename Column thh05 To thh11 wait window "Past database file has been changed " close all endifthe following version produced error when rename command is encountered - ie it does not find the missing thh05 as field name as well sergey's.
close all cfile='c:\db\prg\menu\past.DBF' SELECT 0 USE (cFile) IF TYPE(ALIAS() + '.' + thh05) <> "U" USE Alter Table c:\db\prg\menu\past.DBF Rename Column thh05 To thh11 else wait window "File has already been altered" ENDIF USEk
>SELECT 0 >USE (cFile) >IF Empty(Field('thh05')) > USE > Alter Table c:\db\past.DBF Rename Column thh05 To thh11 >ENDIF >USE >>
>>SELECT 0 >>USE (cFile) >>IF TYPE(ALIAS() + '.' + thh05) <> "U" >> USE >> Alter Table c:\db\past.DBF Rename Column thh05 To thh11 >>ENDIF >>USE >>>>
>>>cfile='c:\db\past.DBF' >>>if 'thh05'$cfile = .F. >>>>>>k
>>>>Alter Table c:\db\past.DBF Rename Column thh05 To thh11 >>>>>>>>