关于登陆密码的修改新密码的设计, 我编得程序可以执行,但是就是修改不了密码。什么原因阿?
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim sql As String
Dim rs_chang As New ADODB.Recordset
If Trim(txtnewpwd1.Text) <> Trim(txtnewpwd2.Text) Then
MsgBox "密码输入不正确!", 0 + 48, "警告"
txtnewpwd1.SetFocus
txtnewpwd1.Text = ""
Else
sql = "select * from user where username='" & userID & "'"
conn = "filedsn=login.dsn"
rs_chang.Open sql, conn, adOpenKeyset, adLockPessimistic
If (rs_chang.BOF Or rs_chang.EOF) Then
MsgBox "此操作无效,请重试!", 0 + 48, "警告"
txtnewpwd1.SetFocus
Else
rs_chang.Fields(1) = Trim(txtnewpwd1.Text)
rs_chang.Update
rs_chang.Close
MsgBox "密码修改成功!", 0 + 48, "修改密码"
Unload Me
End If
End If
End Sub
请各位神仙指教 !!!1谢谢