华北科技学院_Delphi实验报告_简易学生信息管理系统
华北科技学院计算机学院综合性实验报告
begin if adoquery1.FieldByName('userright').AsInteger=0 then begin FrmStudent.BtnAdd.Enabled:=false; FrmStudent.BtnModify.Enabled:=false; FrmStudent.BtnDelete.Enabled:=false; end; FrmStudent.Show; FrmLogin.hide; end; end; end; 2) 、登录界面的 AdoQuery 控件的 connectionstring 的代码为: Provider=MSDASQL.1;Persist Security Info=False;Data Source=student 3) 、信息管理界面查询记录按钮 btnQuery 的 onClick 事件过程代码为: procedure TFrmStudent.btnQueryClick(Sender: TObject); begin if EdtContent.Text = '' then begin MessageB
ox(0,'查询内容为空!','错误',0); EdtContent.SetFocus; end else if trim(EdtContent.Text)<>'' then begin case GrpCondition.ItemIndex of 0: begin StrSql:='select * from info where Snum='''+trim(EdtContent.text)+''''; if QryStu.Active then begin QryStu.Active:=false; QryStu.SQL.Clear; QryStu.SQL.Add(StrSql); QryStu.Active:=true; if QryStu.Bof and QryStu.Eof then begin MessageDlg('查无此人!,请重新输入学号',mtError,[mbOK],1); EdtContent.Text:=''; EdtContent.SetFocus; end; end; end; 1: begin StrSql:='select * from info where Sname='''+trim(EdtContent.text)+''''; if QryStu.Active then begin QryStu.Active:=false; QryStu.SQL.Clear; QryStu.SQL.Add(StrSql); QryStu.Active:=true; if QryStu.Bof and QryStu.Eof then begin MessageDlg('查无此人!,请重新输入姓名',mtError,[mbOK],1); EdtContent.Text:=''; EdtContent.SetFocus; end;第 4 页