CLOSE ALL
SET SAFETY OFF
ADIR(mytables, '*.Dbf')
for TblCount = 1 to ADIR(mytables, '*.Dbf')
VarTable=mytables(TblCount,1)
use &VarTable
IF DBF()#SYS(5)+SYS(2003)+"\TEMPSTUCT.DBF"
copy struct to tempstuct extended
use tempstuct
go Min(RECCOUNT(),VarFieldNumbertoChange) && will change last field if specified number is out of range
VarActName=alltr(field_name)
use &VarTable
IF VarActName#VarNewFieldName AND DBF()#SYS(5)+SYS(2003)+"\TEMPSTUCT.DBF"
alter table &VarTable rename column &VarActName to &VarNewFieldName
ENDIF
ENDIF
ENDFOR
SET SAFETY On
I have just a litle problem. When I execute the code, I need to select manuelly the code page to continious the program(for each file in my folder). Is't possible to put some command in code to do that.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.