📄 addedit.frm
字号:
VERSION 5.00
Begin VB.Form frmaddedit
Caption = "修改密码"
ClientHeight = 3765
ClientLeft = 60
ClientTop = 345
ClientWidth = 4605
LinkTopic = "Form1"
ScaleHeight = 3765
ScaleWidth = 4605
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdcancel
Caption = "取 消"
Height = 345
Left = 2625
TabIndex = 6
Top = 3240
Width = 1050
End
Begin VB.CommandButton cmdok
Caption = "确 认"
Height = 345
Left = 480
TabIndex = 5
Top = 3240
Width = 1065
End
Begin VB.Frame Frame1
Height = 2625
Left = 120
TabIndex = 0
Top = 225
Width = 4335
Begin VB.TextBox Text4
Height = 375
IMEMode = 3 'DISABLE
Left = 1620
PasswordChar = "*"
TabIndex = 11
Top = 795
Width = 2295
End
Begin VB.TextBox Text3
Height = 390
Left = 1620
TabIndex = 9
Top = 240
Width = 2325
End
Begin VB.TextBox Text2
Height = 345
IMEMode = 3 'DISABLE
Left = 1635
PasswordChar = "*"
TabIndex = 4
Top = 2040
Width = 2280
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 1620
PasswordChar = "*"
TabIndex = 3
Top = 1425
Width = 2280
End
Begin VB.Label Label5
Caption = "密 码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 180
TabIndex = 10
Top = 840
Width = 1515
End
Begin VB.Label Label4
Caption = "用 户 名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 180
TabIndex = 8
Top = 300
Width = 1410
End
Begin VB.Label Label2
Caption = "请确认新密码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 120
TabIndex = 2
Top = 2040
Width = 1365
End
Begin VB.Label Label1
Caption = "请输入新密码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 120
TabIndex = 1
Top = 1440
Width = 1410
End
End
Begin VB.Label Label3
Caption = "Label3"
Height = 495
Left = 1680
TabIndex = 7
Top = 1680
Width = 1215
End
Begin VB.Line Line2
X1 = 0
X2 = 4665
Y1 = 3000
Y2 = 3000
End
Begin VB.Line Line1
BorderColor = &H80000005&
BorderWidth = 3
X1 = 0
X2 = 4680
Y1 = 3000
Y2 = 3000
End
End
Attribute VB_Name = "frmaddedit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim pwd As ADODB.Connection
Dim usepwd As ADODB.Recordset
Dim txtSQL As String
Dim MsgText As String
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
'Dim txtSQL As String
Set usepwd = New Recordset
txtSQL = "select * from userpwd where U_name='" & Text3 & "'and U_pass='" & Text4 & " '"
usepwd.Open txtSQL, pwd, adOpenKeyset, adLockOptimistic, adCmdText
If usepwd.RecordCount <= 0 Then
MsgBox "用户名或密码错误!"
Exit Sub
End If
'检查新密码是否一致
If Trim(Text1.Text) <> Trim(Text2.Text) Then
MsgBox "新密码输入不正确!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text1.Text = ""
Else
usepwd.Fields(1) = Text1.Text
usepwd.Update
usepwd.Close
MsgBox "密码修改成功!", vbOKOnly + vbExclamation, "密码修改成功"
Me.Hide
End If
End Sub
Private Sub Form_Activate()
Text3.Text = UserName
Text4.Text = UserPass
End Sub
Private Sub Form_Load()
Set pwd = New Connection
pwd.Open "provider=sqloledb;data source=localhost;uid=sa;pwd=;database=my_medsys;"
pwd.CursorLocation = adUseClient
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -