寒
寒与凉
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm2.BitBtn15Click(Sender: TObject);
var M,N,i,j,lxsh:Integer;
zhname:string;
rq5:TDatetime;
begin
query2.close;
query2.SQL.clear;
query2.SQL.add('select count (*) from mainku');
query2.prepare;
query2.Open;
N:=query2.RecordCount;
For i:=1 to N do
begin
query2.close;
query2.sql.Clear;
query2.sql.add('select * from mainku where Zh Number =N');
query2.prepare;
query2.Open;
zhname:=query2.fieldbyname('zh').asstring;
query2.close;
query2.sql.Clear;
query2.sql.add('select count * from history where zh='+'zhname');
query2.prepare;
query2.Open;
M:=query2.recordCount;
For j:=1 to M do
begin
query2.close;
query2.sql.Clear;
query2.sql.add('select * from history where lsh Number =M');
query2.prepare;
query2.Open;
rq5:=strtodatetime(query2.fieldbyname('qsr').asstring);
lxsh:=query2.fieldbyname('fsje').asinteger * strtoint(floattostr(03/31/2002-rq5));
query2.close;
query2.sql.Clear;
query2.sql.add('update mainku set lx='+'lxsh'+'where Zh='+'N');
query2.prepare;
query2.execsql;
end;
end;
报错是:Invalid use of keydord Token :Number
var M,N,i,j,lxsh:Integer;
zhname:string;
rq5:TDatetime;
begin
query2.close;
query2.SQL.clear;
query2.SQL.add('select count (*) from mainku');
query2.prepare;
query2.Open;
N:=query2.RecordCount;
For i:=1 to N do
begin
query2.close;
query2.sql.Clear;
query2.sql.add('select * from mainku where Zh Number =N');
query2.prepare;
query2.Open;
zhname:=query2.fieldbyname('zh').asstring;
query2.close;
query2.sql.Clear;
query2.sql.add('select count * from history where zh='+'zhname');
query2.prepare;
query2.Open;
M:=query2.recordCount;
For j:=1 to M do
begin
query2.close;
query2.sql.Clear;
query2.sql.add('select * from history where lsh Number =M');
query2.prepare;
query2.Open;
rq5:=strtodatetime(query2.fieldbyname('qsr').asstring);
lxsh:=query2.fieldbyname('fsje').asinteger * strtoint(floattostr(03/31/2002-rq5));
query2.close;
query2.sql.Clear;
query2.sql.add('update mainku set lx='+'lxsh'+'where Zh='+'N');
query2.prepare;
query2.execsql;
end;
end;
报错是:Invalid use of keydord Token :Number