Following are reasons of the Login failed for user 'Test':
1. If you receive the following error
Cannot connect to DHW01
Login failed for user 'Test'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)
This is because the Server authentication property is set to "Windows Authentication mode" (SQL2005) or "Windows only" (SQL2000). Change the server authentication property to "SQL Server and Windows Authentication mode" (SQL2005) or "SQL Server and Windows" (SQL2000) will fix the issue. The option is located under Security of the server property.