I am writing a small ASP.NET application in a hosted environment (this means that I do not own the server).
Using the webtools of the hosting provider, I created a DSN that defines the driver, server, UID, PWD, and database. When I test the connection, it tests fine.
However, when I load my webpage with code:
OdbcConnection DB = new OdbcConnection ("DSN = MyDSNName");
DB.Open ();
I get the error message: ERROR [28000] [Microsoft] [ODBC SQL Server Driver] [SQL Server] Login failed for user.
I know that I am using the correct DSN name because when I go to "DSN = NonExistentDSN" I get another error.
I donβt understand why the login works when I test it, but not when I use it in the code. Since I donβt own the server, some of the usual troubleshooting tools are not available to me, but I will be grateful for any feedback the community has.
source share