4060 "Server rejected the connection; Access to selected database has been denied".
How can I troubleshoot this error?
This error also occurs if the Database not exists
so make sure that there is a database with the name you provided in Catalog=MyDB
Do you have permission to access the database using the credentials that you are supplying? What provider are you trying to use? TCP/IP, Named Pipes? Has that provider been enabled? Is there a firewall in place and have you opened up the port to the client? Does this happen intermittently? If so, do you have enough licenses available when the error occurs? You might want to check the server error logs (and your client event log, too) for more information.
User credentials are ok, but user doesn't have the right to connect to the given database, you should grant him all rights needed...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With