以下是引用sdta在2014-8-28 09:01:47的发言:
上传相关原始数据表,要对症下药。
上传相关原始数据表,要对症下药。
rwd.zip
(1.8 KB)
像这样的数据表比较多,这套程序运行下来大概有二十多个,每一个表的memo字段都不同。
Close Databases If Adir(Adbf,"*.Dbf")<=0 Return EndIf For lnI=1 To Alen(Adbf,1) Use (Adbf[lnI,1]) lnZds=AFields(Afld) Use In (Adbf[lnI,1]) lcStr="Select " For lnJ=1 To lnZds lcStr=lcStr+Iif(Afld[lnJ,2]=="M","Cast("+Afld[lnJ,1]+" As C(254))"+" "+Afld[lnJ,1],Afld[lnJ,1]+" "+Afld[lnJ,1])+Iif(lnJ<lnZds,","," From (Adbf[lnI,1]) Into Cursor Temp") EndFor *=MessageBox(lcStr,64,"代码显示") =ExecScript(lcStr) copy to Sys(5)+Sys(2003)+"\"+JustStem(Adbf[lnI,1]) type csv Use In Temp EndFor