I am trying to connect to a remote sql server and I am getting the
following error:
c:/ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb:57:in connect': Open (DBI::Databa seError) OLE error code:80004005 in Microsoft OLE DB Provider for SQL Server [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. HRESULT error code:0x80020009 Exception occurred. from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:5 84:in connect’
In my code I am creating a connection using the following code:
BTW, I was able to connect to the SQL Server by switching mode to ODBC
and creating a DSN on my machine and specifying it in when creating a
connection as below:
Not knowing SQL Server too well, it may not supporting ADO access, not
sure.
–Navjeet
Navjeet wrote:
I am trying to connect to a remote sql server and I am getting the
following error:
c:/ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb:57:in connect': Open (DBI::Databa seError) OLE error code:80004005 in Microsoft OLE DB Provider for SQL Server [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. HRESULT error code:0x80020009 Exception occurred. from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:5 84:in connect’
In my code I am creating a connection using the following code:
denied.
HRESULT error code:0x80020009
Exception occurred. from
c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:5
84:in `connect’
Could it be that the remote SQL server currently only uses domain
authentication, explaining why your machine can connect, but won’t
accept password-only authentication? I believe this is the default
behaviour. I had a similar issue with a PHP app.
Your first post appears to be using ADO Ok… you installed the ADO.rb
from
DBI right ?
First, try using :host => “(local)”
Second, try using :host => “machine” instead of machine.domain.com
Third, use SQL Query Analyzer or your other favorite SQL maintenance app
to
test your userid/pw. The userid/pw is the one that burns me most often,
especially if you have newly created or restored your db.
Any of those ideas work?
Joyeux Noël
Peter F.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.