数据库设计论文
数据库系统概论课程设计报告
设计题目
图书馆服务系统
学生姓名:
学号:_
班级:_
指导老师:______ ______
日期:___2011-6-10___________
成绩:_______________
图书馆服务系统
一、需求分析
对于每一位图书借阅用户来说,有一款方便简洁的图书馆服务系统将可以为广大用户节省很多不必要的麻烦,同时也给图书馆的内部人员的管理带来了便利,同时设计图书馆的服务系统还要根据实际的要求。基于此两点,该图书馆服务系统设计思路如下。
二、E-R图建模
根据系统需求分析的结果设计该系统的E-R图。
管理可以对图书进行增、删、改;
管理员可以对用户进行管理;
管理员可以对图书、读者借阅情况的统计;
每条书目对应一个asp文件
每条栏目对应一个文件夹
每条书目对应一个栏目
图2.1 检索功能E-R图
图2.2 管理员信息实体E-R图
图2.3 单本图书实体E-R图
图2.4 图书栏目E-R图
图2.5 会员信息实体E-R图
三、库文件结构设计
a)概念模型设计
1)读者信息
2)书籍信息
3)管理员信息
4)栏目信息
5)读者与书籍之间的关系(借阅读关系E-R图)
6)管理员与书籍之间的关系(管理员_书籍E-R图)
7)管理员与学生之间的关系(管理员_学生E-R图)
b)逻辑设计——从理论“E/R模型”到理论“关系模型”的整理转换,通过
E/R模型到关系模型的转化,可以得到如下关系模式:
借阅关系
属性:工作号,读者学号,ISBN,是否续借,借书日期,还书日期,备注主键:工作号,读者学号,ISBN,管理员_书籍关系
属性:工作号,ISBN,添加时间,是否在馆
主键:工作号
b)数据库表的设计
表4.1 图书栏目表
表4.2图书内容表
表4.3 管理员信息表
表4.4会员信息表
四、用户接口设计及主要功能实现
1)主页面端口:default.asp
="crimson">
WUST图书馆服务系统
[会员登录] | [管理员登录] | [检索图书] | [帮助信息] | [请你留言] |
2)会员登录模块:login.htm和login.asp
图书馆服务——会员登陆
图书馆欢迎您
南四205 版权所有
<% @language=vbscript%>
<%response.buffer=true%>
<% set conn=server.createobject("adodb.connection")
conn.open "DRIVER={Microsoft SQL Driver
(*.mdb)};DBQ="&Server.MapPath("BBS.MDB")%>
<% set rstemp=server.createobject("addb.recordset")
dim strname,strpassword,sql
strname=request.form("Name")
strpassword=request.form("password")
sql="select * from user where username='"& strname & "'"
rstemp.open sql,conn,1,3
if strname=" " then
response.write"账号不能为空
"%>
<% response.end
end if
if strpassword=" " then
response.write"密码不能为空
"%>
<% response.end
end if
if rstemp.RecordCount=1 then
if rstemp("userpassword")=strpassword then
session ("name")=strname
response.redirect "user.htm"
else
%>
<% response.end
end if
rstemp.close
set rstemp=nothing
%>
3)会员密码修改端口:changepassword.htm和changepassword.asp
<% if session("name")=" " then
response.write "请你首先登录,才能留言"
response.end
%>
<% dim stroldpassword,strnewpassword,strconfirmpassword
dim strwhere,strsql,strdsn,strchangesql
stroldpassword=request.form("oldpassword")
strnewpassword=request.form("newpassword")
strconfirmpassword=request.form("confirmpassword")
if stroldpassword=" " or strnewpassword=" " then
response.write" 请输入密码"
response.end
end if
if strnewpassword<>strconfirmpassword then
response.write"两次密码不相同"
response.end
end if
strwhere="where username='" & session("name") & "' and userpassword= '" & stroldpassword & "'"
strsql="select * from user "& strwhere
strchangesql="update user set userpassword='" & strnewpassword & "'"
& strwhere
set rs=server.createobject("adodb.recordset")
rs.open strsql,conn,1,3
%>
if rs.recordcount=1 then
set changers=server.createobject("adodb.recordset")
changers.open strchangesql,conn,1,3
set changers=nothing
response.write "密码已成功修改"
else response.write "密码输入错误,无法修改密码"
else if
rs.close
set rs=nothing
%>
图书馆欢迎您
南四205 版权所有