Showing posts with label named. Show all posts
Showing posts with label named. Show all posts

Tuesday, March 27, 2012

Connecting to sql server 2000 on Godaddy error: (provider: Named Pipes Provider, error: 40

Facts:

1. I am using my account on Godaddy trying to connect to my sql server db.

2. I can get into my db using user id and password.

3. Godaddy's help file shows this for a connection string:

connectstr = "Driver={SQL Server};SERVER=" & db_server & ";DATABASE=" &
db_name & ";UID=" & db_username & ";PWD=" & db_userpassword

4. My connection string: "Server=whsql-v09.prod.mesa1.secureserver.net;uid=dbasolutions;pwd=***;database=DB_87972;" & _
"Trusted_Connection=False providerName=System.Data.SqlClient"

{password **** out}

5. Get 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I tried to email Godaddy's help desk with this information.

There first response: We do not allow remote connections to our sql server database.

There second response was to read the help file!

Does anybody have any suggestions?

Thanks in advance,

bswanson

Finally, I did get a tech support who would give me an ear. He got this script from his tech support to test my connection:

mssqltest.aspx

<%@. Import Namespace="System.Data.SqlClient" %>
<%
Dim oSQLConn As SqlConnection = New SqlConnection()
oSQLConn.ConnectionString ="Server=whsql-v09.prod.mesa1.secureserver.net;uid=dbasolutions;pwd=*****;database=DB_87972;"
try
oSQLConn.Open()
catch dag as exception
response.write(dag.message)
End try
Response.write("Connection Open!")
%>

Now we know we are connecting to sql server!

The next issue I realized that I was facing is that the code on the server was not recompiling. It was on the 1.1 framework running on asp.net 2.0.

The code was upgraded to asp.net 2.0 and uploaded again. Still it bombed. In an effort to get it working the debugger was turned on.

The next problem turned out to be in the <compilers> . The compiler option is not allowed. After deleting this code:

compilerOptions="/define:Debug=True /define:Trace=True /imports:Microsoft.VisualBasic,System,System.Collections,System.Configuration,System.Data,System.Drawing,System.Web,System.Web.UI,System.Web.UI.HtmlControls,System.Web.UI.WebControls"

out of the compilers, it worked!

On my local machines, I have not had trouble with recompiling. But on Godaddy, it did not recompile.

Hope this can help someone. I am open to suggestions.

Thanks,

Bswanson

Connecting to SQL Server 2000 Named Instances

We are having all kinds of issues with named instances for SQL 2000.

I am trying to connect to a SQL Server 2000 named instance on a different subnet and get an error. I cannot connect with ODBC or our web app.

I am using the port number for the alias that I created in the SQL Client Utility. We can connect to default instances without a problem, but not the named instances.

The SQL Server is 2000 build 2040 (Service pack 4 with a hot fix.) The server is listening on port 1223. In the ODBC connection I click on the Network Config and create an alias with the named instance such as SQLVSN\SQLNI and specify port 1223. I have also tried adding the port to the connection string in the ASP include file (SQLVSN\SQLNI,1223). If I do the same thing with a default instance on the network, both the app and ODBC work fine. It is only when I use a named instance.

Very frustrated. Thanks for any help you can provideIt shouldn't be much different. Here is a connection string in ASP which I use for our internal webpage.


Set objConn = Server.CreateObject("ADODB.Connection")
Set objrs = Server.CreateObject("ADODB.Recordset")

objConn.Open "Driver={SQL Server};" & _
"Server=SERVERNAME\INSTANCENAME;" & _
"Database=DATABASENAME;" & _
"Network=NETWORKNAME;" & _
"Uid=USERNAME;" & _
"Pwd=PASSWORD"

str = "SELECT bla bla FROM bla bla WHERE bla bla;"
set objrs=objConn.execute(str)

I know all about security and dynamic SQL queries; this is just a proof of concept|||That's what we have. The app works on one of the servers that are on the same subnet, but not the one on a different subnet.

The one that is on the other subnet can't connect when I try to create an ODBC connection as a test. This goes for all named instances in the company, for which we have quite a few because we have several SQL Server Cluster Groups setup. However, I can create an ODBC connection to a default instance with no problem what so ever.

I have to be overlooking something when it comes to named instances.

Connecting to SQL Server 2000 Named Instances

I have the following problem;

I fully understand that to connect to a named instance of SQL Server you need to use the ServerName\SQLInstanceName. The problem I have is that I have a SQL Server in a different zone. I can connect to the Default instance by IP Address or the ServerName.zone.domain.org. (e.g. MySQLServer.zone1.mydomain.org).

However, the same thing does not work for the Named Instance. It seems to be named instance or nothing.

How can I connect to this named instance across network zones?:Suse the instance name with the ip address, like 1.2.3.4\myInstance and you ought to be fine.

-PatP|||That did it. Thanks!!! :beer:

Thursday, March 22, 2012

Connecting to remote named instance

Hi,
I need some help connecting to a remote named instance of SQL Server 2000
Lets say the server has fqdn: "sqlsrv1.dk.mydomain.com" and is installed as
a named instance with name: "COPENHAGEN"
Trying to connect from another location using
"sqlsrv1.dk.mydomain.com\COPENHAGEN" will fail, but connecting from the
location in question using "sqlsrv1\COPENHAGEN" will succceed.
How do I do this ?
In advance, thanks...
Soren
Soren,
If the servers are on the same domain, you should be able to connect to the
remote server using
sqlsrv1\COPENHAGEN
Benny
P.S. Where in Denmark
"Soren Staun Jorgensen" <no@.spam.com> skrev i en meddelelse
news:O8BBndMOEHA.1456@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I need some help connecting to a remote named instance of SQL Server 2000
> Lets say the server has fqdn: "sqlsrv1.dk.mydomain.com" and is installed
as
> a named instance with name: "COPENHAGEN"
> Trying to connect from another location using
> "sqlsrv1.dk.mydomain.com\COPENHAGEN" will fail, but connecting from the
> location in question using "sqlsrv1\COPENHAGEN" will succceed.
> How do I do this ?
> In advance, thanks...
> Soren
>
>
|||It might be name resolution problem.
Ping sqlsrv1.dk.mydomain.com\COPENHAGEN
and
Ping sqlsrv1
is it returning the same ip address.
And also check your MDAC version.
Regards.

Connecting to remote named instance

Hi,
I need some help connecting to a remote named instance of SQL Server 2000
Lets say the server has fqdn: "sqlsrv1.dk.mydomain.com" and is installed as
a named instance with name: "COPENHAGEN"
Trying to connect from another location using
"sqlsrv1.dk.mydomain.com\COPENHAGEN" will fail, but connecting from the
location in question using "sqlsrv1\COPENHAGEN" will succceed.
How do I do this '
In advance, thanks...
SorenSoren,
If the servers are on the same domain, you should be able to connect to the
remote server using
sqlsrv1\COPENHAGEN
Benny
P.S. Where in Denmark
"Soren Staun Jorgensen" <no@.spam.com> skrev i en meddelelse
news:O8BBndMOEHA.1456@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I need some help connecting to a remote named instance of SQL Server 2000
> Lets say the server has fqdn: "sqlsrv1.dk.mydomain.com" and is installed
as
> a named instance with name: "COPENHAGEN"
> Trying to connect from another location using
> "sqlsrv1.dk.mydomain.com\COPENHAGEN" will fail, but connecting from the
> location in question using "sqlsrv1\COPENHAGEN" will succceed.
> How do I do this '
> In advance, thanks...
> Soren
>
>|||It might be name resolution problem.
Ping sqlsrv1.dk.mydomain.com\COPENHAGEN
and
Ping sqlsrv1
is it returning the same ip address.
And also check your MDAC version.
Regards.

Connecting to remote named instance

Hi,
I need some help connecting to a remote named instance of SQL Server 2000
Lets say the server has fqdn: "sqlsrv1.dk.mydomain.com" and is installed as
a named instance with name: "COPENHAGEN"
Trying to connect from another location using
"sqlsrv1.dk.mydomain.com\COPENHAGEN" will fail, but connecting from the
location in question using "sqlsrv1\COPENHAGEN" will succceed.
How do I do this '
In advance, thanks...
SorenSoren,
If the servers are on the same domain, you should be able to connect to the
remote server using
sqlsrv1\COPENHAGEN
Benny
P.S. Where in Denmark
"Soren Staun Jorgensen" <no@.spam.com> skrev i en meddelelse
news:O8BBndMOEHA.1456@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I need some help connecting to a remote named instance of SQL Server 2000
> Lets say the server has fqdn: "sqlsrv1.dk.mydomain.com" and is installed
as
> a named instance with name: "COPENHAGEN"
> Trying to connect from another location using
> "sqlsrv1.dk.mydomain.com\COPENHAGEN" will fail, but connecting from the
> location in question using "sqlsrv1\COPENHAGEN" will succceed.
> How do I do this '
> In advance, thanks...
> Soren
>
>|||It might be name resolution problem
Ping sqlsrv1.dk.mydomain.com\COPENHAGE
an
Ping sqlsrv1
is it returning the same ip address
And also check your MDAC version.
Regards.sqlsql

Tuesday, March 20, 2012

Connecting to remote Express instance using SSMS

I have a server running SQL Server 2005 Ent. Ed. SP2 and locally, I can see
the default instance and two SQLExpress instances named 'sqlexpress' and
'officeservers', all withing SSMS, and can connect and manage them.
From my workstation, running SQL 2005 Dev, SP2, I can connect to the default
instance on that server, but cannot connect to the express instances. They
both have TCP/IP protocol enabled, along with "Allow Remote COnnections".
I have done the following:
Made myself a member of the local Admin group
Tried using the sa account to connect
nothing seems to work. What am I missing?
TIA
Todd Chittenden
Is the SQLBrowser Service enabled and started?
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Todd C" <ToddC@.discussions.microsoft.com> wrote in message
news:15C51BF6-FF25-435E-B26B-3863344FB81D@.microsoft.com...
>I have a server running SQL Server 2005 Ent. Ed. SP2 and locally, I can see
> the default instance and two SQLExpress instances named 'sqlexpress' and
> 'officeservers', all withing SSMS, and can connect and manage them.
> From my workstation, running SQL 2005 Dev, SP2, I can connect to the
> default
> instance on that server, but cannot connect to the express instances. They
> both have TCP/IP protocol enabled, along with "Allow Remote COnnections".
> I have done the following:
> Made myself a member of the local Admin group
> Tried using the sa account to connect
> nothing seems to work. What am I missing?
> TIA
> --
> Todd Chittenden
>
|||I found it not long after posting the original question:
No, the Browser service was not running. Starting that up enabled me to
connect to it. So that was the answer.
But even before the Enterprise instance was installed, (which includes the
browser service) I was not able to connect. I know I have other machines in
my domain that are running SQL Express. Should I not be able to connect to
them using my SSMS? What do I need to do to make that happen?
I assume that I need membership in the group on the local machine that bears
the SQL Express instance name?
What else? I can't rely on the Browser service in those instances.
Thanks
Todd Chittenden
"Roger Wolter[MSFT]" wrote:

> Is the SQLBrowser Service enabled and started?
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Todd C" <ToddC@.discussions.microsoft.com> wrote in message
> news:15C51BF6-FF25-435E-B26B-3863344FB81D@.microsoft.com...
>
|||SQL Express by default installs as a named instance. Unless you specify the
TCP/IP port in the connection string, you need the sqlbrowser service to
connect to a named instance.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Todd C" <ToddC@.discussions.microsoft.com> wrote in message
news:F4B981A2-4B9A-443E-855B-D53B89FCE511@.microsoft.com...[vbcol=seagreen]
>I found it not long after posting the original question:
> No, the Browser service was not running. Starting that up enabled me to
> connect to it. So that was the answer.
> But even before the Enterprise instance was installed, (which includes the
> browser service) I was not able to connect. I know I have other machines
> in
> my domain that are running SQL Express. Should I not be able to connect to
> them using my SSMS? What do I need to do to make that happen?
> I assume that I need membership in the group on the local machine that
> bears
> the SQL Express instance name?
> What else? I can't rely on the Browser service in those instances.
> Thanks
> --
> Todd Chittenden
>
> "Roger Wolter[MSFT]" wrote:

Connecting to remote Express instance using SSMS

I have a server running SQL Server 2005 Ent. Ed. SP2 and locally, I can see
the default instance and two SQLExpress instances named 'sqlexpress' and
'officeservers', all withing SSMS, and can connect and manage them.
From my workstation, running SQL 2005 Dev, SP2, I can connect to the default
instance on that server, but cannot connect to the express instances. They
both have TCP/IP protocol enabled, along with "Allow Remote COnnections".
I have done the following:
Made myself a member of the local Admin group
Tried using the sa account to connect
nothing seems to work. What am I missing?
TIA
--
Todd ChittendenIs the SQLBrowser Service enabled and started?
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Todd C" <ToddC@.discussions.microsoft.com> wrote in message
news:15C51BF6-FF25-435E-B26B-3863344FB81D@.microsoft.com...
>I have a server running SQL Server 2005 Ent. Ed. SP2 and locally, I can see
> the default instance and two SQLExpress instances named 'sqlexpress' and
> 'officeservers', all withing SSMS, and can connect and manage them.
> From my workstation, running SQL 2005 Dev, SP2, I can connect to the
> default
> instance on that server, but cannot connect to the express instances. They
> both have TCP/IP protocol enabled, along with "Allow Remote COnnections".
> I have done the following:
> Made myself a member of the local Admin group
> Tried using the sa account to connect
> nothing seems to work. What am I missing?
> TIA
> --
> Todd Chittenden
>|||I found it not long after posting the original question:
No, the Browser service was not running. Starting that up enabled me to
connect to it. So that was the answer.
But even before the Enterprise instance was installed, (which includes the
browser service) I was not able to connect. I know I have other machines in
my domain that are running SQL Express. Should I not be able to connect to
them using my SSMS? What do I need to do to make that happen?
I assume that I need membership in the group on the local machine that bears
the SQL Express instance name?
What else? I can't rely on the Browser service in those instances.
Thanks
--
Todd Chittenden
"Roger Wolter[MSFT]" wrote:

> Is the SQLBrowser Service enabled and started?
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Todd C" <ToddC@.discussions.microsoft.com> wrote in message
> news:15C51BF6-FF25-435E-B26B-3863344FB81D@.microsoft.com...
>|||SQL Express by default installs as a named instance. Unless you specify the
TCP/IP port in the connection string, you need the sqlbrowser service to
connect to a named instance.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Todd C" <ToddC@.discussions.microsoft.com> wrote in message
news:F4B981A2-4B9A-443E-855B-D53B89FCE511@.microsoft.com...[vbcol=seagreen]
>I found it not long after posting the original question:
> No, the Browser service was not running. Starting that up enabled me to
> connect to it. So that was the answer.
> But even before the Enterprise instance was installed, (which includes the
> browser service) I was not able to connect. I know I have other machines
> in
> my domain that are running SQL Express. Should I not be able to connect to
> them using my SSMS? What do I need to do to make that happen?
> I assume that I need membership in the group on the local machine that
> bears
> the SQL Express instance name?
> What else? I can't rely on the Browser service in those instances.
> Thanks
> --
> Todd Chittenden
>
> "Roger Wolter[MSFT]" wrote:
>

Connecting to Named Instances

We have a few servers with named instances, 2003 Server w/ SQL 2000 SP3a
running Named Pipes only.
Our users primarily use IIS 5, 5.1, and 6 to connect to these servers with
ColdFusion and ASP .NET applications. Right now the ASP .NET applications
aren't able to connect to the server, here is an example of the connection
string:
user id=myuser;data source="SQLserver\SQLinstance";initial
catalog=mydatabase;password=mypassword
This doesn't work, and we're not quite sure why. Does any one also have
some good resources on managing multiple instances of SQL server from a SQL
admin and SQL developer point of view?
Thanks,
Trevor
These articles will help you troubleshoot.
265808 INF: How to Connect to an SQL Server 2000 Named Instance with the
http://support.microsoft.com/?id=265808
286303 INF: Behavior of SQL Server 2000 Network Library During Dynamic Port
http://support.microsoft.com/?id=286303
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Monday, March 19, 2012

Connecting to Named Instances

We have a few servers with named instances, 2003 Server w/ SQL 2000 SP3a
running Named Pipes only.
Our users primarily use IIS 5, 5.1, and 6 to connect to these servers with
ColdFusion and ASP .NET applications. Right now the ASP .NET applications
aren't able to connect to the server, here is an example of the connection
string:
user id=myuser;data source="SQLserver\SQLinstance";initial
catalog=mydatabase;password=mypassword
This doesn't work, and we're not quite sure why. Does any one also have
some good resources on managing multiple instances of SQL server from a SQL
admin and SQL developer point of view?
Thanks,
TrevorThese articles will help you troubleshoot.
265808 INF: How to Connect to an SQL Server 2000 Named Instance with the
http://support.microsoft.com/?id=265808
286303 INF: Behavior of SQL Server 2000 Network Library During Dynamic Port
http://support.microsoft.com/?id=286303
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Connecting to named instance in Management Studio fails

I have a remote server with a default instance of Sql 2000 and a named
instance of Sql 2005. Whenever I try to connect to the named instance
in Management Studio, it ALWAYS connects to the default instance. I am
specifying the connection as ServerName\InstanceName. It seems like it
is ignoring the instance name in the connection request. I have tried
creating an alias, but it does not change the behavior. One special
note - due to our network structure we must use fully qualified domain
names when connecting to remote servers. The my local server and my
remote server are in different sub-domains:
local server = ServerA.HQ.domain.com
remote server = ServerX.Remote.domain.com
One interesting observation is that I am able to connect to the remote
server from a different db server in the same sub-domain without any
problems. i.e. ServerY.remote.domain.com can connect to
ServerX.remote.domain.com.
I know there was a bug in MDAC that was similar to this, but it was
supposedly fixed in MDAC 2.8 SP1. I wonder if the same bug crept into
the SQLNI code?check with your network admin. it seems there is firewall rule on udp 1434.
also, try to specify the tcp as part of your connection string.
e.g.
sqlcmd -S"ServerX.Remote.domain.com,tcp#"
-oj
"kmart" <kevmart@.gmail.com> wrote in message
news:1146849746.958318.194980@.v46g2000cwv.googlegroups.com...
>I have a remote server with a default instance of Sql 2000 and a named
> instance of Sql 2005. Whenever I try to connect to the named instance
> in Management Studio, it ALWAYS connects to the default instance. I am
> specifying the connection as ServerName\InstanceName. It seems like it
> is ignoring the instance name in the connection request. I have tried
> creating an alias, but it does not change the behavior. One special
> note - due to our network structure we must use fully qualified domain
> names when connecting to remote servers. The my local server and my
> remote server are in different sub-domains:
> local server = ServerA.HQ.domain.com
> remote server = ServerX.Remote.domain.com
> One interesting observation is that I am able to connect to the remote
> server from a different db server in the same sub-domain without any
> problems. i.e. ServerY.remote.domain.com can connect to
> ServerX.remote.domain.com.
> I know there was a bug in MDAC that was similar to this, but it was
> supposedly fixed in MDAC 2.8 SP1. I wonder if the same bug crept into
> the SQLNI code?
>

Connecting to named instance in Management Studio fails

I have a remote server with a default instance of Sql 2000 and a named
instance of Sql 2005. Whenever I try to connect to the named instance
in Management Studio, it ALWAYS connects to the default instance. I am
specifying the connection as ServerName\InstanceName. It seems like it
is ignoring the instance name in the connection request. I have tried
creating an alias, but it does not change the behavior. One special
note - due to our network structure we must use fully qualified domain
names when connecting to remote servers. The my local server and my
remote server are in different sub-domains:
local server = ServerA.HQ.domain.com
remote server = ServerX.Remote.domain.com
One interesting observation is that I am able to connect to the remote
server from a different db server in the same sub-domain without any
problems. i.e. ServerY.remote.domain.com can connect to
ServerX.remote.domain.com.
I know there was a bug in MDAC that was similar to this, but it was
supposedly fixed in MDAC 2.8 SP1. I wonder if the same bug crept into
the SQLNI code?check with your network admin. it seems there is firewall rule on udp 1434.
also, try to specify the tcp as part of your connection string.
e.g.
sqlcmd -S"ServerX.Remote.domain.com,tcp#"
-oj
"kmart" <kevmart@.gmail.com> wrote in message
news:1146849746.958318.194980@.v46g2000cwv.googlegroups.com...
>I have a remote server with a default instance of Sql 2000 and a named
> instance of Sql 2005. Whenever I try to connect to the named instance
> in Management Studio, it ALWAYS connects to the default instance. I am
> specifying the connection as ServerName\InstanceName. It seems like it
> is ignoring the instance name in the connection request. I have tried
> creating an alias, but it does not change the behavior. One special
> note - due to our network structure we must use fully qualified domain
> names when connecting to remote servers. The my local server and my
> remote server are in different sub-domains:
> local server = ServerA.HQ.domain.com
> remote server = ServerX.Remote.domain.com
> One interesting observation is that I am able to connect to the remote
> server from a different db server in the same sub-domain without any
> problems. i.e. ServerY.remote.domain.com can connect to
> ServerX.remote.domain.com.
> I know there was a bug in MDAC that was similar to this, but it was
> supposedly fixed in MDAC 2.8 SP1. I wonder if the same bug crept into
> the SQLNI code?
>

Connecting to named instance fails for Enterprise Manager but works with Query Analyzer

Hi,
We have just had a 64-bit SQL Server 2000 cluster installed in our
network and I am having difficulties connecting to it.
The named instance I am trying to access is 192.168.0.108\DX
I can connect to it from a machine on the same subnet using Enterprise
Manager, but not from a machine on another subnet (192.168.14.0), when
attempiting EM just stops responding. The weird thing is that I can
connect using Query Analyzer, but not EM (obviously using the same
connection details).
Does anybody have any suggestions to what might be causing this
behaviour?
The client computer I use is a Windows XP Professional with SP2 and
client connectivity tools for SQL Server 2000. I have tried disabling
the firewall, which didn't help. I can connect to another SQL Server
(default instance, 32-bit, non-clustered) on the other network with
EM.
Regards,
Ville Tuomola
Have you tried pinging the server when you can't connect?
Have you checked the registration/connection properties for
the server in Enterprise Manager? Are you sure you aren't
just getting a login timeout? You can increase the login
timeout from the menu go to Tools then Options. On the
Advanced tab, increase the login timeout to a value higher
than the default 4 seconds.
-Sue
On 7 Oct 2004 01:11:35 -0700, vtuomola@.gmail.com (Ville
Tuomola) wrote:

>Hi,
>We have just had a 64-bit SQL Server 2000 cluster installed in our
>network and I am having difficulties connecting to it.
>The named instance I am trying to access is 192.168.0.108\DX
>I can connect to it from a machine on the same subnet using Enterprise
>Manager, but not from a machine on another subnet (192.168.14.0), when
>attempiting EM just stops responding. The weird thing is that I can
>connect using Query Analyzer, but not EM (obviously using the same
>connection details).
>Does anybody have any suggestions to what might be causing this
>behaviour?
>The client computer I use is a Windows XP Professional with SP2 and
>client connectivity tools for SQL Server 2000. I have tried disabling
>the firewall, which didn't help. I can connect to another SQL Server
>(default instance, 32-bit, non-clustered) on the other network with
>EM.
>Regards,
>Ville Tuomola

Connecting to Named Instance

Hi,

How can i connect to Named Instance of MSDE on remote server from Enterprice Manager in my local computer ?

Instance name is Helm

I can connect inside server like

osql -S -E .\Helm

But how i access from remote machine using Enterprice Manager ?

Regards,

Yujin Bobymachinename\Helm

Connecting to MSSQL Server 2000 using JDBC

Hello,

I am developing an application which needs JDBC connection to a Named Instance of SQL Server 2000 (other than default instance). I am facing problem in this regard as my code gives an exception "Time Out" or "Connection Failed". However it works fine with the default named instance...The main driver class is "com.microsoft.sqlserver.jdbc.SQLServerDriver"

and Connection URL is

"jdbc: sqlserver://localhost;instanceName=Testing:1432;databaseName=testDB;"

It gives the exception that Unable to connect to named instance....

Please if any one have any knowledge in this regard....do let me know....I have read an article on MSDN according to which on MS SQL Server 2000 the named Instance other than default can be accessed only through named pipes.

http://msdn2.microsoft.com/en-us/library/aa224779(sql.80).aspx

if some body can tell me Connection string for JDBC driver which utilizes named pipes...the it will be very help full for me.........any help from MSDN Experts is really appreciated...

Thanks

Muhammad:

The JDBC driver does connect to named instances but doesn't use Named Pipes -- only TCP/IP. In your case it looks like you're overloading the instanceName property in the connection string by putting the instanceName and portNumber together. Try breaking them apart like this:

"jdbc: sqlserver://localhost;instanceName=Testing;portNumber=1432;databaseName=testDB;"

If that still doesn't work let me know.

-shelby

|||

Thanks Shelby for your quick reply.....I have tried the string you have given and it is given the same error..

"com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect

at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)

at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)

at java.sql.DriverManager.getConnection(DriverManager.java:525)

at java.sql.DriverManager.getConnection(DriverManager.java:193)

at com.frt.test.DatabaseTest.main(DatabaseTest.java:21)"

One thing i want to discuss with you is that when I go to "Server Network utility" the value written in default port for the second instance in "TCP/IP" is 0..why it is so? I have chaged it to 1432 myself and have restarted the server again....My code is as follows (however it is very simple but I am sending it)

import java.sql.*;

public class DatabaseTest
{
public static void main(String[] args)
{
try
{
java.lang.Class.forName( "com.microsoft.sqlserver.jdbc.SQLServerDriver" );
// Class.forName("com.inet.tds.TdsDriver");
Connection c = java.sql.DriverManager.getConnection( "jdbcTongue Tiedqlserver://localhost;instanceName=TESTING;portNumber=1432;databaseName=testDB;" );
// Connection c = java.sql.DriverManager.getConnection( "jdbcTongue Tiedqlserver://localhost/pipe/MSSQL$TESTING/sql/query?database=testDB&user=sa&password=abc");
// Connection c = DriverManager.getConnection("jdbc:inetdae7://localhost/pipe/MSSQL$TESTING/sql/query?database=CMS&user=sa&password=abc");
Statement s = c.createStatement();
ResultSet r =s.executeQuery("select * from table1");
while(r.next())
{
System.out.println(r.getString(2));
}
System.out.println( "Connected!" );
}
catch( Exception ex )
{
ex.printStackTrace();
}
}
}

as you can see that in connection statement I have commented out some lines....that is connection string of some other driver I have downloaded for testing...and when I use it with piped names it connects perfectly to named instance...but I have to use the first driver....so please help me...

Thanks for your coordination

bye

|||

At last i got the solution.....All the problem is due to cause that Service Pack 3.0 for SQL Server 2000 was not installed on my machine...as it is a bug in SQL Server 2000, that it does not listen on TCP/IP port, as u can verify by using TELNET, however this bug has been removed in SP3

Regards

Muhammad Ummar

Connecting to MSSQL Server 2000 using JDBC

Hello,

I am developing an application which needs JDBC connection to a Named Instance of SQL Server 2000 (other than default instance). I am facing problem in this regard as my code gives an exception "Time Out" or "Connection Failed". However it works fine with the default named instance...The main driver class is "com.microsoft.sqlserver.jdbc.SQLServerDriver"

and Connection URL is

"jdbc: sqlserver://localhost;instanceName=Testing:1432;databaseName=testDB;"

It gives the exception that Unable to connect to named instance....

Please if any one have any knowledge in this regard....do let me know....I have read an article on MSDN according to which on MS SQL Server 2000 the named Instance other than default can be accessed only through named pipes.

http://msdn2.microsoft.com/en-us/library/aa224779(sql.80).aspx

if some body can tell me Connection string for JDBC driver which utilizes named pipes...the it will be very help full for me.........any help from MSDN Experts is really appreciated...

Thanks

Muhammad:

The JDBC driver does connect to named instances but doesn't use Named Pipes -- only TCP/IP. In your case it looks like you're overloading the instanceName property in the connection string by putting the instanceName and portNumber together. Try breaking them apart like this:

"jdbc: sqlserver://localhost;instanceName=Testing;portNumber=1432;databaseName=testDB;"

If that still doesn't work let me know.

-shelby

|||

Thanks Shelby for your quick reply.....I have tried the string you have given and it is given the same error..

"com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect

at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)

at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)

at java.sql.DriverManager.getConnection(DriverManager.java:525)

at java.sql.DriverManager.getConnection(DriverManager.java:193)

at com.frt.test.DatabaseTest.main(DatabaseTest.java:21)"

One thing i want to discuss with you is that when I go to "Server Network utility" the value written in default port for the second instance in "TCP/IP" is 0..why it is so? I have chaged it to 1432 myself and have restarted the server again....My code is as follows (however it is very simple but I am sending it)

import java.sql.*;

public class DatabaseTest
{
public static void main(String[] args)
{
try
{
java.lang.Class.forName( "com.microsoft.sqlserver.jdbc.SQLServerDriver" );
// Class.forName("com.inet.tds.TdsDriver");
Connection c = java.sql.DriverManager.getConnection( "jdbcTongue Tiedqlserver://localhost;instanceName=TESTING;portNumber=1432;databaseName=testDB;" );
// Connection c = java.sql.DriverManager.getConnection( "jdbcTongue Tiedqlserver://localhost/pipe/MSSQL$TESTING/sql/query?database=testDB&user=sa&password=abc");
// Connection c = DriverManager.getConnection("jdbc:inetdae7://localhost/pipe/MSSQL$TESTING/sql/query?database=CMS&user=sa&password=abc");
Statement s = c.createStatement();
ResultSet r =s.executeQuery("select * from table1");
while(r.next())
{
System.out.println(r.getString(2));
}
System.out.println( "Connected!" );
}
catch( Exception ex )
{
ex.printStackTrace();
}
}
}

as you can see that in connection statement I have commented out some lines....that is connection string of some other driver I have downloaded for testing...and when I use it with piped names it connects perfectly to named instance...but I have to use the first driver....so please help me...

Thanks for your coordination

bye

|||

At last i got the solution.....All the problem is due to cause that Service Pack 3.0 for SQL Server 2000 was not installed on my machine...as it is a bug in SQL Server 2000, that it does not listen on TCP/IP port, as u can verify by using TELNET, however this bug has been removed in SP3

Regards

Muhammad Ummar

Connecting to MSDE named instance

If we install MSDE 2000 SP3a with out a named instance we can connect to
through OSQL from a different computer on the network.
We used SVRNETCN.EXE to add TCP/IP to the protocol list.
We changed the port from 1059 or something like that to 1433.
We changed "LoginMode" to 2, but we also tried it with 0
But when we try to connect via OSQL
osql -S ROBXP\RR -U sa -P 11111
we get the following error.
[DBNETLIB]SQL Server does not exist or access denied.
[DBNETLIB]ConnectionOpen (Connect()).
the same OSQL command works OK from the local computer.
If we re-install with out a named instance we can connect fine with OSQL
Any ideas?
-Rob
PS. it was installed with the following:
setup SAPWD=11111 DISABLENETWORKPROTOCOLS=0 SECURITYMODE=SQL INSTANCENAME=RR
Check your MDAC version on the client you're trying to connect from. Upgrade
to the latest version and try it again.
MeanOldDBA
derrickleggett@.hotmail.com
http://weblogs.sqlteam.com/derrickl
When life gives you a lemon, fire the DBA.
"rob" wrote:

> If we install MSDE 2000 SP3a with out a named instance we can connect to
> through OSQL from a different computer on the network.
> We used SVRNETCN.EXE to add TCP/IP to the protocol list.
> We changed the port from 1059 or something like that to 1433.
> We changed "LoginMode" to 2, but we also tried it with 0
> But when we try to connect via OSQL
> osql -S ROBXP\RR -U sa -P 11111
> we get the following error.
>
> [DBNETLIB]SQL Server does not exist or access denied.
> [DBNETLIB]ConnectionOpen (Connect()).
> the same OSQL command works OK from the local computer.
>
> If we re-install with out a named instance we can connect fine with OSQL
> Any ideas?
> -Rob
> PS. it was installed with the following:
> setup SAPWD=11111 DISABLENETWORKPROTOCOLS=0 SECURITYMODE=SQL INSTANCENAME=RR
>
>
|||I ran Componet Checker 2.0 and it indidcates I have MDAC 2.8 SP1 which looks
to be the latest version.
"MeanOldDBA" <MeanOldDBA@.discussions.microsoft.com> wrote in message
news:86C87062-5A4C-4962-8FB3-99BA9CA2F375@.microsoft.com...
> Check your MDAC version on the client you're trying to connect from.
> Upgrade
> to the latest version and try it again.
|||hi,
rob wrote:

> We used SVRNETCN.EXE to add TCP/IP to the protocol list.
> We changed the port from 1059 or something like that to 1433.
usually 1433 is for default instances, where other port numbers indicates
named instances...
specifying a fixed port and not using the dynamic assigned port (wiche
requires on the server the UDP 1434 port to be available out of eventual
firewall) you have to specify an alias via Client Network Utility
(cliconfg.exe) on each remote client...
Andrea Montanari
http://www.asql.biz/DbaMgr.shtm
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||THANKS it works.
For anyone else reading this thread in the future.
You give it an alias name (RR for example) and and the servername is the
servername\instance
you can test the connection by using the alias name:
osql -S RR -U sa -Pxxxxx
thanks again.
.....
I have done some more testing. The only thing I am concerned about is:
After my program and MSDE is installed on someones computer, if they want to
access it from a different computer they will need to know how to create
exceptions in the WindowsXP firewall.
They will need to open up UPD 1434 and TCP port XXXX where XXXX is whatever
random port is used during installation of MSDE. I can find that port in
the registry and tell them at install time. But my users are not always
very proficient at using computers, and could have a hard time opening up
ports in the firewall.
If anyone has any suggestions about making this easier I would love to hear
about it.
-Rob
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:3qfs6cFe280bU1@.individual.net...
> hi,
> rob wrote:
>
> usually 1433 is for default instances, where other port numbers indicates
> named instances...
> specifying a fixed port and not using the dynamic assigned port (wiche
> requires on the server the UDP 1434 port to be available out of eventual
> firewall) you have to specify an alias via Client Network Utility
> (cliconfg.exe) on each remote client...
> --
> Andrea Montanari
> http://www.asql.biz/DbaMgr.shtm
> DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||hi Rob,
rob wrote:
> ....
> I have done some more testing. The only thing I am concerned about
> is: After my program and MSDE is installed on someones computer, if
> they want to access it from a different computer they will need to
> know how to create exceptions in the WindowsXP firewall.
> They will need to open up UPD 1434 and TCP port XXXX where XXXX is
> whatever random port is used during installation of MSDE. I can find
> that port in the registry and tell them at install time. But my
> users are not always very proficient at using computers, and could
> have a hard time opening up ports in the firewall.
> If anyone has any suggestions about making this easier I would love
> to hear about it.
>
actually you can provide the script available at
http://support.microsoft.com/kb/839980/en-us to provide an "automatic open
ports" :D
try having a look at it if can helps..
Andrea Montanari
http://www.asql.biz/DbaMgr.shtm
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Wow, that will make it easier. I was dreading having to give instructions to
open the firewall. ; )
I don't want to bother you, but I have one more question.
Your advice did work, and I can connect to the newly installed instance, -
IF I set up an alias.
BUT,
I have one computer that I installed with an instance that I do NOT have to
set up an alias for to connect remotely. I can not see what is different
for this computer. I even printed out the MSSQL registry settings for the
two computers and could not see a difference (besides uptime, etc.)
Even though your suggestion works, it would be much easier if I did not have
to set up an alias on the clients. Do you have any ideas what I did
differently with the one that works with out an alias?
Thanks,
Rob
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:3qhp0hFem400U1@.individual.net...
> hi Rob,
> actually you can provide the script available at
> http://support.microsoft.com/kb/839980/en-us to provide an "automatic open
> ports" :D
> try having a look at it if can helps..
> --
> Andrea Montanari
> http://www.asql.biz/DbaMgr.shtm
> DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||I downloaded your program DBMgr2 and was able to connect to my DB without
using an alias. The difference was (from your help file) to use servername =
ROBXP\RR,1433
explicitly name the port number. This works via osql also.
The difference remains that I have one computer that I do not need to know
what the port number is, or set up an alias.
"rob" <ryost@..no.spam.rentright.com> wrote in message
news:OqGjGPbyFHA.2924@.TK2MSFTNGP15.phx.gbl...
> Wow, that will make it easier. I was dreading having to give instructions
> to open the firewall. ; )
> I don't want to bother you, but I have one more question.
> Your advice did work, and I can connect to the newly installed instance, -
> IF I set up an alias.
> BUT,
> I have one computer that I installed with an instance that I do NOT have
> to set up an alias for to connect remotely. I can not see what is
> different for this computer. I even printed out the MSSQL registry
> settings for the two computers and could not see a difference (besides
> uptime, etc.)
> Even though your suggestion works, it would be much easier if I did not
> have to set up an alias on the clients. Do you have any ideas what I did
> differently with the one that works with out an alias?
> Thanks,
> Rob
> "Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
> news:3qhp0hFem400U1@.individual.net...
>
|||hi Rob,
rob wrote:
> I downloaded your program DBMgr2 and was able to connect to my DB
> without using an alias. The difference was (from your help file) to
> use servername = ROBXP\RR,1433
> explicitly name the port number. This works via osql also.
> The difference remains that I have one computer that I do not need to
> know what the port number is, or set up an alias.
probably it's not a named instance but a default one, that's to say ROBXP
and not ROBXP\RR..
default instances automatically listen on TCP 1433 as this port is the one
Microsoft reserved on IANA for SQL Server...
try having a look at it..
Andrea Montanari
http://www.asql.biz/DbaMgr.shtm
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||I am pretty sure it is a named instance. I connected to it through your
Dbamgr2k by specifing
MICHELLEP\MICHELLE
I did not have to give it port 1433 (which is its port)
I did set this server up several months ago, and do not remember exactly how
I did it.
Also, when I go to add remove programs it is listed as:
Microsoft SQL Server Desktop Engine (MICHELLE)
and I think the instance name is listed in the paren's
From SQLPing:
C:\>sqlping 192.168.0.88
SQL-Pinging 192.168.0.88
Listening...
ServerName:MICHELLEP
InstanceName:MICHELLE
IsClustered:No
Version:8.00.194
tcp:1433
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:3qieavFf286oU1@.individual.net...
> probably it's not a named instance but a default one, that's to say ROBXP
> and not ROBXP\RR..
> default instances automatically listen on TCP 1433 as this port is the one
> Microsoft reserved on IANA for SQL Server...
> try having a look at it..
> --
> Andrea Montanari
> http://www.asql.biz/DbaMgr.shtm
> DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>

Thursday, March 8, 2012

Connecting to an SQL Named Pipe Alias

Hi All , I have been racking my head on this for the last two days and really it should be a no brainier. Anyways I can only assume that I’m missing something here but...

In a nut shell I am attempting to connect to a new SQL Alias that i have created by simply adding the following in the client network utility

Current SQL server name DASQL

Default instance

Alias Name: TASQL

Server Name: DASQL

Pipe Name: \\DASQL\pipe\sql\query

I can connect the new alias via the local (server consol) yet when i attempt to connect remotely it times out as if it can't find the server.

Any Thought?

Thanks

I knowat server console Shared Memory protocol is used. There is NamedPipes protocol enabled for client and server too ?|||

You need to create the alias on the client that you are using to connect to the server. It looks like you may have created this alias on the server itself - which means when using a client on the server to connect, the alias is available. You would need to create this on other clients to use the alias.

-Sue

|||

Thanks for the quick reply,

Hmm. so if I understand you correctly the following steps are needed to created an alias that is accessable by remote clients

1 create an alias on the server that is going to host the connection point.(Named Pipes)

within the alias properties:

Example Case (Server Name DASQL)

Alias Name: TASQL

Server Name: DASQL

Pipe Name: \\DASQL\pipe\sql\query -- which points the currently alais name of DASQL as TASQL

2 create another alias on ANYclient that going to connect to the remote alias( this what Im fuzzy on, how would you create a alias on a client that doesnt have to ablity to support alias) ie web or application servers

Example case ( MyComputer DEVLAP)

Alias Name: TASQL

Server Name: DASQL

Pipe Name: \\DASQL\pipe\sql\query

Is this correct?

Thanks

|||

If you have SQL Server listening on named pipes, just setup the alias on the clients.

-Sue

Wednesday, March 7, 2012

Connecting to a second instance of SQL

When I try to connect to an external SQL Server via enterprise manager I
cannot seem to connect to a named instance. In the past this has worked with
no problem when I do ip\instance. However when I now try I am getting invali
d
instance name. The name I am using is correct. I am connecting from
Enterprise manager to a SQL2000 instance. Any ideas why it doesn`t connect ?
SiPlease paste in the exact error message
Kevin Hill
3NF Consulting
http://www.3nf-inc.com/NewsGroups.htm
http://kevin3nf.blogspot.com
"Simon" <Simon@.discussions.microsoft.com> wrote in message
news:356739A9-573E-4D7D-AF9B-2B0DA95CEE2E@.microsoft.com...
> When I try to connect to an external SQL Server via enterprise manager I
> cannot seem to connect to a named instance. In the past this has worked
> with
> no problem when I do ip\instance. However when I now try I am getting
> invalid
> instance name. The name I am using is correct. I am connecting from
> Enterprise manager to a SQL2000 instance. Any ideas why it doesn`t connect
> ?
>
> Si|||Invalid connection.Connectioopen (Invalid Instance())
Cheers
"Kevin3NF" wrote:

> Please paste in the exact error message
>
> --
> Kevin Hill
> 3NF Consulting
> http://www.3nf-inc.com/NewsGroups.htm
> http://kevin3nf.blogspot.com
>
> "Simon" <Simon@.discussions.microsoft.com> wrote in message
> news:356739A9-573E-4D7D-AF9B-2B0DA95CEE2E@.microsoft.com...
>
>|||Does the Instance Name contain any invalid character, such as '-'?
Try enclosing the instance name in square brackets, e.g.,
[MyServer\MyInstance].
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Simon" <Simon@.discussions.microsoft.com> wrote in message
news:A5D1AFBD-54F6-4600-A7EA-215AEFD7A1C6@.microsoft.com...[vbcol=seagreen]
> Invalid connection.Connectioopen (Invalid Instance())
> Cheers
> "Kevin3NF" wrote:
>|||There are no invalid characters. Even so I tried enclosing in square bracket
s
and still no joy.
Its a puzzle !
Si
"Arnie Rowland" wrote:

> Does the Instance Name contain any invalid character, such as '-'?
> Try enclosing the instance name in square brackets, e.g.,
> [MyServer\MyInstance].
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to th
e
> top yourself.
> - H. Norman Schwarzkopf
>
> "Simon" <Simon@.discussions.microsoft.com> wrote in message
> news:A5D1AFBD-54F6-4600-A7EA-215AEFD7A1C6@.microsoft.com...
>
>|||Is UDP 1434 open between the SQL Server you are registering
on and the named instance you are trying to register? That
could be what's causing your problems.
You could try an alias and see if that works -
On the SQL Server box where you are trying to register the
named instance, use the Client Network Utility to create an
alias to the named instance and specify the port number
(check the listening port on the named instance).
In that scenario with the alias, you are specifying the port
so you would bypass the SQL Server Resolution Service and
going through UDP 1434.
-Sue
On Mon, 30 Oct 2006 01:20:02 -0800, Simon
<Simon@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>There are no invalid characters. Even so I tried enclosing in square bracke
ts
>and still no joy.
>Its a puzzle !
>Si
>"Arnie Rowland" wrote:
>

Connecting to a named SQL2000 db instance from vbscript

My previous connection string looked like this:

strConnect = "Provider=SQLOLEDB.1;Password=Password=password;Per sistSecurity Info=True;User ID=TestUser;Initial Catalog=JabilDB;DataSource=corsqlv02;Use Procedure for Prepare=0"

The new connection string (that doesn't work) looks like this:

strConnect = "Provider=SQLOLEDB.1;Password=Password=password;Per sistSecurity Info=True;User ID=TestUser;Initial Catalog=JabilDBDev;DataSource=corsqlv02\JabilDB;Us e Procedure for Prepare=0"

Do i need to upgrade to the latest MDAC ?

Thanks

Digital_fXForget this. I just needed to install MDAC 2.6 and that solved the problem.

Cheers