|
-
Apr 20th, 2006, 08:01 AM
#1
Thread Starter
New Member
Database connection error
I am using vb.net that is using Access97 tables. After my program runs several files through the program against the Access97 database I get a cmdrecordset error when stops the program. When I close my program and restart it it runs ok. My question is is there a way to catch this error and close and restart the program within my vb.net code? Thanks
The error is:
The connection cannot be used to perform the operation. It is either closed or invalid in this context. in GetRecordsetcmd.
-
Apr 20th, 2006, 08:07 AM
#2
Re: Database connection error
Suggestion number one would be to error trap the routine.
It appears that recordset is being closed and then you are trying to do something with it, so I would look at the code before the code that generates the error to see if it is getting closed.
BTW: What version of VB.NET are you using? It is helpful to select one of the version option buttons when creating a new thread as code that works with 2002/2003 might not work with 2005.
-
Apr 20th, 2006, 05:57 PM
#3
Thread Starter
New Member
Re: Database connection error
2003.
How would I trap the error???
-
Apr 21st, 2006, 03:19 AM
#4
Re: Database connection error
 Originally Posted by lappling
2003.
How would I trap the error???
You wouldn't trap the error. You would fix it. When the application crashes in the debugger it will tell exactly where the issue occurred, then you can look back and see where the connection was closed. You would also do well to stop using ADO and use ADO.NET instead.
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
|