I get this error:
ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Here's my code (C#), I'm running this on a local and on a remote machine:
using (OdbcConnection connection = new OdbcConnection("dsn=mydsn"))
{
connection.ConnectionTimeout = 50000;
OdbcCommand command = new OdbcCommand("select * from users", connection);
command.CommandTimeout = 50000;
connection.Open();
OdbcDataReader reader = command.ExecuteReader();
}
DSN details:
name: mydsn
SQL login: mylogin
database: Test
SQL Server Configuration:
security: sql server and windows authentication mode
Whenever I try to use use the login to Management Studio, everything works fine, I can execute queries.