SQL server connection string issue :-(
-
This is my conn string :-
server=Earth;database=Test;uid=Nish;pwd=nish123
Nish is a SQL server db user I added for the Test database using Enterprise Manager (today is the first I am seeign this weird app) It says :- Login failed for use Nish; Reason: Not associated with a trusted sql server connection Damnit that sucks. The sql server is running on this same machine (earth) I am usiong System.Data.SqlClient.SqlConnection Nish
Extending MFC Applications with the .NET Framework [NW] (coming soon...) Summer Love and Some more Cricket [NW] (My first novel) Shog's review of SLASMC [NW] This post was made from Trivandrum city, India on a 0.0001 KB/s net connection
-
This is my conn string :-
server=Earth;database=Test;uid=Nish;pwd=nish123
Nish is a SQL server db user I added for the Test database using Enterprise Manager (today is the first I am seeign this weird app) It says :- Login failed for use Nish; Reason: Not associated with a trusted sql server connection Damnit that sucks. The sql server is running on this same machine (earth) I am usiong System.Data.SqlClient.SqlConnection Nish
Extending MFC Applications with the .NET Framework [NW] (coming soon...) Summer Love and Some more Cricket [NW] (My first novel) Shog's review of SLASMC [NW] This post was made from Trivandrum city, India on a 0.0001 KB/s net connection
Does adding
Integrated Security=false
make a difference? I only ever use Windows Authentication, but according to MSDN Integrated Security -or- Trusted_Connection 'false' When false, User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication. Recognized values are true, false, yes, no, and sspi (strongly recommended), which is equivalent to true. Michael 'Logic, my dear Zoe, merely enables one to be wrong with authority.' - The Doctor: The Wheel in Space -
Does adding
Integrated Security=false
make a difference? I only ever use Windows Authentication, but according to MSDN Integrated Security -or- Trusted_Connection 'false' When false, User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication. Recognized values are true, false, yes, no, and sspi (strongly recommended), which is equivalent to true. Michael 'Logic, my dear Zoe, merely enables one to be wrong with authority.' - The Doctor: The Wheel in SpaceMichael P Butler wrote: Does adding Integrated Security=false make a difference? :( Nope I added it to the conn string - but I get the same error. Nish
Extending MFC Applications with the .NET Framework [NW] (coming soon...) Summer Love and Some more Cricket [NW] (My first novel) Shog's review of SLASMC [NW] This post was made from Trivandrum city, India on a 0.0001 KB/s net connection
-
Michael P Butler wrote: Does adding Integrated Security=false make a difference? :( Nope I added it to the conn string - but I get the same error. Nish
Extending MFC Applications with the .NET Framework [NW] (coming soon...) Summer Love and Some more Cricket [NW] (My first novel) Shog's review of SLASMC [NW] This post was made from Trivandrum city, India on a 0.0001 KB/s net connection
Have you tried this at the command prompt? This solved a similar connection problem on my computer.
osql -E -S (local)\DBNAME -Q "sp_grantlogin 'MACHINENAME\ACCOUNTNAME'" osql -E -S (local)\DBNAME -d Pubs -Q "sp_grantdbaccess 'MACHINENAME\ACCOUNTNAME'" osql -E -S (local)\DBNAME -d Pubs -Q "sp_addrolemember 'db_owner', 'MACHINENAME\ACCOUNTNAME'"
Substitute elements in UPPERCASE with the relevant informantion from your specific case. Note: Contrary to you, I was using Windows Authentication instead of SQL Server Authentication. -
This is my conn string :-
server=Earth;database=Test;uid=Nish;pwd=nish123
Nish is a SQL server db user I added for the Test database using Enterprise Manager (today is the first I am seeign this weird app) It says :- Login failed for use Nish; Reason: Not associated with a trusted sql server connection Damnit that sucks. The sql server is running on this same machine (earth) I am usiong System.Data.SqlClient.SqlConnection Nish
Extending MFC Applications with the .NET Framework [NW] (coming soon...) Summer Love and Some more Cricket [NW] (My first novel) Shog's review of SLASMC [NW] This post was made from Trivandrum city, India on a 0.0001 KB/s net connection
Nish, I apologize in advance if anything I say is stupid. I've never used SQL Server with Windows authentication at all. In Enterprise Manager, go to your server, then Security - Logins. Right-click on the user in question and bring up the properties. Does it look like the user is set up to only use SQL Server authentication? Now, is the Test database set up so that it only accepts trusted Windows-authenticated user connections? Also, is it possible to add the user to the BUILTIN\Administrators group as a troubleshooting step? Thank you. Jeff Varszegi
-
This is my conn string :-
server=Earth;database=Test;uid=Nish;pwd=nish123
Nish is a SQL server db user I added for the Test database using Enterprise Manager (today is the first I am seeign this weird app) It says :- Login failed for use Nish; Reason: Not associated with a trusted sql server connection Damnit that sucks. The sql server is running on this same machine (earth) I am usiong System.Data.SqlClient.SqlConnection Nish
Extending MFC Applications with the .NET Framework [NW] (coming soon...) Summer Love and Some more Cricket [NW] (My first novel) Shog's review of SLASMC [NW] This post was made from Trivandrum city, India on a 0.0001 KB/s net connection
Try this:
Data Source=Earth; Initial Catalog=Test; User ID=Nish; Password=nish123; Integrated Security=false
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----