954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Connecting to SQL Server from outside the domain

Hello guys.

I'm building an application that connects to a SQL Server 2008 database via connection string. The thing is, since the computer loading the app (or the user, in either case) is outside the Active Directory domain, I can't use Windows Authentication to connect to the DB. But when I include the database credentials, it won't let me connect either, telling me that since the computer logging in is from an untrusted domain, access is denied.

The connection string goes like this:

connectionString = "Data Source=" + ServerName + ";Initial Catalog=" + DatabaseName + _
                   ";Integrated Security=SSPI;User ID=" + UserID + ";Password=" + Pwd


Any ideas?

Nichito
Posting Virtuoso
1,602 posts since Mar 2007
Reputation Points: 424
Solved Threads: 57
 

Hello guys.

I'm building an application that connects to a SQL Server 2008 database via connection string. The thing is, since the computer loading the app (or the user, in either case) is outside the Active Directory domain, I can't use Windows Authentication to connect to the DB. But when I include the database credentials, it won't let me connect either, telling me that since the computer logging in is from an untrusted domain, access is denied.

The connection string goes like this:

connectionString = "Data Source=" + ServerName + ";Initial Catalog=" + DatabaseName + _
                   ";Integrated Security=SSPI;User ID=" + UserID + ";Password=" + Pwd

Any ideas?

Let me know for your error description..

Ranap Manalu
Newbie Poster
4 posts since Jun 2010
Reputation Points: 10
Solved Threads: 2
 

The error number is 18452 , and the message, though it is in spanish, says something like Login failed. The login is being made from an untrusted domain and cannot be done with Windows authentication

The thing is, I'm not using Windows authentication to connect. I've already changed SQL's connection settings and configured it to use Mixed login

Nichito
Posting Virtuoso
1,602 posts since Mar 2007
Reputation Points: 424
Solved Threads: 57
 

Problem solved. Stupid me. Checked the connection string property and i didn't put the ';' between password and Trusted_Connection ... so the connectionString was like this: ...;User ID=User;Password=PasswordTrusted_Connection=True

*facepalm*

Nichito
Posting Virtuoso
1,602 posts since Mar 2007
Reputation Points: 424
Solved Threads: 57
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: