in reply to Data base connection error
A few things spring to mind. If this is a remote database, is your web server running as a user that can access the network (LocalSystem cannot) and the Database (it isn't, I imagine, running as the same user as your initial script).