📄 forload.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form ForLoad
Caption = "用户登录入口"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 11010
ScaleWidth = 15240
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton ComExit
Caption = "退出"
Height = 405
Left = 2850
TabIndex = 5
Top = 2250
Width = 1140
End
Begin VB.CommandButton ComEnter
Caption = "登录"
Height = 405
Left = 795
TabIndex = 4
Top = 2265
Width = 1170
End
Begin VB.TextBox TextPass
Height = 285
IMEMode = 3 'DISABLE
Left = 1875
PasswordChar = "*"
TabIndex = 3
Text = "adm"
Top = 1665
Width = 1980
End
Begin VB.TextBox TextUser
Height = 285
Left = 1875
TabIndex = 0
Text = "adm"
Top = 1320
Width = 1980
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 825
Top = 2685
Visible = 0 'False
Width = 1890
_ExtentX = 3334
_ExtentY = 582
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 = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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 VB.Label Label4
Caption = "通讯录"
BeginProperty Font
Name = "楷体_GB2312"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 585
Left = 1080
TabIndex = 7
Top = 240
Width = 2790
End
Begin VB.Label Label3
Caption = "信管0402"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 390
Left = 1830
TabIndex = 6
Top = 900
Width = 2205
End
Begin VB.Label Label2
Caption = "密码:"
Height = 195
Left = 1080
TabIndex = 2
Top = 1710
Width = 675
End
Begin VB.Label Label1
Caption = "用户名:"
Height = 225
Left = 1080
TabIndex = 1
Top = 1365
Width = 690
End
End
Attribute VB_Name = "ForLoad"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub ComEnter_Click()
Dim Temp As Integer
Dim I As Integer
Temp = 0
'注释:查找用户
Adodc1.Refresh
Adodc1.Recordset.MoveFirst '指向第一条记录
For I = 1 To Adodc1.Recordset.RecordCount '记录的数量.
If TextUser.Text = Adodc1.Recordset("用户名") Then
If TextPass.Text = Adodc1.Recordset("密码") Then
Temp = 1
ForMain.Show '注释:加载窗口"ForMain.frm"
ForMain.TextPower.Text = Adodc1.Recordset("权限")
'注释:登记登录的用户
Unload Me '注释:卸载本窗口
Exit For '注释:跳出For
End If
End If
Adodc1.Recordset.MoveNext '注释:指向下一条记录
DoEvents
Next I
If Temp = 0 Then
Temp = MsgBox("用户/密码!!!", vbOKOnly, "错误")
'注释:提示用户:"用户/密码!!!"
TextPass.SetFocus
End If
End Sub
Private Sub ComExit_Click() '注释:单击"退出"
End '注释:退出程序
End Sub
Private Sub Form_Load()
'------------------------
'注释:'连接到数据库.(管理员)
With Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Jing.mdb;Mode=ReadWrite;Persist Security Info=False"
.CommandType = adCmdTable
.RecordSource = "用户" '注释:'连接到表"用户"
.Refresh '注释:刷新
End With
'------------------------
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -