unable to connect to ms sql server.

A

avinash404

I get the following error message when trying to connect to ms sql
server:

Open
OLE error code:80040E4D in Microsoft OLE DB Provider for SQL Server
Login failed for user 'XXXXXXXX'.
HRESULT error code:0x80020009
Exception occurred.

I google'd for those error codes but nothing useful so far. To set up
ruby for ms sql server, I followed the instructions here:

http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServer

I followed the first 2 steps (copying ado.rb and modifying
database.yml) but I cannot get it to connect to the sql server.

Any tips, thoughts?
thanks in advance,
 
A

avinash404

And yes, I have made sure that the credentials I am using are valid and
I am able to connect to the server from other interfaces.

BTW, is there a way to force ruby to use windows authentication for
connecting to the sql servers?
 
G

gregarican

If you are creating the connect string you can use the
Trusted_Connection option. Something like:

'DBI:ADO:provider=SQLOLEDB;Connect Timeout=5;Data
Source=myServer;Initial Catalog=myDatabase;Persist Security
Info=True;Trusted_Connection=Yes;'

This way the SQL Server username and password aren't being passed
along. Just the logged on network username on the workstation/server
you run the script from.

Hope this helps!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,811
Latest member
SaulFernan

Latest Threads

Top