From: Alex Stahl Date: 2010-10-23T06:32:42+09:00 Subject: Re: Database connection String Using 'win32ole' --=-mM4mu9Z6lzgzou9+T6F6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit What type of authentication does your SQL Server use? Windows or SQL Server? If it's configured to use SQL Server auth, then it has no idea who the user 'domain\' is, since that's an AD user, not a SQL user. On Fri, 2010-10-22 at 16:21 -0500, Ruby Mania wrote: > My Connection String: > def open(database) > # Open ADO connection to the SQL Server database > 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};" > connection_string << "Network Library=dbmssocn" > @connection = WIN32OLE.new('ADODB.Connection') > @connection.Open(connection_string) > end > > The string gives error when I using the domain credentials. EG: > > Username: domain\ > Password: whatever > > Error: > OLE error code:80040E4D in Microsoft OLE DB Provider for SQL Server > Login failed for user 'domain\'. > > Please help ! > Thanks ton ! > --=-mM4mu9Z6lzgzou9+T6F6--