欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOCX文档下载  

    图书查询系统代码.docx

    • 资源ID:3377647       资源大小:43.44KB        全文页数:37页
    • 资源格式: DOCX        下载积分:6.99金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要6.99金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    图书查询系统代码.docx

    图书查询系统代码1、主窗体代码 unit MainU; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ToolWin, ComCtrls,jpeg, Menus,DB, ADODB, ExtCtrls; type TMainF = class(TForm) MainMenu1: TMainMenu; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; N4: TMenuItem; N5: TMenuItem; N6: TMenuItem; N7: TMenuItem; N8: TMenuItem; N9: TMenuItem; N10: TMenuItem; N11: TMenuItem; N12: TMenuItem; N13: TMenuItem; N14: TMenuItem; ToolBar1: TToolBar; BookQueryBitBtn1: TBitBtn; BitBtn2: TBitBtn; BitBtn3: TBitBtn; BitBtn4: TBitBtn; BitBtn5: TBitBtn; Image1: TImage; ADOConnection1: TADOConnection; ADOTable1: TADOTable; N15: TMenuItem; N16: TMenuItem; N17: TMenuItem; N18: TMenuItem; ToolBar2: TToolBar; BitBtn1: TBitBtn; BitBtn6: TBitBtn; BitBtn7: TBitBtn; procedure FormCreate(Sender: TObject); procedure N13Click(Sender: TObject); procedure N3Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure BitBtn2Click(Sender: TObject); procedure BookQueryBitBtn1Click(Sender: TObject); procedure N2Click(Sender: TObject); procedure N4Click(Sender: TObject); procedure N5Click(Sender: TObject); procedure N10Click(Sender: TObject); procedure N11Click(Sender: TObject); procedure N6Click(Sender: TObject); procedure BitBtn3Click(Sender: TObject); procedure BitBtn4Click(Sender: TObject); procedure BitBtn5Click(Sender: TObject); procedure N7Click(Sender: TObject); procedure N16Click(Sender: TObject); procedure N17Click(Sender: TObject); procedure N18Click(Sender: TObject); procedure BitBtn1Click(Sender: TObject); procedure BitBtn6Click(Sender: TObject); procedure BitBtn7Click(Sender: TObject); procedure Formclose(Sender: TObject); private Private declarations public Logined:Boolean; Public declarations end; var MainF: TMainF; MyPath:String; const MyPassW='1111' implementation uses ReaderQuery,BookQuery,kucun,HelpForm,JieHuanQuery,About,QD,UserQueryForm; $R *.dfm procedure TMainF.FormCreate(Sender: TObject); begin dengluU, MyPath:=ExtractFilePath(ParamStr(0); ShortDateFormat:='yyyy/mm/dd' MainF.ToolBar1.Visible:=false; MainF.ToolBar2.Visible:=false; MainF.N15.Enabled:=false; end; procedure TMainF.N13Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; denglu:=tdenglu.Create(application); denglu.Show; end; procedure TMainF.N3Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; ReaderQueryForm:=TReaderQueryForm.Create(application); ReaderQueryForm.Show; end; procedure TMainF.N14Click(Sender: TObject); begin if messagedlg('真的要退出系统吗?',mtconfirmation,mbYes,mbNo,0)=mryes then close; adotable1.Open; adotable1.last; adotable1.edit; adotable1.FieldByName('downtime').AsDateTime:=now; adotable1.Post; adotable1.Close; end; /单击该按钮,显示对应窗体 procedure TMainF.Formclose(Sender: TObject); /关闭主窗体 begin adotable1.Open; adotable1.last; adotable1.edit; adotable1.FieldByName('downtime').AsDateTime:=now; adotable1.Post; adotable1.Close; 才 end; procedure TMainF.BitBtn2Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; ReaderQueryForm:=TReaderQueryForm.Create(application); ReaderQueryForm.Show; end; procedure TMainF.BookQueryBitBtn1Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; BookQueryForm:=TBookQueryForm.Create(application); BookQueryForm.Show; end; procedure TMainF.N2Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; BookQueryForm:=TBookQueryForm.Create(application); BookQueryForm.Show; end; procedure TMainF.N4Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; UserQuery:=TUserQuery.Create(application); UserQuery.Show; end; procedure TMainF.N5Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; kucunQuery:=TKucunQuery.Create(application); KucunQuery.Show; end; procedure TMainF.N10Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; AboutForm:=TAboutForm.Create(application); AboutForm.Show; end; procedure TMainF.N11Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; help:=Thelp.Create(application); help.Show; end; procedure TMainF.N6Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; JHQuery:=TJHQuery.Create(application); JHQuery.Show; end; procedure TMainF.BitBtn3Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; UserQuery:=TUserQuery.Create(application); UserQuery.Show; end; procedure TMainF.BitBtn4Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; kucunQuery:=TKucunQuery.Create(application); KucunQuery.Show; end; procedure TMainF.BitBtn5Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; JHQuery:=TJHQuery.Create(application); JHQuery.Show; end; procedure TMainF.N7Click(Sender: TObject); begin if messagedlg('真的要退出查询系统吗?',mtconfirmation,mbYes,mbNo,0)=mryes then Close; mainf.ADOTable1.Open; mainf.ADOTable1.last; mainf.ADOTable1.edit; mainf.ADOTable1.FieldByName('downtime').AsDateTime:=now; mainf.ADOTable1.Post; mainf.ADOTable1.Close; end; /对用户表进行操作,将用户退出系统的时间加入表中 procedure TMainF.N16Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; BookQueryForm:=TBookQueryForm.Create(application); BookQueryForm.Show; end; procedure TMainF.N17Click(Sender: TObject); begin application.Initialize; ReaderQueryForm:=TReaderQueryForm.Create(application); /单击该按钮,显示对应窗体 ReaderQueryForm.Show; end; procedure TMainF.N18Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; JHQuery:=TJHQuery.Create(application); JHQuery.Show; end; procedure TMainF.BitBtn1Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; BookQueryForm:=TBookQueryForm.Create(application); BookQueryForm.Show; end; procedure TMainF.BitBtn6Click(Sender: TObject); begin application.Initialize; kucunQuery:=TKucunQuery.Create(application); KucunQuery.Show; end; procedure TMainF.BitBtn7Click(Sender: TObject); /单击该按钮,显示对应窗体 begin application.Initialize; JHQuery:=TJHQuery.Create(application); JHQuery.Show; end; end. 2、图书查询代码 unit BookQuery; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, Buttons; type TBookQueryForm = class(TForm) PageControl1: TPageControl; TabSheet1: TTabSheet; GroupBox1: TGroupBox; RadioButton1: TRadioButton; RadioButton2: TRadioButton; RadioButton3: TRadioButton; RadioButton4: TRadioButton; RadioButton5: TRadioButton; GroupBox2: TGroupBox; Label1: TLabel; Edit1: TEdit; CheckBox1: TCheckBox; BitBtn1: TBitBtn; GroupBox3: TGroupBox; ListView1: TListView; BitBtn2: TBitBtn; StaticText1: TStaticText; procedure BitBtn1Click(Sender: TObject); procedure RadioButton1Click(Sender: TObject); procedure RadioButton2Click(Sender: TObject); procedure RadioButton3Click(Sender: TObject); procedure RadioButton4Click(Sender: TObject); procedure RadioButton5Click(Sender: TObject); procedure Edit1KeyPress(Sender: TObject; var Key: Char); procedure Edit1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure BitBtn2Click(Sender: TObject); private Private declarations public Public declarations end; var BookQueryForm: TBookQueryForm; implementation uses datamodule; $R *.dfm procedure TBookQueryForm.BitBtn1Click(Sender: TObject); var Content : string; begin try ListView1.Items.Clear; with DataModuleADO.ADOQuery1 do begin if ( not RadioButton1.Checked) and (not RadioButton2.Checked) and( not RadioButton3.Checked) and (not RadioButton4.Checked ) and( not RadioButton5.Checked ) or (not checkbox1.Checked) or (edit1.Text ='') and (not checkbox1.Checked) then begin showMessage('查询条件未选择!或者查询内容为空'); edit1.SetFocus; edit1.SelectAll; exit; end; Content:=Edit1.Text; if CheckBox1.Checked then Content := '%'+Content +'%' close; SQL.Clear; if RadioButton1.Checked then begin SQL.Add('select * from book where bookcode like :bookcode'); Parameters.ParamByName('bookcode').value := Content; end; if RadioButton2.Checked then begin SQL.Add('select * from book where bookname like :bookname'); Parameters.ParamByName('bookname').value := Content; end; if RadioButton3.Checked then begin SQL.Add('select * from book where author like :author'); Parameters.ParamByName('author').value := Content; end; if RadioButton4.Checked then begin SQL.Add('select * from book where bookman like :bookman'); Parameters.ParamByName('bookman').value := Content; end; if RadioButton5.Checked then begin SQL.Add('select * from book where bookkind like :bookkind'); Parameters.ParamByName('bookkind').value := Content; end; Open; while not Eof do begin with ListView1.Items.Add do begin Caption := FieldByName('bookcode').AsString; SubItems.Add(FieldByName('bookname').AsString); SubItems.Add(FieldByName('author').AsString); SubItems.Add(FieldByName('bookman').AsString); SubItems.Add(FieldByName('bookkind').AsString); SubItems.Add(FieldByName('bookprice').AsString); SubItems.Add(FieldByName('bookproduceday').AsString); SubItems.Add(FieldByName('booklast').AsString); end; Next; end; StaticText1.Caption:= '共'+IntToStr(RecordCount)+'条记录' Close; end; except MessageDlg('查询失败',mtError,mbok,0); end; end; procedure TBookQueryForm.Edit1KeyPress(Sender: TObject; var Key: Char); begin if length(edit1.text)>20 then begin messagedlg('已经超出范围!',mtwarning,mbok,0); edit1.SetFocus; exit; end ; end; procedure TBookQueryForm.RadioButton1Click(Sender: TObject); begin Edit1.Text := '' Edit1.MaxLength := 10; end; procedure TBookQueryForm.RadioButton2Click(Sender: TObject); begin Edit1.Text := '' Edit1.MaxLength := 0; end; procedure TBookQueryForm.RadioButton3Click(Sender: TObject); begin Edit1.Text := '' Edit1.MaxLength := 0; end; procedure TBookQueryForm.RadioButton4Click(Sender: TObject); begin Edit1.Text := '' Edit1.MaxLength := 0; end; procedure TBookQueryForm.RadioButton5Click(Sender: TObject); begin Edit1.Text := '' Edit1.MaxLength := 10; end; procedure TBookQueryForm.Edit1KeyDown(Sender: TObject; var Key: Word;Shift: TShiftState); begin if Key =13 then BitBtn1Click(Sender); end; procedure TBookQueryForm.BitBtn2Click(Sender: TObject); begin close; end; end. 3、读者查询代码 unit ReaderQuery; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls, Buttons,ADODB, DB, Grids, DBGrids; type TReaderQueryForm = class(TForm) PageControl1: TPageControl; TabSheet1: TTabSheet; GroupBox1: TGroupBox; RadioButton1: TRadioButton; RadioButton2: TRadioButton; RadioButton3: TRadioButton; RadioButton4: TRadioButton; GroupBox2: TGroupBox; Label1: TLabel; Edit1: TEdit; CheckBox1: TCheckBox; BitBtn1: TBitBtn; GroupBox3: TGroupBox; BitBtn2: TBitBtn; StaticText1: TStaticText; ListView1: TListView; procedure RadioButton1Click(Sender: TObject); procedure RadioButton2Click(Sender: TObject); procedure RadioButton3Click(Sender: TObject); procedure RadioButton4Click(Sender: TObject); procedure RadioButton5Click(Sender: TObject); procedure BitBtn1Click(Sender: TObject); procedure Edit1KeyPress(Sender: TObject; var Key: Char); procedure Edit1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure BitBtn2Click(Sender: TObject); private Private declarations public Public declarations end; var ReaderQueryForm: TReaderQueryForm; implementation uses datamodule; $R *.dfm procedure TReaderQueryForm.RadioButton1Click(Sender: TObject); /给文本框赋空值,并限制用户最大输入字符长度 begin Edit1.Text := '' Edit1.MaxLength := 10; end; procedure TReaderQueryForm.RadioButton2Click(Sender: TObject); /给文本框赋空值 begin Edit1.Text := '' Edit1.MaxLength := 0; end; procedure TReaderQueryForm.RadioButton3Click(Sender: TObject); begin Edit1.Text := '' Edit1.MaxLength := 0; end; procedure TReaderQueryForm.RadioButton4Click(Sender: TObject); begin Edit1.Text := '' Edit1.MaxLength := 0; end; procedure TReaderQueryForm.RadioButton5Click(Sender: TObject); begin Edit1.Text := '' /限制用户输入的最大字符长度 Edit1.MaxLength := 10; end; procedure TReaderQueryForm.Edit1KeyDown(Sender: TObject; var Key: TShiftState); begin if Key =13 then /判断用户是否输入结束 BitBtn1Click(Sender); end; procedure TReaderQueryForm.BitBtn1Click(Sender: TObject); var Content : string; begin try ListView1.Items.Clear; with DataModuleADO.ADOQuery1 do begin if ( not RadioButton1.Checked) and (not RadioButton2.Checked) /异常处理 and( not RadioButton3.Checked) and (not RadioButton4.Checked) and (not checkbox1.Checked) or (edit1.Text ='') and (not checkbox1.Checked) then begin showMessage('查询条件未选择!或者查询内容为空'); Word;Shift: exit; end; begin Content:=Edit1.Text; if CheckBox1.Checked then Content := '%'+Content +'%' Close; SQL.Clear; if RadioButton1.Checked then /查询相关的关键字 begin SQL.Add('select * from yonghu where usercode like :usercode'); Parameters.ParamByName('usercode').value := Content; end; if RadioButton2.Checked then begin SQL.Add('select * from yonghu where username like :username'); Parameters.ParamBy

    注意事项

    本文(图书查询系统代码.docx)为本站会员(小飞机)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开