📄 用户登录窗.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form 用户登录窗
BorderStyle = 3 'Fixed Dialog
Caption = "用户登录窗"
ClientHeight = 2115
ClientLeft = 45
ClientTop = 435
ClientWidth = 5310
Icon = "用户登录窗.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2115
ScaleWidth = 5310
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 2055
Left = 60
TabIndex = 0
Top = 0
Width = 5175
Begin MSAdodcLib.Adodc Adodc1
Height = 435
Left = 3720
Top = 180
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 767
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=学生教材管理系统.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=学生教材管理系统.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 用户管理"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataListLib.DataCombo DataCombo1
Bindings = "用户登录窗.frx":030A
DataField = "user"
DataSource = "Adodc1"
Height = 450
Left = 1080
TabIndex = 1
Top = 180
Width = 2235
_ExtentX = 3942
_ExtentY = 794
_Version = 393216
Style = 2
ListField = "user"
Text = ""
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1080
PasswordChar = "*"
TabIndex = 3
Top = 1500
Width = 2235
End
Begin VB.CommandButton Command1
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 3840
TabIndex = 4
Top = 900
Width = 1155
End
Begin VB.CommandButton Command2
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 3840
TabIndex = 5
Top = 1440
Width = 1155
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
ItemData = "用户登录窗.frx":031F
Left = 1080
List = "用户登录窗.frx":0329
Style = 2 'Dropdown List
TabIndex = 2
Top = 840
Width = 2235
End
Begin VB.Label Label1
Caption = "姓名:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 8
Top = 240
Width = 855
End
Begin VB.Label Label2
Caption = "权限:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 7
Top = 840
Width = 795
End
Begin VB.Label Label3
Caption = "密码:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 360
TabIndex = 6
Top = 1440
Width = 795
End
End
End
Attribute VB_Name = "用户登录窗"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public mi As Integer
Private Sub Command1_Click()
Adodc1.RecordSource = "select * from 用户管理 where user='" & Trim(DataCombo1.Text) & "'"
Adodc1.Refresh
Dim cn$
If Trim(DataCombo1.Text) = "" Then
MsgBox "用户名不能为空!", , "错误"
DataCombo1.SetFocus
Exit Sub
End If
If Adodc1.Recordset.EOF Then
MsgBox "用户不存在!", , "错误"
DataCombo1.Text = ""
Text3.Text = ""
Adodc1.RecordSource = "select * from 用户管理"
Adodc1.Refresh
DataCombo1.Refresh
DataCombo1.SetFocus
Else
cn = Trim(DataCombo1.Text)
If Adodc1.Recordset.Fields("qx") <> RTrim(Combo1.Text) Then
MsgBox "权限错误", , "错误"
Combo1.SetFocus
Adodc1.RecordSource = "select * from 用户管理"
Adodc1.Refresh
DataCombo1.Refresh
DataCombo1.Text = cn
Else
If Trim(Text3.Text) <> Trim(Adodc1.Recordset.Fields("password")) Then
If mi = 2 Then
MsgBox "密码输入错误三次" + Chr(13) + Chr(10) + "自动关闭本系统", , "学生教材管理软件"
Unload Me
Else
MsgBox "密码错误!", , "错误"
mi = mi + 1
Adodc1.RecordSource = "select * from 用户管理"
Adodc1.Refresh
DataCombo1.Text = cn
Text3.Text = ""
Text3.SetFocus
End If
Else
If Trim(Combo1.Text) = "管理员" Then
Unload Me
主窗体.Show
Else
Unload Me
主窗体.Show
With 主窗体
.mnuyhgl.Enabled = False
.mnuxtwh.Enabled = False
.mnuxtchsh.Enabled = False
.mnushjbf.Enabled = False
.mnusjhf.Enabled = False
End With
End If
End If
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Activate()
mi = 0
End Sub
'Private Sub Form_Load()
'mi = 0
'End Sub
Private Sub Form_Load()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -