connecting sql server 2005 remotely thru IP using vb.net

  • i'm facing a problem connecting Sql Server 2005 remotely using TCP/IP. the connection string to the provider is

    "Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Data Source=MyDB:Serverip,Port"

    i have tried with the following steps to overcome with this issue:

    1) Enabling and truning on the local and remote connection setting in

    "SQL Server Surface Area Configuration"

    and

    2) Enabling SQL Server Browser Service to allow for Local and Remote connection for the same Instance.

    3) Opening same sql instance in windowfirewall.

    after trying all of these found the same message:

    "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No such host is known.)"

    not luck afterall

    please do the needfull

    Thaks

    Ahmed

  • Youve got a mixture of SQL authentication and Trusted connection in there. Not sure if that is your issue, but try changing the connection string to

    "Integrated Security=SSPI;Persist Security Info=False;Network Library=DBMSSOCN;Data Source=Serverip,Port;Initial Catalogue=MyDB"

    i.e. remove the 'User ID', add 'Initial Catalogue', and remove database name from 'Data Source', add 'Network Library'

    Kev

  • hey kev,

    Appreciate your immediate reply.

    I have tried with changing the connectionstring you have suggested but no luck and found the same issue with the same message. is this something to do with the firewall coz' I’m not even able to create the dsn using the system IP within the same server and it returns the same message.

    "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)"

    Kindly suggest what other things to be take care.

    thanx

    Ahmed

  • can you ping the server?

    can you establish a telnet session to the server ip on the sql port?

  • Dear Kev,

    no i can't able to ping it nor able to etablish telnet session with sql port from client.

    Ahmed

  • If there is a firewall between you and the server then now is definitely the time to check if that is your issue.

    Not surprised the ping didn't work - that's often blocked, but if you can't telnet to sql, then that bascially means you can't talk to the server, so check your firewall settings.

    Kev

  • On the server running the SQL Server, if you can, run from the command line:

    netstat -ano

    If need be, send this output to a text file. Compare the PID of the current sqlservr.exe process with the PIDs listed in that output. Hopefully use see a matchup for TCP on the port you've specified. On a related note, if you have not restarted the SQL Server service (not the whole server, that's not necessary) since you made the change, it wouldn't have taken effect yet. The network properties is something SQL Server reads at start-up only.

    If all that checks out, then as Kev indicates, you've got something blocking between your client system and the SQL Server. It could be a firewall on either side, or it could be a hardware firewall in the middle. But the fact that you can't telnet is what indicates you have a block unless SQL Server just doesn't happen to be listening on the port you've configured, which is what my previous steps verify.

    K. Brian Kelley
    @kbriankelley

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply