unable to connect to ms sql server.

Discussion in 'Ruby' started by avinash404, Jun 3, 2006.

  1. avinash404

    avinash404 Guest

    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,
     
    avinash404, Jun 3, 2006
    #1
    1. Advertisements

  2. avinash404

    avinash404 Guest

    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?
     
    avinash404, Jun 3, 2006
    #2
    1. Advertisements

  3. avinash404

    gregarican Guest

    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!
     
    gregarican, Jun 3, 2006
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.