📄 mima.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form mima
AutoRedraw = -1 'True
BorderStyle = 1 'Fixed Single
Caption = "修改密码"
ClientHeight = 3135
ClientLeft = 6615
ClientTop = 2445
ClientWidth = 3825
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3135
ScaleWidth = 3825
Begin VB.Frame Frame1
Height = 3015
Left = 120
TabIndex = 0
Top = 0
Width = 3615
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 5
Top = 240
Width = 1695
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 4
Top = 960
Width = 1695
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 3
Top = 1680
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "修改"
Height = 495
Left = 360
TabIndex = 2
Top = 2280
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 495
Left = 1920
TabIndex = 1
Top = 2280
Width = 1215
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 240
Top = 720
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_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 = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label1
Caption = "旧密码"
Height = 375
Left = 720
TabIndex = 8
Top = 360
Width = 975
End
Begin VB.Label Label2
Caption = "新密码"
Height = 375
Left = 720
TabIndex = 7
Top = 1080
Width = 975
End
Begin VB.Label Label3
Caption = "新密码验正"
Height = 375
Left = 120
TabIndex = 6
Top = 1800
Width = 1575
End
End
End
Attribute VB_Name = "mima"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public conn As New ADODB.Connection
Dim rs1 As New ADODB.Recordset
Dim sql As String
Dim userid As String
Private Sub Command1_Click()
Dim pwd0 As String
Dim pwd1 As String
Dim pwd2 As String
sql = " select * from userid where userid= '" & userid & "'"
rs1.Open sql, conn, adOpenKeyset, adLockPessimistic
pwd0 = Trim(Text1.text)
pwd1 = Trim(Text2.text)
pwd2 = Trim(Text3.text)
If pwd0 = "" Then
MsgBox "对不起,请输入你原始密码", vbOKOnly + 32, "提示"
Text1.SetFocus
rs1.Close
Exit Sub
End If
If pwd1 = "" Then
MsgBox "对不起,请输入你的新密码", vbOKOnly + 32, "提示"
Text2.SetFocus
rs1.Close
Exit Sub
End If
If pwd1 = pwd2 Then
If pwd0 = rs1.Fields("password") Then
conn.Execute (sql)
rs1.Fields("password") = pwd1
rs1.Update
Else
MsgBox "老密码不正确,请合对", vbokonlu + 16, "提示"
Text1.SetFocus
rs1.Close
Exit Sub
End If
Else
MsgBox "两次输入不一致,请合对", vbokonlu + 16, "提示"
Text2.SetFocus
rs1.Close
Exit Sub
End If
rs1.Update
MsgBox "修改成功", vbOKOnly, "提示"
rs1.Close
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Text1.text = ""
Text2.text = ""
Text3.text = ""
userid = loge.userid
connstring = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\rsgl.mdb"
conn.Open connstring
End Sub
Private Sub Form_Unload(Cancel As Integer)
conn.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -