下列代码中DBF表中日期型字段不起作用,请大侠指点,万分感谢!!!
Close Databases
Use 干部信息汇总表 In 0
Zap
Local Axx[20]
oWord=Createobject('word.Application')
For i=1 To Adir(c_File,"*.doc")
oDoc=oWord.Documents.Open(Sys(5)+Sys(2003)+"\"+c_File[i,1])
oTable=oWord.ActiveDocument.Tables(1)
With oTable
Axx[1]=Alltrim(.Cell(1,2).Range.Text,0h0D,0h07,0h20)
Axx[2]=Alltrim(.Cell(1,4).Range.Text,0h0D,0h07,0h20)
Axx[3]=Val(.Cell(1,6).Range.Text) && 年龄为数值型
Axx[4]=Alltrim(.Cell(2,2).Range.Text,0h0D,0h07,0h20)
Axx[5]=Alltrim(.Cell(2,4).Range.Text,0h0D,0h07,0h20)
Axx[6]=Alltrim(.Cell(2,6).Range.Text,0h0D,0h07,0h20)
Axx[7]=Ctod(Transform(.Cell(3,2).Range.Text,"@R9999-99-99")) && 日期型不起作用
Axx[8]=Ctod(Transform(.Cell(3,4).Range.Text,"@R9999-99-99")) && 日期型不起作用
Axx[9]=Alltrim(.Cell(3,6).Range.Text,0h0D,0h07,0h20)
Axx[10]=Alltrim(.Cell(4,2).Range.Text,0h0D,0h07,0h20)
Axx[11]=Alltrim(.Cell(4,4).Range.Text,0h0D,0h07,0h20)
Axx[12]=Alltrim(.Cell(4,4).Range.Text,0h0D,0h07,0h20)
Axx[13]=Alltrim(.Cell(5,3).Range.Text,0h0D,0h07,0h20)
Axx[14]=Alltrim(.Cell(5,5).Range.Text,0h0D,0h07,0h20)
Axx[15]=Alltrim(.Cell(6,5).Range.Text,0h0D,0h07,0h20)
Axx[16]=Alltrim(.Cell(7,3).Range.Text,0h0D,0h07,0h20)
Axx[17]=Alltrim(.Cell(7,5).Range.Text,0h0D,0h07,0h20)
Axx[18]=Alltrim(.Cell(8,5).Range.Text,0h0D,0h07,0h20)
Axx[19]=Alltrim(.Cell(9,2).Range.Text,0h0D,0h07,0h20)
Axx[20]=Alltrim(.Cell(10,2).Range.Text,0h0D,0h07,0h20)
Insert Into 干部信息汇总表 From Array Axx
Endwith
oDoc.Close
Endfor
Release oWord
Select 干部信息汇总表
Browse
Use In 干部信息汇总表
[此贴子已经被作者于2021-4-15 19:50编辑过]