Wednesday, March 7, 2012

IIS and DB server on different domain.

Hi,

I have a IIS server on "A" Domain. My application is hosted on on a machine which is under that domain.

I have a DB server, SQL server 2000 on B Domain. The server is a named instance of SQL Server 2000. I have a default SQL Server 7.0 on that same machine.

For the application i am trying to connect from the IIS to database server, but i am unable to connect to the named instance, but i can connect to the default 7.0 instance.

The connection string used for the application is as follows:
oConn.open "Driver={SQL
Server};Server=server_name\instance_name;Database= db_name;uid=user_name;pwd=password;"

I am getting SQL Server does not exists error messege on page...

Please help, me if any one knows how to connect to the database server which is on different domain and is a named instance using the connection string in ASP page..

Please help, this is urgent.

Regards
JayEnsure both the domains are trusted.

And try to connect to the named instance using TCP/IP as default protocol on SQL. Also the user connects from IIS must have necessary privilege to access SQL server/database.

http://www.asp101.com/articles/john/connstring/default.asp - for information.|||Hi Satya,

Can you please elaborate what do you mean by "trust between the domains"

And how do you ensure that i connect to the SQL server through TCP\IP protocol in SQL.

Also what security of necessary privileges needs to be given from IIS to the SQL Server/database.

Originally posted by Satya
Ensure both the domains are trusted.

And try to connect to the named instance using TCP/IP as default protocol on SQL. Also the user connects from IIS must have necessary privilege to access SQL server/database.

http://www.asp101.com/articles/john/connstring/default.asp - for information.|||If the both servers (IIS & SQL) are in different domains then ensure the trust between domains is enabled. Like you can check by mapping a drive on IIS server from SQL server, if not take help of Network Admin for more details.

ON the SQL Server from Server network utility enable TCP/IP protocol and set it as default. As by default it will be used from IIS too.

Refer to this KBA (http://support.microsoft.com/default.aspx?scid=kb;EN-US;176378) &
Winnet Mag (http://www.winnetmag.com/Article/ArticleID/23035/Windows_23035.html) for more details on security
Originally posted by jaybmehta

Can you please elaborate what do you mean by "trust between the domains"

And how do you ensure that i connect to the SQL server through TCP\IP protocol in SQL.

Also what security of necessary privileges needs to be given from IIS to the SQL Server/database.|||Hi Satya,

I have made the domains trusting with the help of Network Admin guys.
Also i have made the protocol to TCP\IP and thats the only protol enabled for that instance, so it will be default. As i was not getting the setting to make it as defualt in Sever Network Utility.

As per you third statement, you have said to give necessary privileges to the IIS user.. Well the connection string is having a SQL Server authentication to the database who idb_owne role ...

ANything else required by me.. let me kwn.

I mean do i need to give any directory level access for the user? to the data folder of the MSSQL .. i will be trying your option today when i reach office.

But if you can do one more favour is, if by chance you can give us the connection string as i have given in my query, it would be great...

Hope ur suggestion works.

Thnks
Jay

Originally posted by Satya
Ensure both the domains are trusted.

And try to connect to the named instance using TCP/IP as default protocol on SQL. Also the user connects from IIS must have necessary privilege to access SQL server/database.

http://www.asp101.com/articles/john/connstring/default.asp - for information.|||Hi Satya.

I tried everything.
Made the domain trusted.
Used the IP address in the connection string.
The strage thing is it is connecting to the default instance on that machine, but it is not able to recognize the named instance on that machine.
Dont knw why is that happening ?
Please let me know if there is some extra settings which needs to be put in connection string for the named instance.
I also made the SQL Server connection protolcol to TCP\IP as u suggested but it is not working.

if you know anything else, and want to know something from me, do reply to the post...

Bye
Jay|||Can u connect to the named instance locally and over the network through Query-Analyzer etc. using the username u specify in ur connection string?|||I've never had to do this before, but would you need to put the domain in the connection string? i.e.

Server=\\domain\server_name\instance_name;Database =
db_name;uid=user_name;pwd=password;"|||Originally posted by AnSQLQuery
I've never had to do this before, but would you need to put the domain in the connection string? i.e.

Server=\\domain\server_name\instance_name;Database =
db_name;uid=user_name;pwd=password;"

can you please verify if the SQL Server instance is using some different port number , instead of default ones.(1433 & 1434)|||CHeck what is the default port configured on Defulat & named instance of SQL and ensure TCP/IP is enabled also.|||Originally posted by Satya
CHeck what is the default port configured on Defulat & named instance of SQL and ensure TCP/IP is enabled also.

Hi All,

The Defualt port configured on that machine for the named instance was 1087 and i changed it to 1434 , as MS SQL 7.0 default instance is listening on port 1433. Once i have changed the port let me know whats the next thing i have to do.
Also i will try to use the domain name in the connection string as suggested.
If it works out great tomorrow in the office, just superb.
Hope it works.
Thnks for all the inputs.

Bye
Jay|||I;m not sure but you may need to refresh SQL Services to take affect of new port settings, may check books online for more information.|||Are the two domains both Windows 2000-2003 Active Directory domains, or is one an NT domain? Are they true Windows 2000+ domain enviroments? It's important to know because the Anonymous user ids are different in the domains. Are you on SQL 7 or 2000?|||Originally posted by TALAT
Can u connect to the named instance locally and over the network through Query-Analyzer etc. using the username u specify in ur connection string?

Hi
I have changed the default port settings and i am able to connect to the named SQL Server on different domain from that server in Query Analyzer.

But when i use the connection string in my ASP application it doesnt connect to the database.

Also the 2 domains are on 2000 OS, none of then is a NT domain.

Both the domains are trusted on one Windows Authentication account.

After changing the SQL server connection protocol to TCP/IP i am getting error messeges as TCP/IP Sockets, General Network Error, Check you Network documentation. Still my application is not able to connect to the named instance on that machine,

But i agian say that there isn one application which is there in the different domian and is successfully connects to the default instance on the machine which is in different domain. The strange thing is it can connect to default instance (SQL 7.0) and not the named instance (SQL 2000).

Regards
Jay

No comments:

Post a Comment