I get this error when I try to connect to a remote SQL server using this connection string.
Error:
ODBC error: 28000118452[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ''. The user is not associated with a trusted SQL Server connection.
Connection string:
"DRIVER={SQL Server};SERVER=testserver,1433;Trusted_Connection={Yes};"
Note this same connection string works fine if I specify the local computer.
My question: Why does the remote SQL server think my username is blank ''?
I did a valid login using the WNetAddConnection Win32 API to the remote machine first.
Edit: I get the same error when connecting from Management studio. But I thought my program would have a higher chance of working since I established a connection to the remote machine first.
Edit2: Note I really need a solution that uses Windows authentication. I already have it working with SQL authentication.