📄 form1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1
BackColor = &H00FFC0FF&
Caption = "登陆界面"
ClientHeight = 3090
ClientLeft = 3915
ClientTop = 2145
ClientWidth = 4725
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3090
ScaleWidth = 4725
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 735
Left = 1560
Top = 120
Width = 1815
_ExtentX = 3201
_ExtentY = 1296
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.CommandButton Command3
BackColor = &H00FFC0FF&
Caption = "&Q 取消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
Style = 1 'Graphical
TabIndex = 7
Top = 2400
Width = 1095
End
Begin VB.CommandButton Command2
BackColor = &H00FFC0FF&
Caption = "&M 密码修改"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1680
Style = 1 'Graphical
TabIndex = 6
Top = 2400
Width = 1455
End
Begin VB.CommandButton Command1
BackColor = &H00FFC0FF&
Caption = "&E 确定"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
Style = 1 'Graphical
TabIndex = 5
Top = 2400
Width = 1095
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 1
Top = 1680
Width = 1575
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2280
TabIndex = 0
Top = 960
Width = 1575
End
Begin VB.Label Label3
Alignment = 2 'Center
BackColor = &H00FFC0FF&
Caption = "用户名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 4
Top = 960
Width = 1215
End
Begin VB.Label Label1
BackColor = &H00FFC0FF&
Caption = "用户登陆"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 3
Top = 360
Width = 1335
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00FFC0FF&
Caption = "密码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 2
Top = 1800
Width = 975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim user As String
Dim password As String
Dim isuser As Boolean
Static count As Integer
user = Trim(Text1.Text)
password = Trim(Text2.Text)
isuser = False
Do While Not Adodc1.Recordset.EOF
If Adodc1.Recordset.Fields("用户名").Value = user Then
If Adodc1.Recordset.Fields("密码").Value = password Then
MsgBox "密码登陆成功"
Unload Form1
Load Form3
Form3.Show
Exit Sub
Else
If count < 3 Then
MsgBox "密码错误,登陆失败"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
isuser = True
Exit Do
End If
End If
End If
Adodc1.Recordset.MoveNext
Loop
count = count + 1
If count = 3 Then
MsgBox "3次登陆不成功,你没有权限登陆"
End
End If
If Not isuser Then
MsgBox "用户名出错"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
Adodc1.Recordset.MoveFirst
End Sub
Private Sub Command2_Click()
Unload Form1
Load Form2
Form2.Show
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Adodc1.Visible = False
Adodc1.ConnectionString = "Provider=Microsoft.jet.OLEDB.3.51;Persist Security Info=False; data source= " & App.Path & "\科技系统档案库.mdb"
Adodc1.RecordSource = "select * from 用户登陆"
Adodc1.Refresh
Adodc1.ConnectionTimeout = 30
Adodc1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -