Developers community number 1 connection string reference

Windows Authentication Connection String with SQL Server 2008 R2 ???

Posted 2011-02-18 21:11
by Linning Hu
in the SQL Server Forum
Hi all,
I am trying to figure out how to create my connection string so that I can use current logged on account for authentication with my remote SQL server.

Currently I can connect to my SQL server remotely using TCP protocol.

My SQL server authenthication's connection string is:

Data Source=P200-DEV-PCSIM\MySQLServer;Initial Catalog=Machine_MA;Persist Security Info=True;User ID=sa1;Password=sa1;Connect Timeout=0

and my connection string for Windows Authentication is:

Data Source=P200-DEV-PCSIM\MySQLServer;Initial Catalog=Machine_MA;Integrated Security=True; Connect Timeout=0; Trusted_Connection=Yes

but it does not work. it always returns an error message
as shown below:

Login failed for user 'P200-DEV-PCSIM\Guest'

Why does not it use my current logged on account but Guest account?

Thanks for any help
Reply 2011-04-13 11:23
by Robert Bang
in the SQL Server Forum
Hi Linning, have you got a solution for this? I'm struggling with the same thing... Thanks. :)
Reply 2012-01-06 12:29
by Kandipilli Apparao
in the SQL Server Forum
Hi I am Appu.
Use Instance name in the Connection String.
The below Connection string may be helpful to u.
Copyright © 2012 ConnectionStrings.com   |   All Rights Reserved   |   Powered by CSAS   |   Send feedback, articles, requests and more connection strings here.