"Rs. The Open SQLSTR, Conn, adOpenKeyset, adLockOptimistic
If Myjl. EOF=True Then
MsgBox "no" & amp; Student id & amp; "The user", vbOKOnly + vbExclamation, ""
Text3. SetFocus
The Else
Myjl. Fields (1)=Text3. Text
Myjl. Update
Myjl. Close
MsgBox "password is changed," vbOKOnly + vbExclamation, "success!"
Run time shows the Rs. Open SQLSTR, Conn, adOpenKeyset, adLockOptimistic parameter type is not correct or is outside the scope of acceptable
How should change yi 'xia' a
CodePudding user response:
You don't see why the error, but the following "Myjl" whether there is a problem, isn't it should be "RS"CodePudding user response:
Sq1="select * from student information table where name='" & amp; Student id & amp; "'"Question 1 'name=student id, don't traditionally defined
Question 2 'student id is placed in the text, use the text in order to make the student id attribute
Rs. The Open SQLSTR, Conn, adOpenKeyset, adLockOptimistic
If Myjl. EOF=True Then
Question 3 'definition record set identified as RS
'the record called myjl to rs
MsgBox "no" & amp; Student id & amp; "The user", vbOKOnly + vbExclamation, ""
The same problem of student id
Text3. SetFocus
Question 4, RS. EOF=TRUE that record does not exist, increase record the code of the processing here
Question 5, add records to call addnew method
The Else
Myjl. Fields (1)=Text3. Text
Myjl. Update
Myjl. Close
MsgBox "password is changed," vbOKOnly + vbExclamation, "success!"
CodePudding user response:
Human habits, record does not exist, can be directly, and don't need a pop-up window to let the user confirm again. Of course, Text3 SetFocus don't need this code, directly increase saving
CodePudding user response:
To mend the tip or not just the wrong a word also don't know what went wrongCodePudding user response:
Sq1 ="select * from student information table where name='" & amp; Student id & amp; "'" Rs. Open SQLSTR , Conn, adOpenKeyset, adLockOptimistic
Two variable name
CodePudding user response:
To turn the variable name is wrong or hint that mistakeCodePudding user response:
From which copy and paste the code?CodePudding user response: