SQL Server refuses to connect from time to time I get this error like 5 times a day. It does not happen always and we cannot really reproduce it.
So is there any common knowledge as to why SQL Server sometimes refuses to connect and sometimes allows it?
Error #1070 is our own error code.

SQLState 42000  
Error Code 4060   


...and ...

SQLState 28000
Error Code 18456


...are pretty much standard error codes that do not help to solve this mystery.

I use PHP and AdoDB as a framework.
Here is a Link that adresses this issue, but i do not see that this will solve the &quot;from time to time&quot; aspect.
https://support.microsoft.com/de-de/help/2121736/error-message-when-you-try-to-authenticate-an-odbc-connection-to-your
There are several possible issues, check one by one:


Do you have permission to access the database using the credentials that you are supplying? Maybe user don't have the necessary permissions to access the server
User credentials are ok, but user doesn't have the right to connect to the given database, you should grant him all rights needed
And last but not least, maybe there isn't a database which correspond to the information you specified, check that the database you are trying to connect exists


If everything fails, check server error logs and client event log too to get some more information.