# Ruby on Rails and MS Access

**URL:** <https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144>\
**Category:** rubyonrails-talk\
**Created:** [February 19, 2008, 7:03pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144 "2008-02-19T19:03:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![PAZAZ](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@PAZAZ](https://discuss.rubyonrails.org/u/PAZAZ)\
**Post date:** [February 19, 2008, 7:03pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/1 "2008-02-19T19:03:58Z")

</div>

How do I connect an existing or new Access database with Ruby on Rails?

I am new to Ruby on Rails and a tutorial I am going through mentions using MySQL but I don't have MySQL and only work with MS Access.

Is MySQL available for free on the web? Thanks.

---

<div class="post-metadata">

**Author:** ![Wayne\_M](https://avatars.discourse-cdn.com/v4/letter/w/a698b9/32.png) [@Wayne\_M](https://discuss.rubyonrails.org/u/Wayne_M)\
**Post date:** [February 19, 2008, 7:12pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/2 "2008-02-19T19:12:17Z")

</div>

MySQL has a free Community Edition (there are licenses, but I believe the only apply if you’re redistributing the database, and your code isn’t open-source).

- Wayne

---

<div class="post-metadata">

**Author:** ![PAZAZ](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@PAZAZ](https://discuss.rubyonrails.org/u/PAZAZ)\
**Post date:** [February 19, 2008, 7:20pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/3 "2008-02-19T19:20:12Z")

</div>

Thanks. Where can I get the community edition?

I would prefer finding a way to connect ROR with MS Access so that if a web application is built....I can take data from MS Access and put it into ROR or vice versa. Any ideas? Would this be easier with MySQL?

---

<div class="post-metadata">

**Author:** ![Wayne\_M](https://avatars.discourse-cdn.com/v4/letter/w/a698b9/32.png) [@Wayne\_M](https://discuss.rubyonrails.org/u/Wayne_M)\
**Post date:** [February 19, 2008, 8:10pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/4 "2008-02-19T20:10:57Z")

</div>

I don’t know if Rails can connect to Access, as I’ve never tried.

MySQL Community Edition: [http://dev.mysql.com/downloads/mysql/5.0.html](http://dev.mysql.com/downloads/mysql/5.0.html) (select the “Download” link under MySQL Community Server)

Hope this helps.

- Wayne

---

<div class="post-metadata">

**Author:** ![Phlip](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@Phlip](https://discuss.rubyonrails.org/u/Phlip)\
**Post date:** [February 19, 2008, 8:12pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/5 "2008-02-19T20:12:24Z")

</div>

PAZAZ wrote:

> Thanks. Where can I get the community edition?

Google is your friend!

And the "MySQL Community Edition" is all you need to serve. The payware version is essentially for when you sell an entire application, like on a CD or an appliance. MySQL is generally free if you just install and serve it.

> I would prefer finding a way to connect ROR with MS Access so that if a web application is built....I can take data from MS Access and put it into ROR or vice versa. Any ideas? Would this be easier with MySQL?

Google for [ado activerecord]. Access's database piping layer is called ADO.

---

<div class="post-metadata">

**Author:** ![PAZAZ](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@PAZAZ](https://discuss.rubyonrails.org/u/PAZAZ)\
**Post date:** [February 19, 2008, 8:38pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/6 "2008-02-19T20:38:50Z")

</div>

1) I googled "ado activerecord" but it says on google that this is the server adapter for MySql.

2) I also have a non-Access question that I am putting here so I don't have to start another thread. I put in the followoing code ("Ruby script/generate model book") into the command line to create a model called book....but I get a RunTime Error. How do I fix this?

Parakash

---

<div class="post-metadata">

**Author:** ![PAZAZ](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@PAZAZ](https://discuss.rubyonrails.org/u/PAZAZ)\
**Post date:** [February 19, 2008, 8:46pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/7 "2008-02-19T20:46:03Z")

</div>

Actually I am finding some things related to ADO and Access .... but I am not sure how to write code to link ADO (or an existing Access database) with ROR?

---

<div class="post-metadata">

**Author:** ![Abdullah\_Jibaly](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Abdullah\_Jibaly](https://discuss.rubyonrails.org/u/Abdullah_Jibaly)\
**Post date:** [February 19, 2008, 9:04pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/8 "2008-02-19T21:04:13Z")

</div>

You may have to use create a DSN for your access database and use ODBC:

[http://odbc-rails.rubyforge.org/](http://odbc-rails.rubyforge.org/)

If all you want is to have the database stored with the application (like mydatabase.mdb) then just use SQLite, the default db with rails 2.0. It will store the file as mydatabase.sqlite. I like SQLite Manager, the gui that comes as a firefox extension:

[https://addons.mozilla.org/en-US/firefox/addon/5817](https://addons.mozilla.org/en-US/firefox/addon/5817)

Hope that helps, Abdullah

---

<div class="post-metadata">

**Author:** ![Wayne\_M](https://avatars.discourse-cdn.com/v4/letter/w/a698b9/32.png) [@Wayne\_M](https://discuss.rubyonrails.org/u/Wayne_M)\
**Post date:** [February 19, 2008, 9:35pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/9 "2008-02-19T21:35:21Z")

</div>

For your second question, what is the error you’re getting? That would help us narrow it down and offer suggestions on how to fix it 😉

- Wayne

---

<div class="post-metadata">

**Author:** ![PAZAZ](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@PAZAZ](https://discuss.rubyonrails.org/u/PAZAZ)\
**Post date:** [February 19, 2008, 9:43pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/10 "2008-02-19T21:43:16Z")

</div>

I went ahead and downloaded the program from the first link below. I don't use Firefox so i don't think the second link will be useful for me. I am not that familiar with DSNs or OBDCs but will try to see what I can do. Thanks.

---

<div class="post-metadata">

**Author:** ![Rob\_Saul](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@Rob\_Saul](https://discuss.rubyonrails.org/u/Rob_Saul)\
**Post date:** [February 20, 2008, 5:25am UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/11 "2008-02-20T05:25:56Z")

</div>

PAZAZ wrote:

> I would prefer finding a way to connect ROR with MS Access so that if a web application is built....I can take data from MS Access and put it into ROR or vice versa. Any ideas? Would this be easier with MySQL?

Regarding MS Access, I'd say don't. The SQL engine in Access is hobbled compared to MySQL,PostgrSQL,Oracle,...

Also, a friend and I have both seen larger Access databases have serious stability issues.

---

<div class="post-metadata">

**Author:** ![GoodbyeJava](https://avatars.discourse-cdn.com/v4/letter/g/4491bb/32.png) [@GoodbyeJava](https://discuss.rubyonrails.org/u/GoodbyeJava)\
**Post date:** [February 20, 2008, 7:20am UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/12 "2008-02-20T07:20:56Z")

</div>

I agree. It's really time for you to outgrow MS Access. Access is not a server class database. Although you may be able to make it function through ODBC, it's just not worth it in the long run. MySQL or PostgreSQL are great free and open source solutions that will serve you well. Invest the time to learn one or both of them. You won't regret it.

---

<div class="post-metadata">

**Author:** ![BernieOnRails](https://avatars.discourse-cdn.com/v4/letter/b/7ab992/32.png) [@BernieOnRails](https://discuss.rubyonrails.org/u/BernieOnRails)\
**Post date:** [February 20, 2008, 3:05pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/13 "2008-02-20T15:05:28Z")

</div>

I't been a long time since I've worked with ODBC, etc. (and I'm glad about that to be honest), but I remember one thing MS had down right was their db tools. I remember a somewhat sophisticated--and I dare say intuitive--GUI to move all kinds of data around, from one source to another.

I'd recommend building your schemas in Rails, using something like MySQL--and then, after you've done your initial rake db:migrate, connect to your MySQL db, via ODBC and import your data from Access into mysql. Trust me, you'll be glad you spend the minimal hours required to do this step.

-BK

---

<div class="post-metadata">

**Author:** ![PAZAZ](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@PAZAZ](https://discuss.rubyonrails.org/u/PAZAZ)\
**Post date:** [February 20, 2008, 5:50pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/14 "2008-02-20T17:50:07Z")

</div>

Thanks for all the replies. The reason I am mentioning Access is b/c I work in a medical department where we use only Access b/c we really don't need the large data capabilities of MySQL and the databases were created many years back in Access 2000, which serves our needs fine.

But since I am new to ROR and am interested in building my own applications, I will look into MySQL.

For the question #2 below (which I am pasting below this line)....

2) I also have a non-Access question that I am putting here so I don't have to start another thread. I put in the followoing code ("Ruby script/generate model book") into the command line to create a model called book....but I get a RunTime Error. How do I fix this?

...this is from a tutorial I am doing to learn ROR and the tutorial says to create the model book with the one line code above....but when I put this into the command interface I get a long RunTime Error.

---

<div class="post-metadata">

**Author:** ![PAZAZ](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@PAZAZ](https://discuss.rubyonrails.org/u/PAZAZ)\
**Post date:** [February 20, 2008, 5:53pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/15 "2008-02-20T17:53:45Z")

</div>

More specifically (this is in reference to the error I am getting on Question 2 above) the error I get says (("no such file to load....active record/connection\_adapters/access\_adapter)RunTime Error")

Not sure how to get past this?

---

<div class="post-metadata">

**Author:** ![Steve\_Ross](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@Steve\_Ross](https://discuss.rubyonrails.org/u/Steve_Ross)\
**Post date:** [February 20, 2008, 6:37pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/16 "2008-02-20T18:37:18Z")

</div>

I don’t mean to pick on you, but please start new threads so the subjects are easier to spot, sort, and Google. If it’s not about Access, it should not have Access in the subject.

It will really help the next person with the same question.

Thx

---

<div class="post-metadata">

**Author:** ![Frederick\_Cheung](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/frederick_cheung/32/3901_2.png) [@Frederick\_Cheung](https://discuss.rubyonrails.org/u/Frederick_Cheung)\
**Post date:** [February 20, 2008, 6:56pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/17 "2008-02-20T18:56:54Z")

</div>

> 2) I also have a non-Access question that I am putting here so I don't have to start another thread. I put in the followoing code ("Ruby script/generate model book") into the command line to create a model called book....but I get a RunTime Error. How do I fix this?
> 
> ...this is from a tutorial I am doing to learn ROR and the tutorial says to create the model book with the one line code above....but when I put this into the command interface I get a long RunTime Error.

As others have said you really need to tell us exactly what the error  
is. It's probably just a missing library or something, but without  
seeing the error it's hard to say which library is missing.

Fred

---

<div class="post-metadata">

**Author:** ![lq1](https://avatars.discourse-cdn.com/v4/letter/l/ecc23a/32.png) [@lq1](https://discuss.rubyonrails.org/u/lq1)\
**Post date:** [February 20, 2008, 7:08pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/18 "2008-02-20T19:08:10Z")

</div>

caused by adapter: access in your database.yml, while no access adapter available. Simplest fix I can imagine is to use sqlite adapter along with sqlite gem installed.

---

<div class="post-metadata">

**Author:** ![PAZAZ](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@PAZAZ](https://discuss.rubyonrails.org/u/PAZAZ)\
**Post date:** [February 20, 2008, 7:48pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/19 "2008-02-20T19:48:56Z")

</div>

Can i use sqlite adapter or sqlite gem if I don't use firefox and only use Windows?

---

<div class="post-metadata">

**Author:** ![lq1](https://avatars.discourse-cdn.com/v4/letter/l/ecc23a/32.png) [@lq1](https://discuss.rubyonrails.org/u/lq1)\
**Post date:** [February 20, 2008, 10:01pm UTC](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144/20 "2008-02-20T22:01:20Z")

</div>

well... yes.

[Next page](https://discuss.rubyonrails.org/t/ruby-on-rails-and-ms-access/25144.md?page=2)
