Click to See Complete Forum and Search --> : Releasing ADO
spuppett
February 25th, 2005, 10:46 AM
I have an asp page that accesses a FoxPro table. After I am done with the DB I set the connection and recordset to nothing.
Then I try to check my table and it says that I can't access the file. If I wait about 2 or 3 minutes everything works fine. I'm assuming that I'm still connected to the DB and thats why I can't access it. If thats the case is that par for the course or do I have to take another step to break the connection?
Thanks gurus
Michaelw
February 25th, 2005, 11:24 AM
Are you using ADO.NET or old ADO stuff. I assume you are using .NET so if you want to close the connection you must call conneciton.Close() and Dispose() of the object. Why do you try and close your recordset? Do you put this data somewhere else before you dispose of it?
When you say set connection and recordset to nothing? Expand on that.
Foxpro I bet that is painful. We have 10 year old fat client app with 100 tables. We are moving the whole codebase ( 500,000 line sof code ) to C# and SQL.
spuppett
February 25th, 2005, 12:44 PM
Actually I'm using old ADO.
I close the recordset and connection when I'm done adding new records or updating.
To close it in my asp page i do
set rs = nothing
set conn = nothing
Thats it.
Thanks for your input.
Krzemo
February 28th, 2005, 06:52 AM
I'm assuming that I'm still connected to the DB and thats why I can't access it.Yes U are still connected.
U should call conn.Close before setting it to nothing.
And in case U have "connection pooling" option enabled than it can fail too.
Best regards,
Krzemo.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.