发的一些模糊的认识,而且提高了软件开发的水平,培养了严谨的工作作风,为今后在工作岗位上用好管好计算机打下了坚实的基础。 在做系统的过程中,我遇到的最大的困难是调程序方面的。在运行程序的过程中经常会出现程序自行中断,需要进行调试的信息。这些信息使得我不得不反复看书,琢磨程序。在一遍一遍的调试之下,程序终于被调通了。那时,我终于可以上上的舒一口气了。 我的系统规模比较小同时由于我的时间和能力等多方面的因素影响,我们的系统也存在一定的缺陷。比如系统的界面不够美观,有的功能不够完善等。对此还请老师给与批评指教,使我能过了解到我系统中所存在的缺陷与不足。 最后,很感谢老师对我的指导和帮助。
图书管理系统ER图-流程图-功能结构图-源代码 源程序清单
1、文件名 login(login.frm)
功能说明:整个系统的登陆界面,需要输入用户名和登陆密码才能进入到系统中,进行借阅等操作。 源代码:
Option Explicit Dim cnt As Integer
Private Sub Command1_Click() Dim sql As String
Dim rs_login As New ADODB.Recordset If Trim(Combo1.Text) = \
MsgBox \没有这个用户\ Combo1.SetFocus Else
sql = \系统管理 where 用户名='\ rs_login.Open sql, conn, adOpenKeyset, adLockPessimistic If rs_login.EOF = True Then
MsgBox \没有这个用户\ Combo1.SetFocus Else
If Trim(rs_login.Fields(1)) = Trim(txtpwd.Text) Then userID = Combo1.Text rs_login.Close Unload Me form1.Show Else
MsgBox \密码不正确\ txtpwd.SetFocus End If End If End If
cnt = cnt + 1 If cnt = 3 Then Unload Me
End If Exit Sub End Sub
Private Sub Command2_Click() Unload Me End Sub
Private Sub Form_Load()
Dim connectionstring As String
connectionstring = \ \ conn.Open connectionstring cnt = 0 End Sub
Private Sub txtuser_Change() End Sub
2、文件名 form1(form1.frm)
功能说明:整个系统的主界面,其中包括图书管理、读者管理、图书借阅管理、系统管理、关于,以及在这下面的子菜单。 源代码:
Private Sub add_admin_Click() frmadduser.Show End Sub
Private Sub add_back_book_Click() frmbackbookinfo.Show End Sub
Private Sub add_book_info_Click() frmaddbookinfo.Show End Sub
Private Sub add_book_style_Click() frmaddbookstyle.Show End Sub
Private Sub add_lend_book_Click() frmfindbook.Show End Sub
Private Sub add_reader_info_Click() frmaddreaderinfo.Show End Sub
Private Sub add_reader_style_Click() frmaddreaderstyle.Show End Sub
Private Sub change_pwd_Click() frmchangepwd.Show End Sub
Private Sub del_book_info_Click()
frmmodifybookinfo.Show End Sub
Private Sub del_book_style_Click() frmmodifybookstyle.Show End Sub
Private Sub del_reader_info_Click() frmreaderinfo.Show End Sub
Private Sub del_reader_style_Click() frmmodifyreaderstyle.Show End Sub
Private Sub exit_sys_Click() End End Sub
Private Sub find_book_info_Click() frmfindbook.Show End Sub
Private Sub find_lend_book_Click() frmfindborrowinfo.Show End Sub
Private Sub find_reader_info_Click() frmfindreader.Show End Sub
Private Sub Form_Load() End Sub
Private Sub gly_Click() Form2.Show End Sub
frmmodifybookstyle.Show End Sub
Private Sub modify_reader_info_Click() frmreaderinfo.Show End Sub
Private Sub modify_reader_style_Click()
图书管理系统VB+Access frmmodifyreaderstyle.Show End Sub
3、文件名 frmaddbookstyle(frmbookstyle.frm) 功能说明:用于添加图书类别信息。 源代码:
Option Explicit
Private Sub Command1_Click()
Dim rs_bookstyle As New ADODB.Recordset Dim sql As String
If Trim(Text1.Text) = \
MsgBox \图书种类不能为空\ Text1.SetFocus Exit Sub End If
If Trim(Text2.Text) = \
MsgBox \种类编号不能为空\ Text2.SetFocus Exit Sub End If
sql = \图书类别 where 类别名称='\ rs_bookstyle.Open sql, conn, adOpenKeyset, adLockPessimistic If rs_bookstyle.EOF Then rs_bookstyle.AddNew
rs_bookstyle.Fields(0) = Trim(Text1.Text) rs_bookstyle.Fields(1) = Trim(Text2.Text) rs_bookstyle.Update
MsgBox \添加图书类别成功!\ rs_bookstyle.Close Else
MsgBox \读者类别重复!\ Text1.SetFocus Text1.Text = \ rs_bookstyle.Close Exit Sub End If End Sub
Private Sub Command2_Click() Unload Me End Sub
4、文件名 frmmodifybookstyle(code)
功能说明:图书类别管理,可以修改和删除图书类别。 源代码:
Option Explicit
Dim rs_reader As New ADODB.Recordset Private Sub cmdcancel_Click() rs_reader.CancelUpdate DataGrid1.Refresh
DataGrid1.AllowAddNew = False DataGrid1.AllowUpdate = False cmdmodify.Enabled = True
cmddel.Enabled = True cmdcancel.Enabled = False cmdupdate.Enabled = False End Sub
Private Sub cmddel_Click() Dim answer As String On Error GoTo delerror
answer = MsgBox(\确定要删除吗?\ If answer = vbYes Then
DataGrid1.AllowDelete = True rs_reader.Delete rs_reader.Update DataGrid1.Refresh
MsgBox \成功删除!\ DataGrid1.AllowDelete = False Else
Exit Sub End If delerror:
If Err.Number <> 0 Then MsgBox Err.Description End If End Sub
Private Sub cmdmodify_Click() Dim answer As String
On Error GoTo cmdmodify cmddel.Enabled = False cmdmodify.Enabled = False cmdupdate.Enabled = True cmdcancel.Enabled = True
DataGrid1.AllowUpdate = True cmdmodify:
If Err.Number <> 0 Then MsgBox Err.Description End If End Sub
Private Sub Command5_Click() rs_reader.Update DataGrid1.Refresh End Sub
Private Sub cmdupdate_Click()
If Not IsNull(DataGrid1.Bookmark) Then rs_reader.Update End If