B
blurryimage
Ok guys I have racked my brain on this one.
I have a vb .net service installed on a win2k server. I am trying to
get it to connect to sql 2000 box but I get this error:
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 have remote connection turned on, on the sql2000. I have tried the
following connection strings
data source=<IP>;initial catalog=dfcdb;persist security info=False;user
id=user;password=PW;packet size=4096
data source=(local);initial catalog=dfcdb;persist security
info=False;user id=user;password=PW;packet size=4096
data source=tcp:<IP>;initial catalog=dfcdb;persist security
info=False;user id=user;password=PW;packet size=4096
data source=<IP>:1433;initial catalog=dfcdb;persist security
info=False;user id=user;password=PW;packet size=4096 (that port is
open)
The service is set to run under my log on.
I made a windows app that tests connection strings and the first 3
work. I tested the service on a local machine with a local sql 2000 and
it works like a champ.
Here is the .net code to open the connection
'1. Create a connection
Dim SQLString As String = My.Settings.SQLConnectionString
Dim cn As New SqlConnection(SQLString)
cn.Open() <-- I think it breaks here
'2. Create the command object, passing in the SQL string
Const selectString As String = "GetRules"
Dim cmd As SqlCommand
cmd = New SqlCommand(selectString, cn)
cmd.CommandType = CommandType.StoredProcedure
Dim reader As SqlDataReader = cmd.ExecuteReader()
please help I have looked everywhere
I have a vb .net service installed on a win2k server. I am trying to
get it to connect to sql 2000 box but I get this error:
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 have remote connection turned on, on the sql2000. I have tried the
following connection strings
data source=<IP>;initial catalog=dfcdb;persist security info=False;user
id=user;password=PW;packet size=4096
data source=(local);initial catalog=dfcdb;persist security
info=False;user id=user;password=PW;packet size=4096
data source=tcp:<IP>;initial catalog=dfcdb;persist security
info=False;user id=user;password=PW;packet size=4096
data source=<IP>:1433;initial catalog=dfcdb;persist security
info=False;user id=user;password=PW;packet size=4096 (that port is
open)
The service is set to run under my log on.
I made a windows app that tests connection strings and the first 3
work. I tested the service on a local machine with a local sql 2000 and
it works like a champ.
Here is the .net code to open the connection
'1. Create a connection
Dim SQLString As String = My.Settings.SQLConnectionString
Dim cn As New SqlConnection(SQLString)
cn.Open() <-- I think it breaks here
'2. Create the command object, passing in the SQL string
Const selectString As String = "GetRules"
Dim cmd As SqlCommand
cmd = New SqlCommand(selectString, cn)
cmd.CommandType = CommandType.StoredProcedure
Dim reader As SqlDataReader = cmd.ExecuteReader()
please help I have looked everywhere