Hi guys
I keep getting this error msg:
"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)"
even after I have configured my SQL Server according to this guide:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
my code looks like this:
Dim Max As ArrayList = New ArrayList
Dim myConn As SqlConnection
myConn = New SqlConnection("Server=myserver;Database=mydb;User ID=username;Password=pass;Trusted_Connection=False;")
Dim command As SqlCommand = New SqlCommand("SELECT Max FROM tblTemp;", myConn)
myConn.Open()
Dim reader As SqlDataReader
reader = command.ExecuteReader()
While reader.Read()
Max.Add(reader("Max"))
End While
reader.Close()
myConn.Close()
MsgBox(Max.Count)
anyone have any ideas?
thanks
ken
I keep getting this error msg:
"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)"
even after I have configured my SQL Server according to this guide:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
my code looks like this:
Dim Max As ArrayList = New ArrayList
Dim myConn As SqlConnection
myConn = New SqlConnection("Server=myserver;Database=mydb;User ID=username;Password=pass;Trusted_Connection=False;")
Dim command As SqlCommand = New SqlCommand("SELECT Max FROM tblTemp;", myConn)
myConn.Open()
Dim reader As SqlDataReader
reader = command.ExecuteReader()
While reader.Read()
Max.Add(reader("Max"))
End While
reader.Close()
myConn.Close()
MsgBox(Max.Count)
anyone have any ideas?
thanks
ken
Last edited: