请高手帮我看下程序有什么问题。谢谢了。我点击确定就出现什么地址错误,access violate之类。还有can not open fileD\delphi7\bin\init32.cc.debuge not initialize.
我的程序是:(把表1,2,3中的内容经过四则运算写到表4中,并显示在DBGrid里)
table1.Open;
table2.Open;
table3.Open;
table4.Open;
with table1 do
begin First;
while not table1.Eof do
begin
getstring1:=FieldByName('项目名').AsString;
with table2 do
begin
IndexFieldNames:='项目名';
if FindKey([getstring1])then
begin
with table3 do
begin
IndexFieldNames:='项目名';
if FindKey([getstring1])then
begin
hetonge:=table1.FieldByName('合同额').AsCurrency*0.06;
lirune:=table1.FieldByName('利润额').AsCurrency*0.06;
with table4 do
begin
IndexFieldNames:='项目名';
if FindKey([getstring1])then
begin
table1.Next;
End
else
begin
table4.Append;
table4.FieldByName('项目名').AsString:=getstring1;
table4.FieldByName('规模指标').AsCurrency:=hetonge*0.4+lirune*0.4+table1.FieldByName('完成时间').AsCurrency*0.1+table1.FieldByName('技术人员数').AsCurrency*0.1;
table4.FieldByName('效益指标').AsCurrency:=table3.FieldByName('利润率').AsCurrency*40+table3.FieldByName('外购所占比').AsCurrency*40+table3.FieldByName('实际支出与预算比').AsCurrency*10+table3.FieldByName('实际时间与预算比').AsCurrency*10;
table4.FieldByName('技术指标').AsCurrency:=table2.FieldByName('项目类型').AsCurrency*0.1+table2.FieldByName('用户满意度').AsCurrency*0.5+table2.FieldByName('技术创新性').AsCurrency*0.4;
table4.FieldByName('综合指标').AsCurrency:=table4.FieldByName('规模指标').AsCurrency*0.1+table4.FieldByName('效益指标').AsCurrency*0.5+table4.FieldByName('技术指标').AsCurrency*0.4;
table4.Post;
DBGrid4.Refresh;
end;
end;
end;
end;
end;
end;
end;
Next;
end;
我的程序是:(把表1,2,3中的内容经过四则运算写到表4中,并显示在DBGrid里)
table1.Open;
table2.Open;
table3.Open;
table4.Open;
with table1 do
begin First;
while not table1.Eof do
begin
getstring1:=FieldByName('项目名').AsString;
with table2 do
begin
IndexFieldNames:='项目名';
if FindKey([getstring1])then
begin
with table3 do
begin
IndexFieldNames:='项目名';
if FindKey([getstring1])then
begin
hetonge:=table1.FieldByName('合同额').AsCurrency*0.06;
lirune:=table1.FieldByName('利润额').AsCurrency*0.06;
with table4 do
begin
IndexFieldNames:='项目名';
if FindKey([getstring1])then
begin
table1.Next;
End
else
begin
table4.Append;
table4.FieldByName('项目名').AsString:=getstring1;
table4.FieldByName('规模指标').AsCurrency:=hetonge*0.4+lirune*0.4+table1.FieldByName('完成时间').AsCurrency*0.1+table1.FieldByName('技术人员数').AsCurrency*0.1;
table4.FieldByName('效益指标').AsCurrency:=table3.FieldByName('利润率').AsCurrency*40+table3.FieldByName('外购所占比').AsCurrency*40+table3.FieldByName('实际支出与预算比').AsCurrency*10+table3.FieldByName('实际时间与预算比').AsCurrency*10;
table4.FieldByName('技术指标').AsCurrency:=table2.FieldByName('项目类型').AsCurrency*0.1+table2.FieldByName('用户满意度').AsCurrency*0.5+table2.FieldByName('技术创新性').AsCurrency*0.4;
table4.FieldByName('综合指标').AsCurrency:=table4.FieldByName('规模指标').AsCurrency*0.1+table4.FieldByName('效益指标').AsCurrency*0.5+table4.FieldByName('技术指标').AsCurrency*0.4;
table4.Post;
DBGrid4.Refresh;
end;
end;
end;
end;
end;
end;
end;
Next;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货