From: Wesley Chen Date: 2009-04-08T16:57:47+09:00 Subject: Re: How to remote connect to the SQL server 2005 when there is a ‘\’ in the SQL server name, such as 192.168.0.11\active? --0016e645a3d8a243330467067cc1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 wrote: > On Wed, Apr 8, 2009 at 3:50 AM, Wesley Chen 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 > > --0016e645a3d8a243330467067cc1--