# Uninitialized constant ODBC::SQL\_DBMS\_NAME

**URL:** <https://www.ruby-forum.com/t/uninitialized-constant-odbc-sql-dbms-name/143043>\
**Category:** Rails\
**Created:** [July 14, 2008, 7:21pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-odbc-sql-dbms-name/143043 "2008-07-14T19:21:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anthony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@anthony](https://www.ruby-forum.com/u/anthony)\
**Post date:** [July 14, 2008, 7:21pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-odbc-sql-dbms-name/143043/1 "2008-07-14T19:21:10Z")

</div>

Hello,

I am connecting my rails app to an sql server. Or at least trying to.  
My local development set up works great. Its using iODBC and FreeTDS.  
My shared hosting provider installed unixODBC and FreeTDS. Working  
with them, I have the shared server connecting to my Database server.  
However, when I run script/console it doesn’t work.

I have my ODBC.ini file and FreeTDS.conf file set up so that using  
tsql to check the connection works, as does isql.

However, when I run script/console, I get this error:

ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/  
dependencies.rb:263:in `load\_missing\_constant’:NameError:  
uninitialized constant ODBC::SQL\_DBMS\_NAME

Is there a place to set the name of the DBMS?

---

<div class="post-metadata">

**Author:** ![anthony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@anthony](https://www.ruby-forum.com/u/anthony)\
**Post date:** [November 4, 2008, 6:13pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-odbc-sql-dbms-name/143043/2 "2008-11-04T18:13:26Z")

</div>

Hello,

I have the same problem.  
My connection works with dbi connection:

irb(main):008:0\> DBI.connect(‘dbi:ODBC:ServeurBDDSQL’, ‘toto’,  
‘password’) do |dbh|  
irb(main):009:1\* dbh.select\_all(‘select N\_contrat from contrats where  
id\_contrat = 593;’) do |row|  
irb(main):010:2\* p row  
irb(main):011:2\> end  
irb(main):012:1\> end  
[“2000005621”]  
=\> nil

the connection works with an older activerecord (1.4.2)  
but the connection doesn’t work with activesupport (2.2.0) and occurs  
the error:  
/var/lib/gems/1.8/gems/activesupport-2.2.0/lib/active\_support/dependencies.rb:428:in  
`load\_missing\_constant’: uninitialized constant ODBC::SQL\_DBMS\_NAME  
(NameError)

## is there an issue?? thanks

kisscool  
Pascal AUREGAN

Anthony wrote:

> Hello,
> 
> I am connecting my rails app to an sql server. Or at least trying to.  
> My local development set up works great. Its using iODBC and FreeTDS.  
> My shared hosting provider installed unixODBC and FreeTDS. Working  
> with them, I have the shared server connecting to my Database server.  
> However, when I run script/console it doesn’t work.
> 
> I have my ODBC.ini file and FreeTDS.conf file set up so that using  
> tsql to check the connection works, as does isql.
> 
> However, when I run script/console, I get this error:
> 
> ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/  
> dependencies.rb:263:in `load\_missing\_constant’:NameError:  
> uninitialized constant ODBC::SQL\_DBMS\_NAME
> 
> Is there a place to set the name of the DBMS?
