A
aolong79
Unregistered / Unconfirmed
GUEST, unregistred user!
我有一个Access数据库,里边保存了三项内容,分别是‘班级号’、‘数学成绩’、‘化学量化成绩’,其中‘班级号’格式为‘C30A',‘数学成绩’格式为‘123.45’,‘化学量化成绩’为科学计数,格式为‘1.234E-2’,即小数点后有三位,但是在导出到Excel时,此‘化学量化成绩’小数点后只有两位-‘1.23E-2’,不知道是怎么回事啊?我用的是如下代码保存数据:v:=createoleobject('excel.application');
v.caption:='保存数据';
v.workbooks.add;
v.visible:=true;
adotable1.Open;
for i:=0 to adotable1.FieldCount-1 do
begin
v.goto('r1'+'c'+inttostr(i+1));
v.activecell.formular1c1:=adotable1.Fields.FieldName;
end;
j:=2;
adotable1.First;
while not(adotable1.Eof) do
begin
for i:=0 to adotable1.FieldCount-1 do
begin
v.goto('r'+inttostr(j)+'c'+inttostr(i+1));
v.activecell.formular1c1:=adotable1.Fields.asstring;
end;
adotable1.Next;
j:=j+1;
end;
showmessage('数据保存完毕');
adotable1.first;
adotable1.enablecontrols;
v.quit;
end;
有没有高手给个解答啊?怎样改才能保存为小数点后三位呢?谢谢!!
v.caption:='保存数据';
v.workbooks.add;
v.visible:=true;
adotable1.Open;
for i:=0 to adotable1.FieldCount-1 do
begin
v.goto('r1'+'c'+inttostr(i+1));
v.activecell.formular1c1:=adotable1.Fields.FieldName;
end;
j:=2;
adotable1.First;
while not(adotable1.Eof) do
begin
for i:=0 to adotable1.FieldCount-1 do
begin
v.goto('r'+inttostr(j)+'c'+inttostr(i+1));
v.activecell.formular1c1:=adotable1.Fields.asstring;
end;
adotable1.Next;
j:=j+1;
end;
showmessage('数据保存完毕');
adotable1.first;
adotable1.enablecontrols;
v.quit;
end;
有没有高手给个解答啊?怎样改才能保存为小数点后三位呢?谢谢!!