Sunday, March 25, 2012

connecting to sql remote database

i am trying to connect to sql server in a remote database by using windows
authentication. I tried to connect using php and cgi. The apache service
under which i am running my cgi or php is under localsystem account. If i
change it to administrator account, i am able to connect to remote sql serve
r
using windows authentication. But due to some limitations i want the apache
server/service to be run only on localsystem account, but to connect to
remote sql database using windows authentication. ( I dont want to use mixed
mode in SQL)Is it possible to connect using cgo or php?If it is possible wha
t
is the connection string to be used? Or is SQLAuthenticatin compulsary be
used in connectng to remote sql server?.
the connection string that i am using are given below:
"Provider=sqloledb;Network Library=DBMSSOCN;Data Source=PMP3,1433;Initial
Catalog=PMP_V3_0;Integrated Security=SSPI";
strConnection = _T("Driver={SQL Server};Server=MyServerName;"
"Trusted_Connection=yes;"
"Database=MyDatabaseName;");You can connect to a remote SQL Server using Windows Authentication, except
when your Apache service uses the LocalSystem account. The LocalSystem
account can not connect to any resources that are on other computers. The
best solution would be to create a network account with the necessary
permissions, and run the Apache service using that account. Then you can use
Windows Authentication only.
Jacco Schalkwijk
SQL Server MVP
"uday" <uday@.discussions.microsoft.com> wrote in message
news:1C3054A7-5B6F-4510-91DF-80EB5BC5873D@.microsoft.com...
>i am trying to connect to sql server in a remote database by using windows
> authentication. I tried to connect using php and cgi. The apache service
> under which i am running my cgi or php is under localsystem account. If i
> change it to administrator account, i am able to connect to remote sql
> server
> using windows authentication. But due to some limitations i want the
> apache
> server/service to be run only on localsystem account, but to connect to
> remote sql database using windows authentication. ( I dont want to use
> mixed
> mode in SQL)Is it possible to connect using cgo or php?If it is possible
> what
> is the connection string to be used? Or is SQLAuthenticatin compulsary be
> used in connectng to remote sql server?.
> the connection string that i am using are given below:
> "Provider=sqloledb;Network Library=DBMSSOCN;Data Source=PMP3,1433;Initial
> Catalog=PMP_V3_0;Integrated Security=SSPI";
> strConnection = _T("Driver={SQL Server};Server=MyServerName;"
> "Trusted_Connection=yes;"
> "Database=MyDatabaseName;");
>
>
>

No comments:

Post a Comment