熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Delphi編程 >> 正文

設計帶記憶的數據錄入窗口[2]

2022-06-13   來源: Delphi編程 
    ——此文章摘自《Delphi開發經驗技巧寶典》定價 特價 購買>>http://tracklinktechcn/?m_id=dangdang&a_id=A&l=&l_type= width= height= border= nosave>

       (*把新增數據的自動編號存到列表中 *)
       IDListAdd(FieldByName(ID)AsString);
      end;
      ADODataSetRequery();
      GBxListEnabled := False;
      BtnSaveEnabled := False;
      BtnNewEnabled := True;
      ShowMessage(數據保存成功);
    end;
    procedure TFrmSaveButtonClick(Sender: TObject);
    var
      i: Integer;
      ID Number Name JoinDate: String;
      Old TelePhone DepartMent Sex: String;
    begin
      MemoLinesClear;
      for i := to IDListCount do
      begin
        ID := IDListStrings[i];
        ADODataSetLocate(ID ID []);
        Number := ADODataSetFieldByName(Number)AsString;
        Name := ADODataSetFieldByName(Name)AsString;
        Old := ADODataSetFieldByName(Old)AsString;
        Sex := ADODataSetFieldByName(Sex)AsString;
        TelePhone := ADODataSetFieldByName(TelePhone)AsString;
        DepartMent := ADODataSetFieldByName(DepartMent)AsString;
        JoinDate := ADODataSetFieldByName(JoinDate)AsString;
        with MemoLines do
        begin
         Add(LBNameCaption + Number);
         Add(LBNameCaption + Name);
         Add(LbOldCaption + Old);
         Add(LbSexCaption + Sex);
         Add(LbPhoneCaption + TelePhone);
         Add(LbPartCaption + DepartMent);
         Add(LbDateCaption + JoinDate);
         Add();
       end;
      end;
    end;
    end

right>[http://developcsaicn/delphi/htm>]  []  


From:http://tw.wingwit.com/Article/program/Delphi/201311/24853.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.