troubleshooting Question

runtime error '3219' when trying to close a ADODB recordset in an err handler

Avatar of howardsd
howardsd asked on
Visual Basic Classic
10 Comments1 Solution3601 ViewsLast Modified:
i have an error handler in a btn_Click() sub.  this sub calls functions that do all my db work, and these functions reside in separate modules.  i do not have error handlers in any of the functions, and let all the errors filiter back to this buttons error handler.

i'm trying to close my recordsets in this err handler, but get a runtime error '3219' not in this context when called.  the recordsets variables are declared in another module that contains all of my contants & globals.  

this is what i'm attempting:

If Not rsread Is Nothing Then
If rsread.state = adStateOpen Then rsread.Close
End If

it's interesting because i can check the state by calling

Debug.Print rsread.State

which returns a valid response but cannot close it if open

any help would be appreciated



ASKER CERTIFIED SOLUTION
shancock

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros