A
Arpan
An ASP application updates a SQL Server database table after a Form is
submitted after which the user is directed to another page that should
display the updated records. If the code is
----------------------------------------
'records get updated here
Response.Redirect("Records.asp")
objRS.Close
Set objRS=Nothing
objConn.Close
Set objConn=Nothing
----------------------------------------
then the user is correctly shown the updated records after redirection.
If the code is
----------------------------------------
'records get updated here
Server.Transfer("Records.asp")
objRS.Close
Set objRS=Nothing
objConn.Close
Set objConn=Nothing
----------------------------------------
then the updated records aren't reflected. The updated records can be
seen only after refreshing the page. If the code is
----------------------------------------
'records get updated here
Server.Execute("Records.asp")
objRS.Close
Set objRS=Nothing
objConn.Close
Set objConn=Nothing
----------------------------------------
then the "Operation is not allowed when the object is closed" error
gets generated though the records in the table get updated.
If any of the 3 Response.Redirect or Server.Execute or Server.Transfer
lines are placed after closing the recordset object & the connection
object, again the above error gets generated though the records in the
database get updated successfully in each of the 3 cases. What causes
the above mentioned error & the difference in the output displayed?
Thanks,
Arpan
submitted after which the user is directed to another page that should
display the updated records. If the code is
----------------------------------------
'records get updated here
Response.Redirect("Records.asp")
objRS.Close
Set objRS=Nothing
objConn.Close
Set objConn=Nothing
----------------------------------------
then the user is correctly shown the updated records after redirection.
If the code is
----------------------------------------
'records get updated here
Server.Transfer("Records.asp")
objRS.Close
Set objRS=Nothing
objConn.Close
Set objConn=Nothing
----------------------------------------
then the updated records aren't reflected. The updated records can be
seen only after refreshing the page. If the code is
----------------------------------------
'records get updated here
Server.Execute("Records.asp")
objRS.Close
Set objRS=Nothing
objConn.Close
Set objConn=Nothing
----------------------------------------
then the "Operation is not allowed when the object is closed" error
gets generated though the records in the table get updated.
If any of the 3 Response.Redirect or Server.Execute or Server.Transfer
lines are placed after closing the recordset object & the connection
object, again the above error gets generated though the records in the
database get updated successfully in each of the 3 cases. What causes
the above mentioned error & the difference in the output displayed?
Thanks,
Arpan