Showing posts with label pipes. Show all posts
Showing posts with label pipes. 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

Tuesday, March 20, 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,
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.

Friday, February 24, 2012

CONNECTING SQL 2005 SERVER FROM A REMOTE MACHINE PROBLEM

I installed SQL 2005 with some settings which is below.
INSTANCE NAME: CAVCAV
Protocols For CAVCAV :
Shared Memory : Enabled
Named Pipes : Enabled , Pipe Name :\\.\pipe\MSSQL$CAVCAVsql\query
TCP/IP : Enabled Yes
Ip address :
Ip1
active:yes
enabled :yes
Ip Adress : 212.154.38.146
Tcp Dynamic Ports :
Tcp Port : 1433
Ip2
active:yes
enabled :yes
Ip Adress :127.0.0.1
Tcp Dynamic Ports :
Tcp Port : 1433
IpAll
Tcp Dynamic Ports :
Tcp Port : 1433
VIA : Disabled
Sql Native Client Configuration
Client Protocols
Shared Memory : Enabled
Named Pipes : Enabled , Default Pipe :sql\query
VIA : Disabled
Telnet 212.154.38.146 1433 (Success)
I can connect to server from my local MSSMS (SQL 2005.)
When I try to connect vie DSN or Access (Linked Table Manager) Or SQL 2000
Enterprise Manager I cant connect.
When I write Only Ip address which is 212.154.38.146 on System DSN
I get
Attempting connection
[Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection.
TESTS FAILED!
When I write 212.154.38.146\CAVCAV
I get
Microsoft SQL Server ODBC Driver Version 03.86.3959
Running connectivity tests...
Attempting connection
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or
access denied.
TESTS FAILED!
How can i connect and manage my Sql 2005 remotely. Any help will be
appreciated.Did you enable remote connections?
MC
<in da club> wrote in message news:epyXh4PAIHA.484@.TK2MSFTNGP06.phx.gbl...
>I installed SQL 2005 with some settings which is below.
> INSTANCE NAME: CAVCAV
> Protocols For CAVCAV :
> Shared Memory : Enabled
> Named Pipes : Enabled , Pipe Name :\\.\pipe\MSSQL$CAVCAVsql\query
> TCP/IP : Enabled Yes
> Ip address :
> Ip1
> active:yes
> enabled :yes
> Ip Adress : 212.154.38.146
> Tcp Dynamic Ports :
> Tcp Port : 1433
> Ip2
> active:yes
> enabled :yes
> Ip Adress :127.0.0.1
> Tcp Dynamic Ports :
> Tcp Port : 1433
> IpAll
> Tcp Dynamic Ports :
> Tcp Port : 1433
>
> VIA : Disabled
> Sql Native Client Configuration
> Client Protocols
> Shared Memory : Enabled
> Named Pipes : Enabled , Default Pipe :sql\query
> VIA : Disabled
>
> Telnet 212.154.38.146 1433 (Success)
> I can connect to server from my local MSSMS (SQL 2005.)
> When I try to connect vie DSN or Access (Linked Table Manager) Or SQL 2000
> Enterprise Manager I cant connect.
> When I write Only Ip address which is 212.154.38.146 on System DSN
> I get
> Attempting connection
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection.
> TESTS FAILED!
> When I write 212.154.38.146\CAVCAV
> I get
> Microsoft SQL Server ODBC Driver Version 03.86.3959
> Running connectivity tests...
> Attempting connection
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or
> access denied.
> TESTS FAILED!
> How can i connect and manage my Sql 2005 remotely. Any help will be
> appreciated.
>
>
>
>
>
>
>
>|||Go to SQL Server Surface Area Configuration and check your instance if
Remote Connections is enabled as TCP\IP as MC mentioned.
Remote Connections feature is disabled by default for Developer and Express
Editions.
And check out if Browser Service is running and use
<computer_name>\<instance_name> in your connection strings.
--
Ekrem Önsoy
<in da club> wrote in message news:epyXh4PAIHA.484@.TK2MSFTNGP06.phx.gbl...
>I installed SQL 2005 with some settings which is below.
> INSTANCE NAME: CAVCAV
> Protocols For CAVCAV :
> Shared Memory : Enabled
> Named Pipes : Enabled , Pipe Name :\\.\pipe\MSSQL$CAVCAVsql\query
> TCP/IP : Enabled Yes
> Ip address :
> Ip1
> active:yes
> enabled :yes
> Ip Adress : 212.154.38.146
> Tcp Dynamic Ports :
> Tcp Port : 1433
> Ip2
> active:yes
> enabled :yes
> Ip Adress :127.0.0.1
> Tcp Dynamic Ports :
> Tcp Port : 1433
> IpAll
> Tcp Dynamic Ports :
> Tcp Port : 1433
>
> VIA : Disabled
> Sql Native Client Configuration
> Client Protocols
> Shared Memory : Enabled
> Named Pipes : Enabled , Default Pipe :sql\query
> VIA : Disabled
>
> Telnet 212.154.38.146 1433 (Success)
> I can connect to server from my local MSSMS (SQL 2005.)
> When I try to connect vie DSN or Access (Linked Table Manager) Or SQL 2000
> Enterprise Manager I cant connect.
> When I write Only Ip address which is 212.154.38.146 on System DSN
> I get
> Attempting connection
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection.
> TESTS FAILED!
> When I write 212.154.38.146\CAVCAV
> I get
> Microsoft SQL Server ODBC Driver Version 03.86.3959
> Running connectivity tests...
> Attempting connection
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or
> access denied.
> TESTS FAILED!
> How can i connect and manage my Sql 2005 remotely. Any help will be
> appreciated.
>
>
>
>
>
>
>
>|||Remote Connections is enabled
Local and Remote Connections
* using both tcp/ip and named pipes
Im able to connect it from my local SQL 2005 Management Studio too.
Sql Server Browser Service is running too. I use Enterprise edition.|||Did you check your firewall settings? Be sure 1433 is allowed.
--
Ekrem Önsoy
<in da club> wrote in message news:ODZjlkQAIHA.4584@.TK2MSFTNGP03.phx.gbl...
> Remote Connections is enabled
> Local and Remote Connections
> * using both tcp/ip and named pipes
> Im able to connect it from my local SQL 2005 Management Studio too.
> Sql Server Browser Service is running too. I use Enterprise edition.
>|||I can
Telnet 212.154.38.146 1433 with Success . Im sure it is open .
One more thing when i netstat -an
there are some records like that
127.0.0.1:1000 127.0.0.0:1433 TIME_WAIT
127.0.0.1:1001 127.0.0.0:1433 TIME_WAIT
.
.
127.0.0.1:3000 127.0.0.0:1433 TIME_WAIT
Im sure dynamic tcp port is blank and TCP port is 1433
Im very confused. Almost everthing seems ok but im not able to connect it
via DSN and SQL 2000 Server.|||I solved the problem.
If you use only named instance you need 1434 udp port open + 1435 tcp
2) SQL Browser service: which is a replacement of SSRP system in SQL Server
2000, run as a Windows Service on installation of SQL 2k5. Upon startup, SQL
Server Browser starts and claims UDP port 1434. When SQL Server 2000 and SQL
Server 2005 clients request SQL Server resources, the client network library
sends a UDP message to the server using port 1434. SQL Server Browser
responds with the TCP/IP port or named pipe of the requested instance.
Therefore, you need to make sure SQL Browser is enabled and started when
remote client ask for which tcp port or pipe name SQL Server is listening
on. If your remote SQL Instance is a default instance, you do not necessary
enable sql browser since client would always try default TCP port 1433 and
pipe name \\<remoterserver>\pipe\sql\query. But, if you have SQL 2k5 named
instance installed or SQL 2000 and SQL 2k5 side by side installed, you must
enable and start sqlbrowser.
II. Problem list:
By understanding background 1) and 2), I belive you can imagine issues you
may face when make remote connection against SQL 2k5:
1) Fail to connect over TCP/IP or Named Pipe if the request protocol was
not enabled.
2) Fail to connect over TCP/IP or Named Pipe if Firewall enabled on the
remote server and tcp port or "File and Printer Sharing" is not added to
the Firewall exception list.
3) Fail to connect to remote sql named instance if SQL Browser was not
enabled or UDP port 1434 that browser listening on is added to the Firewall
exception list.