rs.Close, Runtime Error 3219 (VB6)

Sorry guys, these are my last remaining points. In my program I have the code:
Private Sub Form_Load()
rs.Close
rs.Open "select * from UserNames where UserName = '" & gstUserName & "'"
rs.Fields!Grade = TeacherGrade
rs.Close <<< operation not allowed in this context, runtime error 3219
rs.Open TeacherGrade
rs.MoveFirst
Do Until rs.EOF
List1.AddItem rs.Fields!NameGrade
rs.MoveNext
Loop
End Sub

Any suggestions? and no this isn't a school project =P
MasterpipAsked:
Who is Participating?
 
tusharashahConnect With a Mentor Commented:
Try "Rs.Update" or "Rs.CancelUpdate" before you close the recordset....

-tushar
0
 
JohnBPriceCommented:
tusharashah is right, if you try to close a recordset which has an update pending, you get that error.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.