双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

大家帮我看看我这段代码有什么问题,关于删除门禁机白名单的。

Liyp92 Liyp92 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

begin
clk.Port:=cbComPort.ItemIndex+1;
clk.baudrate:=StrToInt(cbComRate.Text);
clk.clock_id:=StrToInt('$'+edClock_id.Text);

ClosePort(@clk, clk.CommStyle);
if OpenPort(@clk, clk.CommStyle) then
begin
Panel5.Visible := True;
//刪除離職
WhiteList.Close;
WhiteList.SQL.Clear;
WhiteList.SQL.Add('SELECT * FROM WhiteList WHERE CardNo NOT IN(SELECT PNL FROM P_PERSON_P20140922 WHERE [Status]<>''R'')');
WhiteList.Open;

if WhiteList.RecordCount >0 then
begin
WhiteList.First;
//while not WhiteList.Eof do
for L:=0 to WhiteList.RecordCount-1 do
begin
Showmessage(WhiteList.FieldByName('CardNo').AsString);
if DeleteAllowedCard(clk.hPort,pChar(WhiteList.FieldByName('CardNo').AsString)) then //这里经常出错,有时可以有时又不行
begin
//刪除數據庫
WhiteList.Delete;
Panel5.Caption := Format('正在刪除卡機第:%d笔记录, 剩余记录数:%d(总共记录数:%d)', [WhiteList.RecNO, WhiteList.RecordCount-WhiteList.RecNO, WhiteList.RecordCount]);
Panel5.Refresh;
inc(K);
end else
begin
Showmessage('刪除失敗,無法連接!');
//break;
end;
WhiteList.Next;
end;
end;

Showmessage(Format('本次共刪除:%d笔!!',[k]));
PageControl1.Enabled := True;
Panel5.Visible :=False;
//
if ReadClockTime(clk.hPort, CurTime) then
Label5.Caption:=formatDateTime(LongDateFormat+' '+LongTimeFormat, CurTime);
end else
begin
//連接失敗
PageControl1.Enabled := True;
Panel5.Visible :=False;
//ClosePort(@clk, clk.CommStyle);
//exit;
break;
end;
ClosePort(@clk, clk.CommStyle);
end;
...全文
评论 6
收藏 已收藏
分享
返回顶部