Monday, February 20, 2012

Problem connecting to SQL Server 2000

Hi,
I installed SQL Server 2005 Express on one of my development machine, I had
since then having problem connecting to a SQL Server 2000 (On a cluster)
database. The problem persist even after I remove SQL Sever 2005 Express.
The following is the error message:
SAC.EDS.CorpAction.WithholdingTax.UnitTesting.WithholdingTaxOverrideRecordCr
eate :
System.Data.SqlClient.SqlException :
An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005,
this failure may be caused by the fact that under the default settings SQL
Server does not allow remote connections.
(provider: SQL Network Interfaces, error: 26 - Error Locating
Server/Instance Specified)
I do not experience the same problem when connecting from a machine without
SQL Sever 2005 Express installed. I don't know why ADO.NET 2.0 thinks I am
trying to connect to a SQL Server 2005 database.
Please advice!
Thanks,
John YungSome questions: Is the "developement machine" the same computer as the "SQL
Server 2000 (On a cluster)"? I know that's not likely but if so, your
problem may be related to SQL Server Browser.
Also regarding SQL Server Browser service, is the cluster a named instance
and what service pack is the SQL Server 2000 running?
--
Rick Byham
MCDBA, MCSE, MCSA
Lead Technical Writer,
Microsoft, SQL Server Books Online
This posting is provided "as is" with
no warranties, and confers no rights.
"John Yung" <johny@.sac.com> wrote in message
news:OtwVPId9FHA.2176@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I installed SQL Server 2005 Express on one of my development machine, I
> had
> since then having problem connecting to a SQL Server 2000 (On a cluster)
> database. The problem persist even after I remove SQL Sever 2005 Express.
> The following is the error message:
> SAC.EDS.CorpAction.WithholdingTax.UnitTesting.WithholdingTaxOverrideRecord
Cr
> eate :
> System.Data.SqlClient.SqlException :
> An error has occurred while establishing a connection to the server.
> When connecting to SQL Server 2005,
> this failure may be caused by the fact that under the default settings SQL
> Server does not allow remote connections.
> (provider: SQL Network Interfaces, error: 26 - Error Locating
> Server/Instance Specified)
> I do not experience the same problem when connecting from a machine
> without
> SQL Sever 2005 Express installed. I don't know why ADO.NET 2.0 thinks I am
> trying to connect to a SQL Server 2005 database.
> Please advice!
> Thanks,
> John Yung
>|||Rick,
The SQL Server 2000 is not on the development machine. According to our DBA,
SQL Server 2000 is running SP4. Further more, it is not a cluster (my
mistake), but an instance of SQL Server running on a single database
machine.
Thanks,
John Yung
"Rick Byham [MS]" <rickbyh@.online.microsoft.com> wrote in message
news:egE7pfd9FHA.444@.TK2MSFTNGP11.phx.gbl...
> Some questions: Is the "developement machine" the same computer as the
"SQL
> Server 2000 (On a cluster)"? I know that's not likely but if so, your
> problem may be related to SQL Server Browser.
> Also regarding SQL Server Browser service, is the cluster a named instance
> and what service pack is the SQL Server 2000 running?
> --
> Rick Byham
> MCDBA, MCSE, MCSA
> Lead Technical Writer,
> Microsoft, SQL Server Books Online
> This posting is provided "as is" with
> no warranties, and confers no rights.
> "John Yung" <johny@.sac.com> wrote in message
> news:OtwVPId9FHA.2176@.TK2MSFTNGP14.phx.gbl...
Express.
SAC.EDS.CorpAction.WithholdingTax.UnitTesting. WithholdingTaxOverrideRecordCr[color=dar
kred]
SQL
am
>|||I suspect your problem is related to either the configuration of the client
software on the formerly SQL Express computer, or the SQL Server Browser
Service on the server computer.
Installing SQL Server 2005 Express edition installed the SQL Native Client.
I don't know if your uninstall of Express also uninstalled the Microsoft SQL
Server Native Client. You can check that from Control Panel/Add and Remove
Programs, as it is listed separately. If the SQL Server Native Client was
removed, then you should go back to connecting from the SQL Server 2000
client software, but perhaps the install of Express somehow disabled that.
If SQL Server Native Client is not present, try reinstalling the client
software from the SQL Server 2000 CD.
If the SQL Server Native Client is still installed, which seems likely from
your error message, and if the SQL Server Browser service is not running on
the Server, the client may be having trouble resolving the instance name. Is
the SQL Server a named instance or the default instance? If it is the
default instance, then the Native Client will attempt to connect to the
machine name and port 1433. If the server is a named instance, and if the
SQL Server Browser Service is not running (as I suspect), then the SQL
Server Native Client has no way of figuring out what port to connect to. SQL
Server 2000 made different assumptions and so may be coordinating better
with SQL Server 2000.
So my advice, is first, make sure you have a client. Either SQL Server
Native Client, or reinstall the SQL Server 2000 software.
Second, see if the SQL Server Browser Service (SQLBROWSER) is present on the
server. If so, try starting the service, and then connecting.
If the SQL Server Browser Service is not present, and if the SQL Server 2000
is a named instance, you will need to connect using the port number, as in
computername,1500
--
Rick Byham
MCDBA, MCSE, MCSA
Lead Technical Writer,
Microsoft, SQL Server Books Online
This posting is provided "as is" with
no warranties, and confers no rights.
"John Yung" <johny@.sac.com> wrote in message
news:uqVO%23yd9FHA.4004@.TK2MSFTNGP14.phx.gbl...
> Rick,
> The SQL Server 2000 is not on the development machine. According to our
> DBA,
> SQL Server 2000 is running SP4. Further more, it is not a cluster (my
> mistake), but an instance of SQL Server running on a single database
> machine.
> Thanks,
> John Yung
> "Rick Byham [MS]" <rickbyh@.online.microsoft.com> wrote in message
> news:egE7pfd9FHA.444@.TK2MSFTNGP11.phx.gbl...
> "SQL
> Express.
> SAC.EDS.CorpAction.WithholdingTax.UnitTesting.WithholdingTaxOverrideRecord
Cr
> SQL
> am
>|||Rick,
I tried all your suggestions, but they don't work; for example: I use this
as connection string:
Data Source=QA1SQL02, 1500;Initial Catalog=saccorpaction;User
Id=sacweb;Password=websac1
note: QA1SQL02 is the database server name,
I got this error message:
An error has occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections.
(provider: TCP Provider, error: 0 - No connection could be made because the
target machine actively refused it.)
I am able to confirm that the problem is cause by ADO.NET 2.0, and not SQL
Server 2005 Express. I tried the software on a fresh machine with .NET 2.0
installed, i received the same error messages.
I don't understand why ADO.NET thinks I am trying to connect to SQL Server
2005 (unless the error message is hard-coded to 2005).
Please advice, thanks,
John Yung
"Rick Byham [MS]" <rickbyh@.online.microsoft.com> wrote in message
news:e5P2gep9FHA.3724@.TK2MSFTNGP10.phx.gbl...
> I suspect your problem is related to either the configuration of the
client
> software on the formerly SQL Express computer, or the SQL Server Browser
> Service on the server computer.
> Installing SQL Server 2005 Express edition installed the SQL Native
Client.
> I don't know if your uninstall of Express also uninstalled the Microsoft
SQL
> Server Native Client. You can check that from Control Panel/Add and Remove
> Programs, as it is listed separately. If the SQL Server Native Client was
> removed, then you should go back to connecting from the SQL Server 2000
> client software, but perhaps the install of Express somehow disabled that.
> If SQL Server Native Client is not present, try reinstalling the client
> software from the SQL Server 2000 CD.
> If the SQL Server Native Client is still installed, which seems likely
from
> your error message, and if the SQL Server Browser service is not running
on
> the Server, the client may be having trouble resolving the instance name.
Is
> the SQL Server a named instance or the default instance? If it is the
> default instance, then the Native Client will attempt to connect to the
> machine name and port 1433. If the server is a named instance, and if the
> SQL Server Browser Service is not running (as I suspect), then the SQL
> Server Native Client has no way of figuring out what port to connect to.
SQL
> Server 2000 made different assumptions and so may be coordinating better
> with SQL Server 2000.
> So my advice, is first, make sure you have a client. Either SQL Server
> Native Client, or reinstall the SQL Server 2000 software.
> Second, see if the SQL Server Browser Service (SQLBROWSER) is present on
the
> server. If so, try starting the service, and then connecting.
> If the SQL Server Browser Service is not present, and if the SQL Server
2000
> is a named instance, you will need to connect using the port number, as in
> computername,1500
> --
> Rick Byham
> MCDBA, MCSE, MCSA
> Lead Technical Writer,
> Microsoft, SQL Server Books Online
> This posting is provided "as is" with
> no warranties, and confers no rights.
> "John Yung" <johny@.sac.com> wrote in message
> news:uqVO%23yd9FHA.4004@.TK2MSFTNGP14.phx.gbl...
I
SAC.EDS.CorpAction.WithholdingTax.UnitTesting. WithholdingTaxOverrideRecordCr[color=dar
kred]
settings
I
>|||Rick,
I compile (VS.NET 2003) the same code in .NET 1.1 and it works:
This is the connection string I used:
Data Source=QA1SQL02\DEVSQL03;Initial Catalog=saccorpaction;User
Id=abc;Password=abc
I am very sure that the problem is from ADO.NET 2.0.
Thanks,
John Yung
"John Yung" <johny@.sac.com> wrote in message
news:Og6t59q%23FHA.984@.tk2msftngp13.phx.gbl...
> Rick,
> I tried all your suggestions, but they don't work; for example: I use this
> as connection string:
> Data Source=QA1SQL02, 1500;Initial Catalog=saccorpaction;User
> Id=sacweb;Password=websac1
> note: QA1SQL02 is the database server name,
> I got this error message:
> An error has occurred while establishing a connection to the server. When
> connecting to SQL Server 2005, this failure may be caused by the fact that
> under the default settings SQL Server does not allow remote connections.
> (provider: TCP Provider, error: 0 - No connection could be made because
the
> target machine actively refused it.)
> I am able to confirm that the problem is cause by ADO.NET 2.0, and not SQL
> Server 2005 Express. I tried the software on a fresh machine with .NET 2.0
> installed, i received the same error messages.
> I don't understand why ADO.NET thinks I am trying to connect to SQL Server
> 2005 (unless the error message is hard-coded to 2005).
> Please advice, thanks,
> John Yung
>
> "Rick Byham [MS]" <rickbyh@.online.microsoft.com> wrote in message
> news:e5P2gep9FHA.3724@.TK2MSFTNGP10.phx.gbl...
> client
> Client.
> SQL
Remove
was
that.
> from
> on
name.
> Is
the
> SQL
> the
> 2000
in
our
the
machine,
> I
>
SAC.EDS.CorpAction.WithholdingTax.UnitTesting. WithholdingTaxOverrideRecordCrkred">
server.
> settings
thinks
> I
>|||Sorry, I'm a DBA, not a programmer. I'm pretty useless when it comes to
.NET.
--
Rick Byham
MCDBA, MCSE, MCSA
Lead Technical Writer,
Microsoft, SQL Server Books Online
This posting is provided "as is" with
no warranties, and confers no rights.
"John Yung" <johny@.sac.com> wrote in message
news:uGpS7br%23FHA.1032@.TK2MSFTNGP09.phx.gbl...
> Rick,
> I compile (VS.NET 2003) the same code in .NET 1.1 and it works:
> This is the connection string I used:
> Data Source=QA1SQL02\DEVSQL03;Initial Catalog=saccorpaction;User
> Id=abc;Password=abc
> I am very sure that the problem is from ADO.NET 2.0.
> Thanks,
> John Yung
>
> "John Yung" <johny@.sac.com> wrote in message
> news:Og6t59q%23FHA.984@.tk2msftngp13.phx.gbl...
> the
> Remove
> was
> that.
> name.
> the
> in
> our
> the
> machine,
> SAC.EDS.CorpAction.WithholdingTax.UnitTesting.WithholdingTaxOverrideRecord
Cr
> server.
> thinks
>|||Rick,
Do you know anyone from the ADO.NET group that could help me with this?
Thanks,
John Yung
"Rick Byham [MS]" <rickbyh@.online.microsoft.com> wrote in message
news:eqzdB30%23FHA.1028@.TK2MSFTNGP11.phx.gbl...
> Sorry, I'm a DBA, not a programmer. I'm pretty useless when it comes to
> .NET.
> --
> Rick Byham
> MCDBA, MCSE, MCSA
> Lead Technical Writer,
> Microsoft, SQL Server Books Online
> This posting is provided "as is" with
> no warranties, and confers no rights.
> "John Yung" <johny@.sac.com> wrote in message
> news:uGpS7br%23FHA.1032@.TK2MSFTNGP09.phx.gbl...
connections.
2000
client
likely
the
SQL
Server
Server
as
(my
database
SAC.EDS.CorpAction.WithholdingTax.UnitTesting. WithholdingTaxOverrideRecordCr[color=dar
kred]
>|||I am having this exact same problem. Have you found a solution?
Thanks,
Randy
"John Yung" wrote:

> Rick,
> I compile (VS.NET 2003) the same code in .NET 1.1 and it works:
> This is the connection string I used:
> Data Source=QA1SQL02\DEVSQL03;Initial Catalog=saccorpaction;User
> Id=abc;Password=abc
> I am very sure that the problem is from ADO.NET 2.0.
> Thanks,
> John Yung
>
> "John Yung" <johny@.sac.com> wrote in message
> news:Og6t59q%23FHA.984@.tk2msftngp13.phx.gbl...
> the
> Remove
> was
> that.
> name.
> the
> in
> our
> the
> machine,
> SAC.EDS.CorpAction.WithholdingTax.UnitTesting.WithholdingTaxOverrideRecord
Cr
> server.
> thinks
>
>|||There is a slight difference in the way ADO.NET 1.1 and 2.0 handle protocol
order that might be the issue here.
It's likely that the computer where SQL Server is running has Windows
Firewall enabled, and that the SQL Server TCP port (1433 by default,
variable if using a named instance such as SQLExpress) is blocked. It's also
likely that 1.1 is working because it's using named pipes instead of TCP,
which gets through the same channel as file-sharing which is typically open.
If this is the case in your scenario, you can do one of these:
a) force named pipes. you can do this by adding "np:" before the server
name. In your connection string it would be "Data Source=np:QA1SQL02"
b) open the SQL Server port in the firewall of the computer where SQL Server
is running
Regarding your question about SQL 2000 vs 2005, note that ADO.NET is not
, it's the error message that isn't clear; we meant that if this
*were* SQL Server 2005, then you may want to check out the connection
setting.
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.
This posting is provided "AS IS" with no warranties, and confers no rights.
"randyh@.newsgroups.nospam"
<randyhnewsgroupsnospam@.discussions.microsoft.com> wrote in message
news:6B79EE56-D70C-4AF0-86A5-18DDBDB8D4E5@.microsoft.com...
>I am having this exact same problem. Have you found a solution?
> Thanks,
> Randy
> "John Yung" wrote:
>

No comments:

Post a Comment