数据库系统源代码文档格式.docx

上传人:b****4 文档编号:7823831 上传时间:2023-05-09 格式:DOCX 页数:14 大小:16.01KB
下载 相关 举报
数据库系统源代码文档格式.docx_第1页
第1页 / 共14页
数据库系统源代码文档格式.docx_第2页
第2页 / 共14页
数据库系统源代码文档格式.docx_第3页
第3页 / 共14页
数据库系统源代码文档格式.docx_第4页
第4页 / 共14页
数据库系统源代码文档格式.docx_第5页
第5页 / 共14页
数据库系统源代码文档格式.docx_第6页
第6页 / 共14页
数据库系统源代码文档格式.docx_第7页
第7页 / 共14页
数据库系统源代码文档格式.docx_第8页
第8页 / 共14页
数据库系统源代码文档格式.docx_第9页
第9页 / 共14页
数据库系统源代码文档格式.docx_第10页
第10页 / 共14页
数据库系统源代码文档格式.docx_第11页
第11页 / 共14页
数据库系统源代码文档格式.docx_第12页
第12页 / 共14页
数据库系统源代码文档格式.docx_第13页
第13页 / 共14页
数据库系统源代码文档格式.docx_第14页
第14页 / 共14页
亲,该文档总共14页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

数据库系统源代码文档格式.docx

《数据库系统源代码文档格式.docx》由会员分享,可在线阅读,更多相关《数据库系统源代码文档格式.docx(14页珍藏版)》请在冰点文库上搜索。

数据库系统源代码文档格式.docx

Button1:

TButton;

GroupBox1:

TGroupBox;

RadioButton1:

TRadioButton;

RadioButton2:

procedureButton1Click(Sender:

TObject);

private

{Privatedeclarations}

public

var

username,password:

string;

{Publicdeclarations}

end;

var

Form1:

TForm1;

implementation

usesunit2,unit3;

{$R*.dfm}

procedureTForm1.Button1Click(Sender:

begin

ifradiobutton2.checkedthen//如果radiobutton2被选中,就执行。

try

withadoquery1do//这里就开始对adoquery进行编辑了

begin

close;

sql.clear;

sql.add('

select*frommasterwhere管理员=:

管理员and密码=:

密码'

);

//搜索master表中所有的用户名,密码

parameters.ParamByName('

管理员'

).Value:

=trim(combobox1.Text);

//比对用户名

密码'

=trim(edit2.Text);

//比对密码

ifcombobox1.Text='

'

then

application.MessageBox('

请输入用户名'

'

提示信息'

64);

//用户名为空时弹出提示

combobox1.SetFocus;

exit;

ifComboBox1.Text='

请输入密码'

//假如密码为空时弹出提示edit2.SetFocus;

open;

ifadoquery1.RecordCount<

>

0then

Username:

=combobox1.Text;

Password:

=edit2.Text;

登陆成功'

form2.show;

//弹出form2窗口,也就是我们上节课设计好的管理员窗口

self.Hide;

end

else

输入的用户名或密码错误'

except

登陆失败'

else//对应第一个if,意思就是如果radiobutton2没被选中,也就是radiobutton1被选中

try

withadoquery1do

select*fromptwherea=:

aandb=:

b'

a'

ifedit2.Text='

edit2.SetFocus;

form3.show;

self.Hide;

elsebegin

finally

 

end.

2.管理员窗口

unitUnit2;

Dialogs,ExtCtrls,DBCtrls,Grids,DBGrids,DB,ADODB,StdCtrls,Buttons,jpeg;

TForm2=class(TForm)

Edit1:

DataSource1:

TDataSource;

DBGrid1:

TDBGrid;

DBNavigator1:

TDBNavigator;

Label3:

Edit3:

Button2:

Button3:

Button4:

procedureButton2Click(Sender:

procedureButton3Click(Sender:

procedureButton4Click(Sender:

Form2:

TForm2;

usesUnit4,unit1;

procedureTForm2.Button1Click(Sender:

SqlStr:

String;

='

select*fromstudentwherename='

+edit1.Text+'

;

adoquery1.Close;

//关闭ADOQuery1,以便于进行SQL语句更新

adoquery1.SQL.Clear;

//清空SQL语句

adoquery1.SQL.Add(sqlStr);

adoquery1.Open;

//新SQL有效

end;

procedureTForm2.Button2Click(Sender:

select*fromstudentwhere学号='

+edit2.Text+'

procedureTForm2.Button3Click(Sender:

select*fromstudentwhere短号='

+edit3.Text+'

procedureTForm2.Button4Click(Sender:

form1.show;

3.普通用户编辑窗口

unitUnit3;

Dialogs,StdCtrls,DBCtrls,DB,ADODB,jpeg,ExtCtrls;

TForm3=class(TForm)

Label4:

Label5:

DBText1:

TDBText;

DBText2:

DBText3:

Label6:

Label8:

GroupBox2:

Label9:

Label10:

Edit4:

Edit5:

Label7:

procedureFormShow(Sender:

Form3:

TForm3;

usesunit1,Unit4;

procedureTForm3.Button1Click(Sender:

updatestudentset学号='

短号='

name='

wherename='

+label2.caption+'

adoquery1.ExecSQL;

信息修改成功'

procedureTForm3.Button2Click(Sender:

varSqlStr:

ifedit4.Text=edit5.textthen

updateptsetb='

+edit4.Text+'

wherea='

密码修改成功'

end

输入密码不一致'

procedureTForm3.Button3Click(Sender:

form4.show;

procedureTForm3.FormShow(Sender:

label2.Caption:

=unit1.Form1.username;

adoquery1.open;

4.普通用户查询窗口

unitUnit4;

Dialogs,Grids,DBGrids,DB,ADODB,StdCtrls;

TForm4=class(TForm)

Form4:

TForm4;

procedureTForm4.Button1Click(Sender:

procedureTForm4.Button2Click(Sender:

procedureTForm4.Button3Click(Sender:

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 工程科技 > 能源化工

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2