database access Speed

Results 1 to 2 of 2

Thread: database access Speed

  1. #1
    Join Date
    Dec 1969

    Default database access Speed

    I wanted to know. When using Microsoft Access as the database what should I do in this situation. <BR><BR>I have three database calls. Each one based off of a value in the previous one that is modified in some way by the program. Three different recordsets on the same page but can not be gotten all at the same time. <BR>I figured that it would be faster for the page to make a connection object at first then after all three recordsets have been gotten to just close the connection. I imagine this would be faster. But would access in its usual inability to handle lots of different connections fail because now the connection is being held for more time then before. (I know its miliseconds). Currently it opens and closes the connection for each recordset. Stable but starting to get slow. <BR><BR>So in this situation would my idea work out? Open one connection per page no matter how many recordsets. Then close it after the last recordset. <BR><BR>inorder to see if it works underload would mean it was in production and it can&#039;t break there. <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Yes, keep the connection... until you&#039;ve dealt with all the recordsets. Then close it only at the end.<BR><BR>Also, do all your processing at the beginning, i.e. open connection - open recordset 1 - get the data you want - close it - open recordset 2 - get the next set of data - close it - open recordset 3 - get the third set of data - close it - then close the connection - then do all the remaining processing you need to do and output the HTML.<BR><BR>The less you do that&#039;s unnecessary while you have the connection open, the better. Also, you may be able to optimize your code if you look through it carefully. You often find that there&#039;s a lot of stuff you program the first time round that you could do a lot quicker and more efficient when you look at it again.<BR><BR>Oliver.

Posting Permissions

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