<p>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?</p>

<p><em>Later:</em></p>

<p>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.</p>

[{'answer_id': 20072, 'author': 'John Topley', 'author_id': 1450, 'author_profile': 'https://Stackoverflow.com/users/1450', 'pm_score': 3, 'selected': True, 'text': '<p>It\'s a long shot but there\'s an <a href="http://odbc-rails.rubyforge.org/" rel="nofollow noreferrer">ODBC adapter for ActiveRecord</a> that might work.</p>\n'}, {'answer_id': 20119, 'author': 'Kyle Boon', 'author_id': 1486, 'author_profile': 'https://Stackoverflow.com/users/1486', 'pm_score': 1, 'selected': False, 'text': '<p>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.</p>\n'}, {'answer_id': 20179, 'author': 'wusher', 'author_id': 1632, 'author_profile': 'https://Stackoverflow.com/users/1632', 'pm_score': 1, 'selected': False, 'text': "<p>There are some wierd things in Access that might cause issues and I don't know if ODBC takes care of it. If it does @John Topley is right, ODBC would be your only cance. </p>\n\n<ol>\n<li>True in access = -1 not 1</li>\n<li>Access treats dates differently than regular TSQL.</li>\n<li>You might run into trouble creating relations. </li>\n</ol>\n\n<p>If you go with access, will probably learn more about debuging AcriveRecord then you ever cared to ( which might not be a bad thing) </p>\n"}, {'answer_id': 20940, 'author': 'James A. Rosen', 'author_id': 1190, 'author_profile': 'https://Stackoverflow.com/users/1190', 'pm_score': 2, 'selected': False, 'text': '<p>There seems to be something of an Access connection adapter here: <a href="http://svn.behindlogic.com/public/rails/activerecord/lib/active_record/connection_adapters/msaccess_adapter.rb" rel="nofollow noreferrer">http://svn.behindlogic.com/public/rails/activerecord/lib/active_record/connection_adapters/msaccess_adapter.rb</a></p>\n\n<p>The database.yml file would look like this:</p>\n\n<pre><code>development:\n  adapter: msaccess\n  database: C:\\path\\to\\access_file.mdb\n</code></pre>\n\n<p>I\'ll post more after I\'ve tried it out with Rails 2.1</p>\n'}, {'answer_id': 23657, 'author': 'ryw', 'author_id': 2477, 'author_profile': 'https://Stackoverflow.com/users/2477', 'pm_score': 0, 'selected': False, 'text': '<p>You should really talk them into allowing SQLite. It is super-simple to setup, and operates like Access would (as a file sitting next to the app on the same server).</p>\n'}, {'answer_id': 23832, 'author': 'Orion Edwards', 'author_id': 234, 'author_profile': 'https://Stackoverflow.com/users/234', 'pm_score': 0, 'selected': False, 'text': '<p>Firstly, you <em>really</em> want to be using sqlite.</p>\n\n<p>In my experience Access itself is a pile of [redacted], but the Jet database engine it uses is actually pretty fast and can handle some pretty complex SQL queries. If you can find a rails adapter that actually works I\'d say you\'ll be fine. Just don\'t open the DB with the access frontend while your rails app is running :-)</p>\n\n<p>If your client is anal enough to only allow you to develop with an approved list of databases, they may be more concerned by the fact that <a href="http://aspalliance.com/14_Microsoft_Jet_database_engine_advice" rel="nofollow noreferrer">Jet is</a> <a href="http://en.wikipedia.org/wiki/Microsoft_Jet_Database_Engine" rel="nofollow noreferrer">deprectated</a> and will get no more support from MS.</p>\n\n<p>This might give you some ammunition in your quest to use a real database. Good luck</p>\n'}, {'answer_id': 67600, 'author': 'David-W-Fenton', 'author_id': 9787, 'author_profile': 'https://Stackoverflow.com/users/9787', 'pm_score': 1, 'selected': False, 'text': "<p>Maudite wrote:</p>\n\n<blockquote>\n  <p>True in access = -1 not 1</p>\n</blockquote>\n\n<p>Not correct. True is defined as not being false. So, if you want to use True in a WHERE clause, use Not False instead. This will provide complete cross-platform compatibility with all SQL engines.</p>\n\n<p>All that said, it's hardly an issue, since whatever driver you're using to connect to your back end will properly translate True in WHERE clauses to the appropriate value. The only exception might be in passthrough queries, but in that case, you should be writing the SQL outside Access and testing it against your back end and just pasting the working SQL into the SQL view of your passthrough query in Access.</p>\n\n<p>Maudite wrote:</p>\n\n<blockquote>\n  <p>Access treats dates differently than regular TSQL.</p>\n</blockquote>\n\n<p>Again, this is only going to be an issue if you don't go through the ODBC or OLEDB drivers, which will take care of translating Jet SQL into TSQL for you.</p>\n\n<p>Maudite wrote:</p>\n\n<blockquote>\n  <p>You might run into trouble creating relations.</p>\n</blockquote>\n\n<p>I'm not sure why you'd want an Access application to be altering the schema of your back end, so this seems to me like a non-issue.</p>\n"}]
['https://Stackoverflow.com/questions/20054', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1190/']