Database=XXX.mdf
Is your database actually called XXX.mdf
? I suspect it isn't, since that looks like a file name, and is perhaps just called XXX
instead. The login will fail if the database isn't correct, since the server isn't going to give information about the failure to an unauthenticated user. Try:
Database=XXX