# Using ms access 97 as local db backend for rails on windows

**URL:** <https://www.ruby-forum.com/t/using-ms-access-97-as-local-db-backend-for-rails-on-windows/87781>\
**Category:** Rails\
**Created:** [March 5, 2007, 10:57pm UTC](https://www.ruby-forum.com/t/using-ms-access-97-as-local-db-backend-for-rails-on-windows/87781 "2007-03-05T22:57:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian\_Schmitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@Adrian\_Schmitt](https://www.ruby-forum.com/u/Adrian_Schmitt)\
**Post date:** [March 5, 2007, 10:57pm UTC](https://www.ruby-forum.com/t/using-ms-access-97-as-local-db-backend-for-rails-on-windows/87781/1 "2007-03-05T22:57:03Z")

</div>

Hi,

I am on a windows 2000 machine and want to use an ms access 97  
database (\*.mdb) as db backend.

I did a clean install: ruby, gems, rails, odbc-rails. A test rails  
application connecting to a local mysql server is doing fine. I can  
also locally connect to the odbc connection “local\_odbc\_name” with the  
aqua data studio client.

But now with rails. As soon as I change the adapter to odbc webrick  
won’t start.

I added  
require ‘odbc\_adapter’  
to environment.rb like I understood from the documentation of the odbc-  
rails gem.

I changed the development section in database.yml to:

development:  
adapter: odbc  
database: local\_odbc\_name  
host: localhost

This is the error message I get when I want to start webrick:

c:\temp\test1\>ruby script/server  
=\> Booting WEBrick…

c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active\_record/  
connection\_

adapters/abstract/connection\_specification.rb:34: uninitialized class  
variable @@allow\_concurrency in ActiveRecord::Base (NameError)  
from c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:  
27:in `gem_original_require' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 27:in`require’  
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/  
active\_support/dependencies.rb:495:in `require' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/ active_support/dependencies.rb:342:in`new\_constants\_in’  
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/  
active\_support/dependencies.rb:495:in `require' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/ active_record/connection_adapters/abstract_adapter.rb:10 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 27:in`gem\_original\_require’  
from c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:  
27:in `require' ... 27 levels... from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/ server.rb:39 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 27:in`gem\_original\_require’  
from c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:  
27:in `require’  
from script/server:3  
c:\temp\test1\>

Maybe someone had this before? I don’t have enough understanding of  
the whole system to deal with it.

Adrian

---

<div class="post-metadata">

**Author:** ![Adrian\_Schmitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@Adrian\_Schmitt](https://www.ruby-forum.com/u/Adrian_Schmitt)\
**Post date:** [March 6, 2007, 4:10am UTC](https://www.ruby-forum.com/t/using-ms-access-97-as-local-db-backend-for-rails-on-windows/87781/2 "2007-03-06T04:10:21Z")

</div>

Adrian Schmitt wrote:

> Hi,
> 
> I am on a windows 2000 machine and want to use an ms access 97  
> database (\*.mdb) as db backend.

Hey  
There are no database adaptors for odbc.  
Please and why would you want to use MS Access while there are more  
powerful tools like mysql, postgres,SQLite and MS SQL server?

please refer to this page for supported adapters:

[http://wiki.rubyonrails.com/rails/pages/DatabaseDrivers](http://wiki.rubyonrails.com/rails/pages/DatabaseDrivers)

rgds  
Tanzanite

---

<div class="post-metadata">

**Author:** ![Adrian\_Schmitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@Adrian\_Schmitt](https://www.ruby-forum.com/u/Adrian_Schmitt)\
**Post date:** [March 6, 2007, 9:31am UTC](https://www.ruby-forum.com/t/using-ms-access-97-as-local-db-backend-for-rails-on-windows/87781/3 "2007-03-06T09:31:06Z")

</div>

On 06/03/07, Tanzanite T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Adrian Schmitt wrote:
> 
> > Hi,
> > 
> > I am on a windows 2000 machine and want to use an ms access 97  
> > database (\*.mdb) as db backend.
> 
> Hey  
> There are no database adaptors for odbc.

That’s not strictly true, as the SQL Server adapter does allow ODBC  
connections (set mode to ODBC). I very much doubt it would work with  
Access though.

Tom

---

<div class="post-metadata">

**Author:** ![Adrian\_Schmitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@Adrian\_Schmitt](https://www.ruby-forum.com/u/Adrian_Schmitt)\
**Post date:** [March 6, 2007, 1:47pm UTC](https://www.ruby-forum.com/t/using-ms-access-97-as-local-db-backend-for-rails-on-windows/87781/4 "2007-03-06T13:47:46Z")

</div>

> There are no database adaptors for odbc.

I am a little confused by the above statement. If you look at the Rails  
ODBC Adapter (Open Link)it has several drivers installed with it (mySQL,  
PostgreQL, etc). From what I can tell this is supposed to be used with  
the Ruby ODBC libs (Christian Werners).

This combination of code sounds like it is supposed to give ODBC support  
with the same kind of Adapter behavior as a native db driver and adapter  
would.

Now the bad news…I also cannot get them to run when trying to use ODBC  
connecting through a mySQL DSN.

Here is the project link with all the info  
[http://odbc-rails.rubyforge.org/](http://odbc-rails.rubyforge.org/)

Is my interpretation of operation correct? If so, any Help is greatly  
appreciated.

My cry out for help on this board also:

[http://www.ruby-forum.com/topic/100119#new](http://www.ruby-forum.com/topic/100119#new)

Thanks,  
Rick

---

<div class="post-metadata">

**Author:** ![Adrian\_Schmitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@Adrian\_Schmitt](https://www.ruby-forum.com/u/Adrian_Schmitt)\
**Post date:** [March 6, 2007, 9:32pm UTC](https://www.ruby-forum.com/t/using-ms-access-97-as-local-db-backend-for-rails-on-windows/87781/5 "2007-03-06T21:32:28Z")

</div>

On 6 Mrz., 04:10, Tanzanite T. \<rails-mailing-l…@andreas-  
[s.net](http://s.net)\> wrote:

> There are no database adaptors for odbc.  
> I am not really sure.

> Please and why would you want to use MS Access while there are more  
> powerful tools like mysql, postgres,SQLite and MS SQL server?

It is not the question to “use” this database. It is already there and  
in use  
by a number of applications in the environment.

The question is if I will be able to construct an additional easy  
user interface for some of the data in that database with ruby on  
rails  
or not. If not I will have to use something else.

Of course it is nice to start a new project and choose whatever  
components  
you desire but sadly this is not possible in my case.

Thanks for the link to db adapters!

Cheers  
Adrian

---

<div class="post-metadata">

**Author:** ![Adrian\_Schmitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@Adrian\_Schmitt](https://www.ruby-forum.com/u/Adrian_Schmitt)\
**Post date:** [March 6, 2007, 9:29pm UTC](https://www.ruby-forum.com/t/using-ms-access-97-as-local-db-backend-for-rails-on-windows/87781/6 "2007-03-06T21:29:28Z")

</div>

On 6 Mrz., 13:47, Rick F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Here is the project link with all the infohttp://odbc-rails.rubyforge.org/

> Thanks,  
> Rick

Thank you Rick, following your link I found great documentation and I  
believe now that  
I will also have to install the ODBC Binding for Ruby (http://ch-  
[werner.de/rubyodbc/](http://werner.de/rubyodbc/))

I will do this as soon as my time permits, maybe it helps.

Cheers  
Adrian

---

<div class="post-metadata">

**Author:** ![Adrian\_Schmitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@Adrian\_Schmitt](https://www.ruby-forum.com/u/Adrian_Schmitt)\
**Post date:** [March 7, 2007, 11:34am UTC](https://www.ruby-forum.com/t/using-ms-access-97-as-local-db-backend-for-rails-on-windows/87781/7 "2007-03-07T11:34:53Z")

</div>

Adrian,

Please be aware that the odbc-rails adapter doesn’t currently support  
MS Access. The adapter isn’t completely generic in that the adapter  
requires some database-specific information which ODBC cannot provide.  
Consequently, the adapter contains specific entries for each database  
currently supported. However, it’s straightforward to modify the  
adapter to support a new database for which an ODBC driver exists.  
Alternatively, you could export your Access tables to one of the  
supported databases.

If you were to do this, your database.yml file should contain  
something similar to:

development:  
adapter: odbc  
dsn: local\_odbc\_name  
username: rails\_dev  
password: rails\_dev  
emulate\_booleans: true  
trace: false

i.e. dsn refers to a Data Source Name configured with your ODBC  
Administrator.

Regards  
Carl Blakeley
