VB 图书管理系统
发布时间:2020-12-17 07:31:38 所属栏目:百科 来源:网络整理
导读:VB 简单图书管理系统设计 图书管理系统源代码下载 (包含源代码、数据库、设计报告) 一、基本概述 基于VB,mysql数据库 拥有可操作界面 实现基本图书管理功能 二、数据库的概念设计 图书信息 图书信息:{书号,书名,作者,分类号,出版社,价格,摘要,入馆
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
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |