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;"
connection_string << "Network Library=dbmssocn"
@connection = WIN32OLE.new('ADODB.Connection')
@connection.Open(connection_string)



Thanks.
Wesley Chen.


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

> On Wed, Apr 8, 2009 at 3:50 AM, Wesley Chen <cjq.999 / gmail.com> wrote:
> > Hi, Sean,
> > Thank you very much for your post.
> > It is not SQL express.
> > I still can't connect it following the comment in the URL you provided.
> >
> > Would you please give me suggestion about how to specify separately from
> the
> > host?
> >
> >
> > Thanks.
> > Wesley Chen.
>
> As I said, it's a long time since I used this. I think you have to do
> something like:
>
> Server=myServerName\theInstanceName
>
> or specify the actual port of the instance:
>
> Data Source=190.190.200.100,1433
>
> where 1433 is the instance port number or maybe both.
>
> I'm afraid I can't help more than that as I have no way of testing any of
> this.
>
> Regards
> Sean
>
>