下列代码有点问题,请高手指教,万分感谢!!!
SET talk OFF
SET SAFETY OFF
CLOSE DATABASES
CLEAR ALL
cDefpath=ADDBS(JUSTPATH(SYS(16)))
SET DEFAULT TO (cDefpath)
CREATE TABLE tt (编号 C(10),姓名 C(10),出生年月 C(10),语文 I,数学 I,英语 I)
oWord=CREATEOBJECT("word.application")
FOR i=1 TO ADIR(c_File,"*.doc")
oDoc=oWord.Documents.OPEN(cDefpath+"\"+c_File(i,1))
oTab=oDoc.tables(1)
FOR j=1 TO 2
k=3
DO WHILE k<33
IF ISNULL(oTab.Cell(k,(j-1)*6+1).RANGE.TEXT)
EXIT
ENDIF
INSERT INTO tt VALUES (;
ALLTRIM(oTab.Cell(k,(j-1)*6+1).RANGE.TEXT,0h0d,0h07,0h20),;
ALLTRIM(oTab.Cell(k,(j-1)*6+2).RANGE.TEXT,0h0d,0h07,0h20),;
ALLTRIM(oTab.Cell(k,(j-1)*6+3).RANGE.TEXT,0h0d,0h07,0h20),;
VAL(oTab.Cell(k,(j-1)*6+4).RANGE.TEXT),;
VAL(oTab.Cell(k,(j-1)*6+5).RANGE.TEXT),;
VAL(oTab.Cell(k,(j-1)*6+6).RANGE.TEXT))
k=k+1
enddo
ENDFOR
oDoc.CLOSE
oWord.QUIT
ENDFOR
SELECT * FROM tt
[此贴子已经被作者于2021-12-20 12:53编辑过]