473,385 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Connect to SQLServer 2005 on different server

I have to connect to two SQLServers in my script. One server is local, the
other is remote.

I am using ODBC for the local connection:
pasConnStr = "Driver={SQL Server};" & _
"Server=(local);" & _
"DataBase=PAS"

And I have tried various connections to the remote server, this one happens
to be oledb:
crmConnStr = "Provider=sqloledb;" & _
"Data Source=CRM;" & _
"Initial Catalog=ULGT_MSCRM" & _
"User ID=CRM\IUSR_CRM;" & _
"Password="
The first server name is 'SQL1', and the second server name is 'CRM'. So, I
can connect just fine to the local server running on SQL1, but I cannot
connect to CRM. I have tried everything I can think of, including adding the
anonymous IIS login, as my connection string shows above.

The current connection string returns the wonderful error:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'CRM\IUSR_CRM'

So, I am at a loss. The remote server does not have a static IP, at this
time anyway.
Mar 28 '06 #1
4 4349
BenM wrote:
I have to connect to two SQLServers in my script. One server is
local, the other is remote.

I am using ODBC for the local connection:
pasConnStr = "Driver={SQL Server};" & _
"Server=(local);" & _
"DataBase=PAS"
http://www.aspfaq.com/show.asp?id=2126

And I have tried various connections to the remote server, this one
happens to be oledb:
crmConnStr = "Provider=sqloledb;" & _
"Data Source=CRM;" & _
"Initial Catalog=ULGT_MSCRM" & _
"User ID=CRM\IUSR_CRM;" & _
"Password="


The first server name is 'SQL1', and the second server name is 'CRM'.
So, I can connect just fine to the local server running on SQL1, but
I cannot connect to CRM. I have tried everything I can think of,
including adding the anonymous IIS login, as my connection string
shows above.

The current connection string returns the wonderful error:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'CRM\IUSR_CRM'
Assuming you've simply censored the password, it appears that your second
server is not set up for "mixed" security.
See http://www.aspfaq.com/show.asp?id=2138, which links to
http://support.microsoft.com/kb/176380/EN-US/

So, I am at a loss. The remote server does not have a static IP, at
this time anyway.


Nothing to do with the IP. The server is being found: it's the login attempt
that is failing.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Mar 29 '06 #2
I appreciate your response up to this point.

Upon your advice, I changed my initial ODBC connection to OLEDB. I also
read the links and changed my code to the following for the 2nd connection
string:

crmConnStr = "Provider=sqloledb;" & _
"Data Source=CRM;" & _
"Initial Catalog=ULGT_MSCRM;" & _
"Integrated Security=SSPI"

The SQL Server was already in mixed authentication mode. I have the
IUSR_CRM setup on the CRM server and the Database. Now I get the following
error:

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

Thanks in advance!
Mar 29 '06 #3
BenM wrote:
I appreciate your response up to this point.

Upon your advice, I changed my initial ODBC connection to OLEDB. I
also read the links and changed my code to the following for the 2nd
connection string:

crmConnStr = "Provider=sqloledb;" & _
"Data Source=CRM;" & _
"Initial Catalog=ULGT_MSCRM;" & _
"Integrated Security=SSPI"

The SQL Server was already in mixed authentication mode. I have the
IUSR_CRM setup on the CRM server and the Database. Now I get the
following error:

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

Did you follow the link in http://support.microsoft.com/kb/176380/EN-US/ to
this article? http://support.microsoft.com/kb/176379/en-us
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 29 '06 #4
Since this is on a remote server, I found that the IUSR_machineName would not
work.

I created a basic login on the SQL Server itself, and now I can connect fine.
Mar 29 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Daniel Bass | last post by:
I setup a asp.net project running on http://localhost/ which connects to a database on another server running sqlserver... I was able to connect to the database and create my application no...
1
by: jhcorey | last post by:
We recently had to repair our SQLServer and a new C drive was put in and SQLServer 2000 sp3 re-installed. The data files were on another drive and I attached them. Now I can do everything...
2
by: saroxonline76 | last post by:
Dear all, I installed Visual Basic 2005 Express and SqlServer Express. I tried some features of both of them but I'm not able to connect a databse through a network. To explain, I have two...
1
by: podx | last post by:
I am trying to connect to SQL 7.0 northwind database via visual studio 2005. But I can't open the connection. I get an error saying remote access is not allowed. But the remote access is ok. I can...
9
by: Gabriel | last post by:
Hello, I installed SQL server 2005 SP1 on a Windows XP SP2 From Visual Studio, I'm trygin to create a connection to a database, but I receive this error but I'm creating the connection (I...
0
by: Neff | last post by:
I have a clustered installation of SQL Server 2005 with SSIS installed on the cluster. I'm running SQL Server Management Server on one of the cluster nodes and trying to connect to the...
9
by: Peter Lux | last post by:
I'm fairly new to c#, but not new to programming. I'm tasked with rewriting our Gupta/Sqlwindows apps (5 years worth of development) in dot Net. The main reason is that virtually no one knows the...
3
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
Last week I asked a question about connection to database from client machine (developer machine). I have changed the database security setup for "SQL Server and Windows" under (local)Windows NT...
6
by: SRK | last post by:
Hi, I have installed free TDS ODBC driver on Linux and from there I am trying to connect to MS SQLSERVER installed on Windows machine. But it gives me following error - tsql -H ps6312 -p 1433...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.