|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Where to place Recordset.close
I woke up to find my site crashed today, Microsoftr Access 'Out of System Resources' error.
Seems like the most likely cause is an unclosed recordset. I have gone over my code and it seems like every rs.open has a corresponding: rs.close set rs = Nothing My question is, does the placement in my ASP file make a difference to anything? I have a rs.open, then several IF's that use the data, then the rs.close. Could having my rs.close way down at the bottom be causing it to not work? The question in a simpler form: If a recordset is closed, can code after the close still access the recordset data? Another question, do I need to put a 'strSQL.close' after the following statement : strSQL_NEW="UPDATE [qOrders] Set [status]='Completed', [TrackingNumber]='"&PP_Txn_ID&"', [carrier]='Digital' WHERE [OrderID]="&PP_Item_Name 'Call up the customer order info: cnDZ.Execute(strSQL_NEW) Thanks.. |
|
#2
|
||||
|
||||
|
Hi,
you don't and can't as far as I know do a strSQL.close, its only a string and should not cause errors. A good way to close the rs is right after you have finished using the recordset. As long as you have a rs.close on each page, you should be good. Hope this helps
__________________
Look! Its a ShemZilla ![]() ![]()
|
|
#3
|
|||
|
|||
|
Thanks,
I have a rs.open, and then 3 IF clauses that use the data from that recordset. Do I need to put a rs.close after each IF statement, or simply one at the end of the file? Quote:
|
|
#4
|
|||
|
|||
|
As soon as you close a recordset, it's no longer available to your code, so if you close a rs in a loop subsequent iterations through your loop won't be able to use the rs.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Where to place Recordset.close |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|