📄 form2.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form2
BackColor = &H00C0C0FF&
Caption = "密码修改"
ClientHeight = 3195
ClientLeft = 4140
ClientTop = 2145
ClientWidth = 4680
Icon = "Form2.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
Begin MSAdodcLib.Adodc Adodc1
Height = 735
Left = 1680
Top = -240
Width = 1575
_ExtentX = 2778
_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 = &H00C0C0FF&
Caption = "返回"
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 = 11
Top = 2640
Width = 1215
End
Begin VB.CommandButton Command2
BackColor = &H00C0C0FF&
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1920
Style = 1 'Graphical
TabIndex = 10
Top = 2640
Width = 1215
End
Begin VB.CommandButton Command1
BackColor = &H00C0C0FF&
Caption = "确认"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 720
Style = 1 'Graphical
TabIndex = 9
Top = 2640
Width = 1215
End
Begin VB.TextBox Text4
Height = 495
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 3
Top = 2040
Width = 1215
End
Begin VB.TextBox Text3
Height = 495
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 2
Top = 1560
Width = 1215
End
Begin VB.TextBox Text2
Height = 495
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 1
Top = 1080
Width = 1215
End
Begin VB.TextBox Text1
Height = 495
Left = 2280
TabIndex = 0
Top = 600
Width = 1215
End
Begin VB.Label Label5
Alignment = 2 'Center
BackColor = &H00C0C0FF&
Caption = "确认密码"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 8
Top = 2160
Width = 1095
End
Begin VB.Label Label4
Alignment = 2 'Center
BackColor = &H00C0C0FF&
Caption = "修改密码"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 7
Top = 1680
Width = 1095
End
Begin VB.Label Label3
Alignment = 2 'Center
BackColor = &H00C0C0FF&
Caption = "密码"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 6
Top = 1200
Width = 1095
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00C0C0FF&
Caption = "用户名"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 5
Top = 720
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00C0C0FF&
Caption = " 用户修改密码"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 4
Top = 120
Width = 2055
End
End
Attribute VB_Name = "Form2"
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 password1 As String
Dim password2 As String
Dim isuser As Boolean
isuser = False
user = Trim(Text1.Text)
password = Trim(Text2.Text)
password1 = Trim(Text3.Text)
password2 = Trim(Text4.Text)
Do While Not Adodc1.Recordset.EOF
If Adodc1.Recordset.Fields("用户名").Value = user Then
If Adodc1.Recordset.Fields("密码").Value = password Then
If password1 = password2 Then
Adodc1.Recordset.Fields("密码").Value = password2
Adodc1.Recordset.Update
MsgBox "密码修改成功"
Unload Form2
Form1.Show
Exit Sub
Else
MsgBox "密码两次不一致"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
isuser = True
Exit Do
End If
Else
MsgBox "密码出错,请重新书过"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
isuser = True
Exit Do
End If
End If
Adodc1.Recordset.MoveNext
Loop
If Not isuser Then
MsgBox "用户名出错"
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
End If
Adodc1.Recordset.MoveFirst
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Command3_Click()
Unload Form2
Form1.Show
End Sub
Private Sub Form_Load()
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 + -