not that I know of.
we always modify the structure of an empty dbf and append the data back into it.
See if this helps any.
ofile = substr(ofile,1,7)
copy structure extended to temp
select 0
openfile("TEMP", .t.)
addrecord()
replace field_name with "D_1", field_type with "C", field_len with 2, field_dec with 0
addrecord()
replace field_name with "D_2", field_type with "C", field_len with 3, field_dec with 0
select (ofile)
use
select temp
use
create newdap.dbf from temp
if file('TEMP.DBF')
erase temp.dbf
endif
openfile('NEWDAP', .t.)
append from (ofile)
use
store (ofile)+'.DBF' to mdfile
delete file (mdfile)
rename newdap.dbf to (mdfile)
select 0
openfile(ofile,how)
There are two functions you can use to modify a DBF structure in Clipper (5.2e). They are DBSTRUCT and DBCREATE. DBSTRUCT returns an array containing the structure of the active workarea's DBF. You can then make the adjustments you wish to this array and use DBCREATE to create a new DBF with the modified structure. Check the NG files for more information on these functions.
An important note should be considered. The new DBF will be empty and should have a different name from the original. To fill the new DBF, just do an APPEND FROM the old DBF. Just remember that any differences in structure will not be transfered and be left blank in the new DBF.
I wrote a wee program to convert databases from Escudos to Euros which involved reading the structure of said databases and allowing alteration from within the program. It was written in haste and may need some re-coding but if you drop your email I can send you the code.
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.