Hi, Sean,
Thank you very much for your post.

In fact, the developers in my team using Java, when they connect the remote
SQL server instance, they use the same host and port 1433 as I set in my
script.
When I use
connection_string << "Server=myServerName\\theInstanceName"
and
connection_string << "Data Source=#{*@host*}, 1433;"

Then run my script, I will get the same error *[dbmssocn] **General network
error. Check your network documentation.

*Have you got any other idea? I have searched a lot from the net, but I
can't succeed.

Additional: I can
ping Local_IP
telnet Local_IP 1433
successfully.

I can
ping remote_IP
But when telnet remote_ip\\instance 1433, I failed, no connection.
Does it matter?

Thanks.
Wesley Chen.


On Wed, Apr 8, 2009 at 11:59 PM, Sean O'Halpin <sean.ohalpin / gmail.com>wrote:

> On Wed, Apr 8, 2009 at 8:57 AM, Wesley Chen <cjq.999 / gmail.com> wrote:
> > Hi, Sean,
> > Thank you very much.
> >
> > I have tried following your advice.
> > In the connection string below, I replace the *@host* with the format
> > *myServerName\the
> > InstanceName* or *myServerName\\the InstanceName*
> > I can't succeed.
> > On local machine, when the @host is just an IP address, I can succeed.
> >
> > connection_string = "Provider=SQLOLEDB.1;"
> > connection_string << "Persist Security Info=False;"
> > connection_string << "User ID=#{@username};"
> > connection_string << "password=#{@password};"
> > connection_string << "Initial Catalog=#{database};"
> > connection_string << "Data Source=#{*@host*}, 1433;"
>
> Did you try
>
>   connection_string << "Server=myServerName\\theInstanceName"
>
> I'm not sure this is right:
>
> > connection_string << "Data Source=#{*@host*}, 1433;"
>
> As far as I remember, named instances won't be running on port 1433.
>
> Regards,
> Sean
>
>