1 / 22

自律系統

自律系統. 指導教授 ~ 張志勇 組員: 489190107 彭勇盛 489190347 陳信通 489190388 吳建賦. 登入畫面. 系統選單. 學生資料管理. 新增資料. 搜尋資料. 修改資料. 刪除資料. 程式使用元件. 程式碼. Table1->Append(); // 在資料表中加入一筆空白資料 Table1->FieldByName("Stud_ID")->AsInteger = Edit1-Text.ToInt();

Download Presentation

自律系統

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 自律系統 指導教授 ~ 張志勇 組員: 489190107 彭勇盛 489190347 陳信通 489190388 吳建賦

  2. 登入畫面

  3. 系統選單

  4. 學生資料管理

  5. 新增資料

  6. 搜尋資料

  7. 修改資料

  8. 刪除資料

  9. 程式使用元件

  10. 程式碼 Table1->Append(); //在資料表中加入一筆空白資料 Table1->FieldByName("Stud_ID")->AsInteger = Edit1-Text.ToInt(); Table1->FieldByName("Name")->AsString = Edit2->Text; Table1->FieldByName("Sex")->AsString = Edit3->Text; Table1->FieldByName("Phone")->AsString = Edit4->Text; Table1->FieldByName("E_mail")->AsString = Edit5->Text; Table1->FieldByName("Address")->AsString = Edit6->Text; //以上程式是根據資料表所建立的欄位,將輸入資料寫入資料表中 Table1->Post(); //將修改過的資料表寫入資料庫

  11. 程式碼 result = Table1->Lookup("Member_ID",userID->Text,"Password"); //搜尋資料表中的資料,如有資料將其欄位資料傳回 //第一個欄位是要搜尋Table中的欄位名 //第二個欄位是要搜尋的資料 //第三個欄位是想要回傳的欄位名 If(dynamic_cast<EDBEngineError*>(E)->Errors[0]->ErrorCode == 9729) //當資料寫入錯誤時,用來取得BDE傳回的例外錯誤碼 //9729就是唯一鍵值欄位資料重複回傳的值 以下程式是用來控制存取某資料表的某筆資料 1. Table1->Delete(); //刪除資料表中一筆資料

  12. 程式碼 以下程式是用來控制存取某資料表的某筆資料 2. Table1->Cancel(); //取消在真正寫入前的任何更動 3. Table1->Prior(); //指向上一筆資料 4. Table1->Next(); //指向下一筆資料 5. Table1->Last(); //指向最後一筆資料 6. Table1->First(); //指向第一筆資料 Table1->Locate("Stud_ID", Edit1->Text, LocateOptions()<<loPartialKey); //這是搜尋資料的程式碼,如有找到會回傳true的值 //第一個欄位是要搜尋Table中的欄位名 //第二個欄位是要搜尋的資料 //第三個欄位是要搜尋的方式

  13. 行事曆

  14. 新增記錄

  15. 插入資料後

  16. 刪除資料

  17. 完成刪除

  18. 程式使用元件 有 * 的元件是由網路上下載 網址:http://www.tmssoftware.com/

  19. 程式碼 FormatDateTime(“AM/PM hh:nn:ss”,Now()) //抓取現在時間日期 以下程式用來建立行事曆的 item TPlannerItem *plIt; plIt = Form8->DBPlanner1->CreateItem(); //建立新 item plIt->ItemBegin = From; //記錄 item位置 plIt->ItemEnd = To; plIt->ItemPos = Pos; plIt->Text->Text = Memo1->Text; // 紀錄 item的內容 plIt->ImageID = ListView1->ItemIndex; // 紀錄 item的圖示

  20. 程式碼 另一種過濾資料的方法,可得到多筆資料 Table2->Close(); Table2->Filtered = true; Table2->Open(); void __fastcall TForm8::Table2FilterRecord(TDataSet *DataSet, bool &Accept) { AnsiString temp1,temp2; temp1 = Table2->FieldByName("Subject")->AsString; temp2 = FormatDateTime("yyyymmdd",MonthCalendar1->Date); if(CompareStr(temp2,temp1) == 0) { Accept = true; } else { Accept = false; } }

  21. 未完成的功能

  22. 謝謝大家 THE END

More Related