Home > Software engineering >  River's lake emergency of new vb
River's lake emergency of new vb

Time:11-13

Sq1="select * from student information table where name='" & amp; Student id & amp; "'
"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 wrong

CodePudding 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 mistake

CodePudding user response:

From which copy and paste the code?

CodePudding user response:

refer to 7th floor vansoft response:
from which copy and paste the code?
written by myself

CodePudding user response:

refer to the eighth floor babyfaceu response:
Quote: refer to 7th floor vansoft response:
from which copy and paste the code?
about
sure not spell hit?

CodePudding user response:

VB upstairs, you are in college?

CodePudding user response:

Is too messy, your code, write in front of the query variable called SQL, behind the rs. The open is used in the SQLSTR, no attention when you write code, this 1 hour to write the code will spend 8 hours to fault, it is important to note
  • Related