to bsense
找到了 datasettoxls
我用 DataSetToXLS(ADOQhtqry,'C:/Documents and Settings/zpeng/桌面/new/file1.xls');
出错:range check error. 错误行在
procedure TXLSWriter.CellStr(vCol, vRow: word; aValue: String;
vAtribut: TSetOfAtribut);
var FAtribut:array [0..2] of byte;
slen:byte;
begin
Writeword(4); // opcode for string
slen:=length(avalue);
Writeword(slen+8); // count of byte
Writeword(vCol);
Writeword(vRow);
SetCellAtribut(vAtribut,fAtribut);
fStream.Write(fAtribut,3);
fStream.Write(slen,1);
fStream.Write(aValue[1],slen); //错误提示停留在最后两行
end;