The error is more related to code than connecting to a database. If you don't think it's connecting to your database, you would see errors for permissions. You can enable auditing in the local security policy, audit failures and see if there is an error in the security event log. Also, Process monitor from sysinternals can help detect issues related to folder / file security.
Steve Schofield
Windows Server MVP - IIS
http://weblogs.asp.net/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget