请教:判断文件夹下多个dbf文件并自动追加

文件夹下有多个相同结构dbf文件(有时几十个),想将他们合并到一个文件中,尝试了一段小程序但错误,请高手指教。
同时请教,
1.库结构相同,如何自动判断建立空白库
2.文件夹下若有子目录(比如6、7),如何穿透追加子文件夹下dbf文件
[此贴子已经被作者于2023-9-18 17:00编辑过]
clear close databases create cursor hb (xxmc c(40),xm c(20),xjh c(23),yycj c(6),mscj c(6)) &&&建立一个空白表 path=getdir() lnfiles=adir(afile,path+'*.dbf') * ? lnfiles[color=#808080]&& 显示数据库数目[/color] for ncount = 1 to alen(afile,1) && 遍历数据库 表名 = afile(ncount,1) && 显示数据库名 ? 表名 select hb append from (表名) endfor select hb browse
[此贴子已经被作者于2023-9-18 20:29编辑过]
[此贴子已经被作者于2023-9-19 18:07编辑过]
create cursor hb (xxmc c(40),xm c(20),xjh c(23),yycj c(6),mscj c(6)) &&&建立一个空白表 adir(afile,sys(5)+sys(2003)+'\*.dbf') && 获取当前目录下所有dbf文件 for ncount = 1 to alen(afile,1) && 遍历数据库 表名 = afile(ncount,1) && 显示数据库名 select hb append from (表名) endfor select *,val(xxmc) as px from hb order by px