Some questions about Access

Results 1 to 2 of 2

Thread: Some questions about Access

  1. #1
    Join Date
    Dec 1969

    Default Some questions about Access

    I&#039;m satill having trouble figuring out how many concurrent users my access database on my site could support. I read recently in an artilce that:<BR><BR>"If your code is written well (i.e., database connections are opened only when they&#039;re needed and closed as soon as they&#039;re not needed any more), just a few concurrent connections could support hundreds of users. A concurrent connection means that an active database connection is open."<BR><BR>Some questions:<BR><BR>Now does this mean that if you have multiple queries on the same page, you should open the connection, close it, and then reopen it the next time it needs to be accessed or should I only open and close it once?<BR><BR>Also: Let&#039;s say I use the following code:<BR><BR>sql = "select * from users"<BR>set reuslts = connection.execute(sql)<BR><BR>do while not results.eof<BR>....<BR><BR>results.movenext<BR>loo p<BR><BR>Can I close the connection right after the execute? Are the results that are looped through extracted from the table all at once, or is it record by record as it is looped through?<BR><BR>And another question: If a page lacks a connection.close, is the metgod executed automatically once the ASP script finishes running? Some of my pages have so many if then/else statements that I worry that I may close the same connection twice.<BR><BR>Any help would be very much appreciated! And anyone who thinks they might be able to help me clean up my code on the critical pages of the site, please come forth! You can email me at<BR><BR>Thanks,<BR><BR>Jarrod <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Some questions about Access

    Hi Jarrod. You should always close a connection once your done with it. Is it necessary? Some say no but I believe that it&#039;s a great habit to get into. Why leave it open and rely on the server to close it? As for worrying about closing it twice just look at it this way. Once you open the connection you execute your code, at the end of that code should be the close connection statement. No matter how many if, then, else statements you have. In the case of a loop, wend, move next, those are after the close because you should be doing a while rs not EOF or BOF.<BR><BR>Concurrent users? The debate rages on. I&#039;ve heard that concurrent users can be as low as 14-16 or as high as one hundred. If your site gets a LOT of activity you&#039;ll know when it&#039;s time to change to SQL or some other db.

Posting Permissions

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