Error Too many client tasks - ASP Errors
DescriptionCurrent Microsoft Access database exceeded the number of maximum available connections at the same time.
Error Too many client tasks
The Microsoft Access database was created as a desktop database, not as a web oriented database, so it does not offer the same functionalities and above all the same performance of database stricly aimed to the interaction with server side languages, such as ASP and PHP.
This does not mean that Access needs to be discarded, but on the contrary, it carries out its task in an excellent manner, for medium and small sites, but it requires much more care and attention in respect to some of its big brothers such as MySQL and MS SQL Server.
The error above signals that Access has reached the limit for contemporary connections of the scripts on the database, which are, depending on the driver version from 20 to 40 contemporary, and that so is not able to host more, until some of the unused ones are discarded.
How to Fix the Error
The above-mentioned error is not always connected to the database but more often than not, to an ill written and little optimised code.
First you need to check whether all pointless connections have been closed and free all resources as soon as they are no longer needed, by using
For instance, if
connectionname is the active connection it is possible to close it with the command
It is also important to destroy objects in order to free resources on the server, assigning object value to
Nothing, for example
Set connectionname = Nothing .
These simple rules can help you to avoid the error and develop a more flowing, fast and reliable code.
For this purpose, it is fundamental to open the connection to the database only if and when it is necessary, to keep it open the least amount of time possible.
Finally, make good use of the functions that ASP puts at your disposal, to save in cache values closing as soon as possible the connections and exploit the array potentials.
You will see that Access as well can be flexible enough.