W
wangqinyun2000
Unregistered / Unconfirmed
GUEST, unregistred user!
表ADOQ61 为保存数据<br>表ADOQ62 存放表ADOQ61字段信息有字段名,字段类型等!!<br>表ADOQ63 读ELS文件内容<br><br>XLS文件三万多记录,导入数据要十多分钟,能不能帮提些速啊<br><br>高手帮帮忙啊,主要代码如下:<br>procedure TForm6.RzButton1Click(Sender: TObject);<br>var<br> fs3,res1,res2,res3:string;<br> rei1:integer;<br>begin<br>fs3:='';<br>fs3:='select * from fname1 where TABNAME='+#39+fs1+#39;<br>with DataModule17 do<br>begin<br> ADOQ63.SQL.Clear;<br> ADOQ63.Close;<br> ADOQ63.SQL.Add(fs3);<br> ADOQ63.Open;<br> ADOQ62.First;<br> while not (ADOQ62.Eof) do<br> begin<br> ADOQ61.Append;<br> ADOQ63.First;<br> while not(ADOQ63.Eof) do<br> begin<br> res1:=trim(ADOQ63.FieldByName('FNAME').Value);<br> rei1:=ADOQ63.FieldByName('EXCELNO').Value-1;<br> res2:=trim(copy(ADOQ63.FieldByName('bak').Value,1,1));<br> if res2='C' then<br> begin<br> ADOQ61.FieldByName(res1).AsString:=trim(ADOQ62.fields[rei1].AsString);<br> end;<br> if res2='D' then<br> begin<br> IF trim(ADOQ62.fields[rei1].asstring)<>'' THEN ADOQ61.FieldByName(res1).AsDateTime:=ADOQ62.fields[rei1].AsDateTime;<br> end;<br> if res2='N' then<br> begin<br> res3:=TRIM(ADOQ62.fields[rei1].AsString);<br> if res3='' then res3:='0';<br> ADOQ61.FieldByName(res1).AsFloat:=STRTOFLOAT(trim(res3));<br> end;<br> ADOQ63.Next;<br> end;<br> ADOQ61.FieldByName('SYSDATA').AsDateTime:=Rzdatetimeedit1.Date;<br> ADOQ61.FieldByName('DCDATA').AsDateTime:=Rzdatetimeedit1.Date;<br> ADOQ61.POST;<br> ADOQ62.Next;<br> // Application.MessageBox('4', '矗ボ', MB_ICONINFORMATION);<br> end;<br>END;<br>end;