VB 简单图书管理系统设计
图书管理系统源代码下载(包含源代码、数据库、设计报告)
一、基本概述
二、数据库的概念设计
系统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$,strsql$
Static count As Byte
stru = Text1.text
strp = Text2.text
If stru = "" 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 & "'; ","登录失败"
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