欢迎来到天天文库
浏览记录
ID:35514519
大小:41.50 KB
页数:4页
时间:2019-03-25
《delphi图书管理系统代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、(登录代码)procedureTForm1.Button1Click(Sender:TObject);beginadoquery1.Close;adoquery1.SQL.Clear;adoquery1.SQL.Add('select*frombiao1whereuser='''+e_yhm.Text+'''andpasswords='''+e_mm.Text+'''');adoquery1.Open;ifadoquery1.RecordCount=1thenbeginform1.Hide;form2.Show;endelsebeginshowmessage('用户名或密码错误');en
2、d;end;(注册代码)procedureTForm3.Button1Click(Sender:TObject);beginadotable2.Insert;adotable2.fieldbyname('user').asstring:=e_ZCHU.text;adotable2.fieldbyname('passwords').asstring:=e_zcmm.text;adotable2.Post;end;procedureTForm3.FormCreate(Sender:TObject);beginadotable2.Active:=true;end;(添加代码)procedure
3、TForm5.Button1Click(Sender:TObject);beginadotable1.Insert;adotable1.fieldbyname('读者姓名').asstring:=edit1.text;adotable1.fieldbyname('读者编号').asstring:=edit2.text;adotable1.fieldbyname('性别').asstring:=edit3.text;adotable1.fieldbyname('年龄').asstring:=edit4.text;adotable1.fieldbyname('借阅图书').asstring:
4、=edit5.text;adotable1.fieldbyname('书号').asstring:=edit6.text;adotable1.fieldbyname('借阅时间').asstring:=edit7.text;adotable1.fieldbyname('应还时间').asstring:=edit8.text;edit1.Text:='';edit2.Text:='';edit3.Text:='';edit4.Text:='';edit5.Text:='';edit6.Text:='';edit7.Text:='';edit8.Text:='';adotable1.Post
5、;end;procedureTForm5.FormCreate(Sender:TObject);beginadotable1.Active:=true;end;(查询代码)procedureTForm6.Button1Click(Sender:TObject);beginifedit1.text<>''thenifADOTable1.Locate('读者编号',edit1.text,[loPartialKey])thenbeginedit2.Text:=ADOTable1.FieldValues['读者姓名'];edit3.Text:=ADOTable1.FieldValues['读者编
6、号'];edit4.Text:=ADOTable1.FieldValues['性别'];edit5.Text:=ADOTable1.FieldValues['年龄'];edit6.Text:=ADOTable1.FieldValues['借阅图书'];edit7.Text:=ADOTable1.FieldValues['书号'];edit8.Text:=ADOTable1.FieldValues['借阅时间'];edit9.Text:=ADOTable1.FieldValues['应还时间']end;end;procedureTForm6.Button2Click(Sender:TObj
7、ect);beginADOTable1.Edit;//将数据集设为编辑状态ADOTable1.FieldValues['读者姓名']:=Edit2.Text;//将Edit2中的内容赋给字段ADOTable1.FieldValues['读者编号']:=Edit3.Text;//将Edit3中的内容赋给字段ADOTable1.FieldValues['性别']:=Edit4.Text;ADOTable1.FieldValues['年龄
此文档下载收益归作者所有