Private Sub cmdSave_Click()
If Trim(Text2) = "" Then
MsgBox "请输入新密码!", vbCritical, "修改密码"
ElseIf Text3Text2 Then
MsgBox "两次输入的新密码必须相同!", vbCritical, "修改密码"
Text2.SelStart = 0
Text2.SelLength = Len(Text2)
Else
Dim objCn As New Connection
strcn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\数据库\成员资料.mdb"
objCn.Open strcn
strsql = "Update 成员资料 set 密码='" & Text2 & "' " _
& "Where 用户名='" & ThisUserName & "'"
objCn.Execute strsql, isupdated
If isupdated > 0 Then
ThisPassword = Text2
MsgBox "密码已被成功修改!", vbInformation, "修改密码"
Else
MsgBox "无法修改密码!", vbCritical, "修改密码"
End If
objCn.Close
Set objCn = Nothing
End If
End Sub
1楼的不管用
|