Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any tips on getting Rails to run with an Access back-end?

I shudder to ask, but my client might offer no other SQL (or SQL-like) solution. I know Access has some SQL hooks; are they enough for basic ActiveRecord?

Later:

I appreciate all the suggestions to use other databases, but trust me: I've tried convincing them. There is an "approved" list, and no SQL databases are on it. Getting something onto the list could take more than a year, and this project will be done in three weeks.

like image 388
James A. Rosen Avatar asked Aug 21 '08 14:08

James A. Rosen


3 Answers

It's a long shot but there's an ODBC adapter for ActiveRecord that might work.

like image 108
John Topley Avatar answered Sep 27 '22 21:09

John Topley


There seems to be something of an Access connection adapter here: http://svn.behindlogic.com/public/rails/activerecord/lib/active_record/connection_adapters/msaccess_adapter.rb

The database.yml file would look like this:

development:
  adapter: msaccess
  database: C:\path\to\access_file.mdb

I'll post more after I've tried it out with Rails 2.1

like image 28
James A. Rosen Avatar answered Sep 27 '22 22:09

James A. Rosen


Another option that is more complicated but could work if you were forced to do it, is to write a layer of RESTful web services that will expose Access to rails. If you are careful in your design, those RESTful web services can be consumed directly by ActiveResoure which will give you a lot of the functionality of ActiveRecord.

like image 37
Kyle Boon Avatar answered Sep 27 '22 21:09

Kyle Boon