VB to modify the password problem urgent urgent!!!!!
Time:09-16
Private Sub Command1_Click () Dim the db As New ADODB. Connection Dim the rs As New ADODB. You Dim As SQL String The ConnectionString="driver={SQL server}; Server=(local); Uid=sa; The PWD=sa; The database=WXCB " The Open If the Trim (text2. Text="") Then MsgBox "old password cannot be empty, please input again!" , vbOKOnly + vbExclamation, "warning" Text2. Text="" Text2. SetFocus The Exit Sub End the If If the Trim (Text3. Text="") Then MsgBox "new password cannot be empty, please input again!" , vbOKOnly + vbExclamation, "warning" Text3. Text="" Text3. SetFocus The Exit Sub End the If If Text3. Text & lt;> Text4. Text Then MsgBox "two enter a new password, please input again!" , vbOKOnly + vbExclamation, "warning" Text3. Text="" Text4. Text="" Text3. SetFocus The Exit Sub The Else SQL="select * from user1 where user name='" & amp; Text1. Text & amp; "' "Rs. The Open SQL, db, adOpenStatic adLockReadOnly 'Open return record sets available If the rs. EOF=True Then MsgBox "without the users" vbOKOnly + vbExclamation, "" Text1. Text="" Text2. Text="" Text3. Text="" Text4. Text="" Text1. SetFocus The Else If the Trim (rs) Fields (" password ")) & lt;> Trim (text2. Text) Then MsgBox "old password is wrong, please input again!" , vbOKOnly + vbExclamation, "warning" Text2. Text="" Text3. Text="" Text4. Text="" Text3. SetFocus The Else
MsgBox "the password is changed!" , vbOKOnly + vbInformation, "tip" Text1. Text="" Text2. Text="" Text3. Text="" Text4. Text="" Text1. SetFocus End the If End the If End the If Rs. Close Set the rs=Nothing End Sub
Show the password change is successful, but the data did not change
CodePudding user response:
Didn't see the update from the beginning to the end
CodePudding user response:
Then how to in MsgBox "password is changed!" , vbOKOnly + vbInformation, "tips" on how to add?
CodePudding user response:
Much more accumulate knowledge ah,,, http://www.w3school.com.cn/sql/sql_update.asp The UPDATE table name SET column names=new value WHERE the column name=a
UPDATE user1 SET your password column name=new password WHERE the content of the username=TXT
CodePudding user response:
I added the Update in the way you user1set password=text3. Textwhere username=text1. Text display method was not found or data member