locked
Check if .mdb-File is locked RRS feed

  • Question

  • User-1947530862 posted

    Hi,

    does anybody know how to check with vb in asp.net if a MDB is locked?

    thx in advance...

    Thursday, May 20, 2010 7:06 AM

Answers

  • User-1199946673 posted

    If a connection to the mdb is not possible (i.e. too many users...)
     

    How many users are you thinking about? Note that in a web environment, it's good practice to open a connection as late as possible, and close it as soon as possible. In practice this ussually means that when a user is visiting a webpage, a connection is only opened for a fraction of a second and then closed again. So even if you have hundreds of users visiting your website at the same time, only a few connections are simultanously openend, because they don't request a webpage at exactly the same time!

    And off course, when you're realy dealing with many requests at more or less the same time, you should consider to upgrading to SQL Server (Express)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 20, 2010 11:21 AM

All replies

  • User-1199946673 posted

    does anybody know how to check with vb in asp.net if a MDB is locked?
     

    First you need to clarify what exactly you mean with locked? Once you connect to a mdb file and open the connection, a ldb file with the same name as the mdb file is created in the same folder. So that way you'll know that another user is doing something in the database. However this doesn't mean that you cannot make another connectiong to the same mdb file.

    Also note that when you do not close the connection properly, the ldb file will not be deleted!

    Thursday, May 20, 2010 10:40 AM
  • User-1947530862 posted

    My intention is to make a kind of load balancing. If a connection to the mdb is not possible (i.e. too many users...) then I want to randomly use a copy of the database.

    Thursday, May 20, 2010 11:00 AM
  • User-1199946673 posted

    If a connection to the mdb is not possible (i.e. too many users...)
     

    How many users are you thinking about? Note that in a web environment, it's good practice to open a connection as late as possible, and close it as soon as possible. In practice this ussually means that when a user is visiting a webpage, a connection is only opened for a fraction of a second and then closed again. So even if you have hundreds of users visiting your website at the same time, only a few connections are simultanously openend, because they don't request a webpage at exactly the same time!

    And off course, when you're realy dealing with many requests at more or less the same time, you should consider to upgrading to SQL Server (Express)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 20, 2010 11:21 AM