利用TStringLis将数据集快速保存为Excel能识别的文件
利用Excel能够#9字符的特点,我们可以将大数据量的数据集保存为Excel能够识别的文件,而且速度超快,请看代码
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
procedure Tfrm_机旁_上机管理.Button12Click(Sender: TObject); var J: Integer; List: TStringList; s: string; begin List := TStringList.Create; Q_机旁.DisableControls; for J := 0 to Q_机旁.FieldCount - 1 do s := s + Q_机旁.Fields[J].FieldName + #9; List.Add(s); while not Q_机旁.Eof do begin s := ''; for J := 0 to Q_机旁.FieldCount - 1 do s := s + Q_机旁.Fields[J].AsString + #9; List.Add(s); Q_机旁.Next; end; List.SaveToFile('1.xls'); Q_机旁.EnableControls; List.Free; end; |
rounded up some fabulous crafts ideas for you and your family. Enjoy!5 Halloween craft idaeeHallowesn pop box gift from Lil LunaCandy corn treat bags from I Heart Nap TimeHalloween silhouettes with free download