My code is as follows:
If Text1. Text & gt; "" And Text2. Text & gt; "" Then
Adodc1. RecordSource="select * from permissions table where user name='" & amp; Text1. Text & amp; "' And password='" & amp; Text2. Text & amp; "'
"Adodc1.Com mandType=adCmdText
Adodc1. Refresh
If Adodc1. You. RecordCount & gt;
0 Then 'has dataAdodc1. You. MoveFirst
If the Trim (Text2. Text) & lt;> Trim (Adodc1. You. Fields (" password ")) Then 'check user password
MsgBox "原始密码错误,请重新输入", , "提示:"
The Else
If the Trim (Text4. Text) & lt;> Trim (Text3. Text) Then
MsgBox "password, re-enter", and "tip:
"Text4. Text=""
The Else
Adodc1. You. Fields (" password ")=Trim (Text4. Text)
Adodc1. You. Update
MsgBox "password is changed", and "tip:
"End the If
End the If
The Else
MsgBox "the user name and password does not exist", and "tip:
"End the If
The Else
MsgBox "the user name and password cannot be empty", and "tip:
"End the If
End Sub
Private Sub Text2_keydown (keycode As an Integer, shift the As an Integer)
If keycode=13 Then
Call Command1_Click
End the If
End Sub
CodePudding user response:
Is here "' And password='" less a space before?CodePudding user response:
The table name, field name to use [] surround the try again,CodePudding user response:
Have tried, no, is still the sameCodePudding user response:
Adodc1. RecordSource="select * from permissions table where user name='" & amp; Text1. Text & amp; "' And password='" & amp; Text2. Text & amp; "'
"Is amended as:
Adodc1. RecordSource="select * from permissions table where user name='" & amp; Text1. Text & amp; "' And password='" & amp; Text2. Text & amp; "'
"And there should be a space in front of the, if Texi1=abcd, Text2=1234
You generated after is the original statement: select * from permissions table where name='abcd' And password='1234'
Revised: select * from permissions table where name='abcd' And password='1234'
Is a mistake in stealth,
CodePudding user response: