Z
zz770813
Unregistered / Unconfirmed
GUEST, unregistred user!
exception class einouterror with message 'i/o error 6'
怎么回事?
procedure TmainForm.Timer2Timer(Sender: TObject);
var len,i,stard,endd:integer;
gdtimed,nowtime:tTime;
sjsj,kqsj:string;
//Present: TDateTime;
//Hour, Min, Sec, MSec: Word;
kssj,jssj:array[1..20] of double;
gdsj:array[1..20] of Ttime;
begin
adotable2.Open;
kqsj:=adotable2.FieldByName('kqtime').AsString;
adotable2.close;
len:=length(trim(kqsj)) div 14;
for i:=1 to len do //取考勤时间
begin
kssj:=strtoint(copy(kqsj,9+14*(i-1),3));
jssj:=strtoint(copy(kqsj,12+14*(i-1),3));
gdsj:=strtotime(copy(kqsj,1+(i-1)*14,8));
nowtime:=strtotime(formatdatetime('hh:mm:ss',now));
if nowtime>=(gdsj+jssj/(24*60)) then
begin
{kqsj:='';
adotable2.Open;
kqsj:=adotable2.FieldByName('kqtime').AsString;
adotable2.close;
len:=length(trim(kqsj)) div 14;}
//for i:=1 to len do
//begin
//stard:=strtoint(copy(kqsj,9+14*(i-1),3));
//endd:=strtoint(copy(kqsj,12+14*(i-1),3));
//gdtimed:=strtotime(copy(kqsj,1+(i-1)*14,8));
adotable3.Close;
adotable3.Open;
adotable3.First;
while not eof do
begin
with adoquery1 do
begin
close;
sql.clear;
sql.Add('select * from kqjg');
sql.Add('where sjtime>=(gdsj-(kssj)/(24*60))');
sql.Add('and sjtime<=(gdsj+(jssj)/(24*60))');
sql.add('and kqdate='''+datetostr(date)+'''');
open;
first;
while not eof do
begin
if FieldByName('cardID').AsString=adotable3.FieldByName('cardID').AsString then
next
else
begin
with adoquery2 do
begin
close;
SQL.clear;
sql.Add('select distinct student.cardID,stuID,stuname,classname from student,class');
sql.Add('where student.cardID='''+adoquery1.FieldByName('cardID').AsString+'''');
sql.Add('and student.classID=class.classID');
//sql.Add('and grade.gradeID=class.gradeID');
open;
end;
adotable1.Append;
adotable1.FieldByName('stuID').AsString:=adoquery2.FieldValues['stuID'];
adotable1.FieldByName('stuname').AsString:=adoquery2.FieldValues['stuname'];
//adotable1.FieldByName('gradename').AsString:=adoquery2.FieldValues['gradename'];
adotable1.FieldByName('classname').AsString:=adoquery2.FieldValues['classname'];
//adotable1.FieldByName('gdtime').AsString:=gdtime;
//adotable1.FieldByName('sjtime').AsString:=sjsj;
adotable1.FieldByName('kqdate').AsString:=datetostr(date);
//adotable1.FieldByName('jg').AsString:=jg;
adotable1.FieldByName('jg').AsString:='未刷卡';
adotable1.FieldByName('gdtime').AsString:=timetostr(gdtimed);
adotable1.Post;
end;
end;
end;
adotable3.Next;
end;
adotable3.Close;
//end;
end;
end;
end;
怎么回事?
procedure TmainForm.Timer2Timer(Sender: TObject);
var len,i,stard,endd:integer;
gdtimed,nowtime:tTime;
sjsj,kqsj:string;
//Present: TDateTime;
//Hour, Min, Sec, MSec: Word;
kssj,jssj:array[1..20] of double;
gdsj:array[1..20] of Ttime;
begin
adotable2.Open;
kqsj:=adotable2.FieldByName('kqtime').AsString;
adotable2.close;
len:=length(trim(kqsj)) div 14;
for i:=1 to len do //取考勤时间
begin
kssj:=strtoint(copy(kqsj,9+14*(i-1),3));
jssj:=strtoint(copy(kqsj,12+14*(i-1),3));
gdsj:=strtotime(copy(kqsj,1+(i-1)*14,8));
nowtime:=strtotime(formatdatetime('hh:mm:ss',now));
if nowtime>=(gdsj+jssj/(24*60)) then
begin
{kqsj:='';
adotable2.Open;
kqsj:=adotable2.FieldByName('kqtime').AsString;
adotable2.close;
len:=length(trim(kqsj)) div 14;}
//for i:=1 to len do
//begin
//stard:=strtoint(copy(kqsj,9+14*(i-1),3));
//endd:=strtoint(copy(kqsj,12+14*(i-1),3));
//gdtimed:=strtotime(copy(kqsj,1+(i-1)*14,8));
adotable3.Close;
adotable3.Open;
adotable3.First;
while not eof do
begin
with adoquery1 do
begin
close;
sql.clear;
sql.Add('select * from kqjg');
sql.Add('where sjtime>=(gdsj-(kssj)/(24*60))');
sql.Add('and sjtime<=(gdsj+(jssj)/(24*60))');
sql.add('and kqdate='''+datetostr(date)+'''');
open;
first;
while not eof do
begin
if FieldByName('cardID').AsString=adotable3.FieldByName('cardID').AsString then
next
else
begin
with adoquery2 do
begin
close;
SQL.clear;
sql.Add('select distinct student.cardID,stuID,stuname,classname from student,class');
sql.Add('where student.cardID='''+adoquery1.FieldByName('cardID').AsString+'''');
sql.Add('and student.classID=class.classID');
//sql.Add('and grade.gradeID=class.gradeID');
open;
end;
adotable1.Append;
adotable1.FieldByName('stuID').AsString:=adoquery2.FieldValues['stuID'];
adotable1.FieldByName('stuname').AsString:=adoquery2.FieldValues['stuname'];
//adotable1.FieldByName('gradename').AsString:=adoquery2.FieldValues['gradename'];
adotable1.FieldByName('classname').AsString:=adoquery2.FieldValues['classname'];
//adotable1.FieldByName('gdtime').AsString:=gdtime;
//adotable1.FieldByName('sjtime').AsString:=sjsj;
adotable1.FieldByName('kqdate').AsString:=datetostr(date);
//adotable1.FieldByName('jg').AsString:=jg;
adotable1.FieldByName('jg').AsString:='未刷卡';
adotable1.FieldByName('gdtime').AsString:=timetostr(gdtimed);
adotable1.Post;
end;
end;
end;
adotable3.Next;
end;
adotable3.Close;
//end;
end;
end;
end;