|
-
Apr 24th, 2002, 08:33 AM
#1
Thread Starter
Hyperactive Member
'On Error Resume Next' doesn't
Any idea why this doesn't work?
The rsRes.Close statement still returns an error if it is already closed.
VB Code:
handleError:
'In case error occurs while connection and/or recordset closed
On Error Resume Next
rsRes.Close
cnnCon.Close
-
Apr 24th, 2002, 08:44 AM
#2
Bouncy Member
have to tried stepping through it to make sure it definatly errors on that line??
not on another line or an event causes by closing the recordset or anything???
-
Apr 24th, 2002, 08:45 AM
#3
well why do you have
On Error Resume Next
inside your error handle.. shouldn't that go at the top of your sub/function?
also you can use
rsRes.State to determine the open/closed state of a recordset or connection (cnnCon.State)... it will return either a 0 or 1 for closed or open.
-
Apr 24th, 2002, 08:49 AM
#4
Thread Starter
Hyperactive Member
Originally posted by kleinma
well why do you have
On Error Resume Next
inside your error handle.. shouldn't that go at the top of your sub/function?
also you can use
rsRes.State to determine the open/closed state of a recordset or connection (cnnCon.State)... it will return either a 0 or 1 for closed or open.
I only want to resume on an error within the error handler.
I'll sort (hopefully) all errors within it.
but now, thanks to you I know how to check if the rs is open, so I'll not need it.
Cheers.
-
Apr 24th, 2002, 10:52 AM
#5
Fanatic Member
you might try clearing the error (err.clear)
so that it pays attention to the close error, otherwise
I've noticed erroring in an error handler crashes out of the
sub and hits any outside error handlers.
but I'd guess checking the state is a better solution.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|