VB 简单图书管理系统设计

图书管理系统源代码下载(包含源代码、数据库、设计报告)

一、基本概述

  1. 基于VB,mysql数据库
  2. 拥有可操作界面
  3. 实现基本图书管理功能

二、数据库的概念设计

  1. 图书信息

图书信息:{书号,书名,作者,分类号,出版社,价格,摘要,入馆日期,是否在架}

  1. 读者用户信息

读者用户信息:{读者号(用户ID),密码,姓名,性别,单位,类型,身份证号,罚款金额,办理日期,住址,电话,邮箱}

  1. 管理员信息

管理员信息:{账号,密码,姓名,性别是否删除}

  1. 借阅信息

借阅信息:{借阅编号,读者号(用户ID),书号,借书时间,还书时间,是否已归还}

系统E-R图
系统E-R图

三.部分运行截图

登陆

'登陆页代码
Private Sub Command1_Click()

Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim stru$, strp$, strsql$
Static count As Byte
stru = Text1.text
strp = Text2.text
username = Text1.text

If stru = "" Then
MsgBox "用户名不能为空,请输入用户名!", , "登陆错误"
Text1.SetFocus
Exit Sub
ElseIf strp = "" Then
MsgBox "密码不能为空,请输入密码!", , "登陆错误"
Text2.SetFocus
Exit Sub
End If
Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset

conn.Open "provider=SQLOLEDB.1;datasource=(local);persist security info=false;integrated security=sspi;database=bms"


rs.Open "select * from ruser where ruser='" & stru & " 'and rpsw='" & strp & "'; ", conn

If rs.EOF Then
count = count + 1
MsgBox "用户名不存在或者密码错误!", , "登录失败"
Text1.text = ""
Text2.text = ""
Text1.SetFocus
Else
logins = True
username = rs("ruser").Value
pass = rs("rpsw").Value
F_index.Show
Me.Hide
End If
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
If count >= 3 Then
MsgBox "超过登录次数,无权登录本系统!", , "登录失败"
End
End If
End Sub


Private Sub Command2_Click()

Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim stru$, strp$, strsql$
Static count As Byte
stru = Text1.text
strp = Text2.text
If stru = "" Then
MsgBox "用户名不能为空,请输入用户名!", , "登陆错误"
Text1.SetFocus
Exit Sub
ElseIf strp = "" Then
MsgBox "密码不能为空,请输入密码!", , "登陆错误"
Text2.SetFocus
Exit Sub
End If
Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset

conn.Open "provider=SQLOLEDB.1;datasource=(local);persist security info=false;integrated security=sspi;database=bms"


rs.Open "select * from auser where auser='" & stru & " 'and apsw='" & strp & "'; ", conn

If rs.EOF Then
count = count + 1
MsgBox "用户名不存在或者密码错误!", , "登录失败"
Text1.text = ""
Text2.text = ""
Text1.SetFocus
Else
logins = True
username = rs("auser").Value
pass = rs("apsw").Value
F_a_index.Show
Me.Hide
End If
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
If count >= 3 Then
MsgBox "超过登录次数,无权登录本系统!", , "登录失败"
End
End If
End Sub

Private Sub Command3_Click()
Text1.text = ""
Text2.text = ""
Text1.SetFocus
End Sub

图书汇总

图书查询

图书查询

Logo

快速构建 Web 应用程序

更多推荐