Freeing ADO Objects: WROX customers read this---

Results 1 to 2 of 2

Thread: Freeing ADO Objects: WROX customers read this---

  1. #1
    kgb Guest

    Default Freeing ADO Objects: WROX customers read this---

    After reading the article about freeing ADO objects explicitly<BR>(, I realized I was having the same problem as the Brian Fairchild person identified in the article. <BR><BR>After a few days of trouble free use, my Access driven ASP pages choke with the message 8004005 Cannot find db &#039unknown&#039. File may be missing or corrupt" or something like that (but not the "in use" message). <BR><BR>I don&#039t yet know if explicitly freeing my ADO objects will solve this problem, but I realized where I picked up the bad habit of not closing these:<BR><BR>I learned ASP by reading the WROX book Beginning ASP 3.0. On the whole I found the book a great way to learn ASP, HOWEVER in all of their code samples the Connection objects are never explicitly closed, and the recordsets are only sometimes explicitly closed. <BR><BR>I went to the bookstore and looked through the ASP books there and discovered that most of the WROX books as well as the SAMS books don&#039t discuss closing your ADO objects. The only books that make a point of closing everything all the time are the ones by Microsoft.<BR><BR>MY question: What else is being left out? Is there some other cleanup in addition to the ADO objects that I should be doing to minimize the memory leak of my ASP applications? Do arrays need to be set to null, etc.?

  2. #2
    Join Date
    Dec 1969

    Default RE: Freeing ADO Objects: WROX customers read this-

    variables and objects go out of context a given time after the page is discarded after processing. memory is generally automatically freed. Connections however, go into a connection pool for a set period, and can be re-called at a lower cost to the system later.<BR><BR>the corruption damage to your DB probably isn&#039t anything to do with freeing objects and references explicitly. it&#039s more likely to be failed updates, a network failure (especially if you use shared web hosting with separate fileservers and webservers) or possibly a server crash. this has happened to one of my sites on a shared server account. surprisingly sites on non-distributed server systems don&#039t seem to do it.<BR><BR>It&#039s good practice to always free your objects, but scripts don&#039t generally &#039leak memory&#039, since the script engine is pretty good at keeping its house in order anyway.<BR><BR>check ANY code which updates your databases. try to minimise the time which update or insert queries are open for, and make sure that read-only queries ARE read only queries - this may help, but the only sure fire solution is to use a better RDBMS i.e. SQL Server<BR><BR><BR>btw It&#039s only a problem in access - i&#039ve never seen it any other time.<BR><BR>jason

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts