If you are using windows authentication then the user the WWWserver is authenticating as on the SQL server must be also be a user in the SQL server machine. OK thats confusing.

If logged in user on machine 1(WWW server) is Eric, then there must also be an Eric on MAchine2(SQL Server).

If this is still OK, post the connection string that you are using so we can see if there is a problem there. (You are using ADO?)