From: Paul Smith Date: 2009-10-28T01:57:18+09:00 Subject: Re: SQL Shell for MS Access On Tue, Oct 27, 2009 at 4:31 PM, wrote: > >> -----Original Message----- >> From: paulsmithenator@gmail.com [mailto:paulsmithenator@gmail.com] >> On Behalf Of Paul Smith >> Sent: Tuesday, October 27, 2009 8:18 AM >> To: ruby-talk ML >> Subject: Re: SQL Shell for MS Access >> >> On Tue, Oct 27, 2009 at 1:01 PM, Robert Klemme >> wrote: >> > 2009/10/27 Paul Smith : >> >> What I want is an SQL command prompt allowing me to run SQL >> queries >> >> against an Access .mdb. >> >> >> >> I thought that Ruby/DBI included a sqlsh.rb script that >> essentially >> >> did this, but no matter how I install Ruby/DBI I can't find the >> SQL >> >> shell that I want. >> >> >> >> So - does Ruby/DBI even include an SQL shell anymore?  Is there >> >> another way to get an SQL prompt for MS Access in a similar way >> to >> >> what you can do with mysql for example? >> > >> > I doubt Ruby/DBI ever included what you need.  In order to be >> able to >> > directly run SQL against an mdb file you need any DB engine. >>  Ruby/DBI >> > is just an interfacing layer and does not include anything like a >> > complete DB engine. >> >> Well, to be more complete, Ruby/DBI using a ruby-odbc DBD to >> connect >> out to an access database. >> >> This cached page >> http://209.85.229.132/search?q=cache:oks0dAPyNbQJ:doc.gnu- >> darwin.org/dbi/html/+ruby/dbi+sql+command+line&cd=9&hl=en&ct=clnk&g >> l=uk&client=firefox-a >> suggests that sqlsh.rb did indeed once exist. >> >> Page 137, Chapter 3 of "Accessing Databases with Ruby" also >> describes >> what I want - >> http://books.google.co.uk/books?id=SvTuCXEKBvkC&pg=PA137&lpg=PA137& >> dq=ruby+ms+access+interactive+sql+client&source=bl&ots=SPgHkn7a76&s >> ig=-Vk-Jpfm0f_LlS5z- >> AaCKw67NGU&hl=en&ei=8MzmSpmeLZXSjAediLW1CA&sa=X&oi=book_result&ct=r >> esult&resnum=1&ved=0CA4Q6AEwAA#v=onepage&q=&f=false >> > > According to this page: http://ruby-dbi.rubyforge.org/git?p=ruby-dbi.git;a=commit;h=556e08726d9716e5b06d558b8250eb9f0d06df9e > 'sqlsh.rb' was renamed to 'dbi'.  You should find a 'dbi' file in the same directory where 'ruby' is installed.  Of course, there have been changes to 'dbi' since this change was made, but it's a place to start. Brilliant! Thanks so much for finding that, I had given up :) Now I just need to get ruby-odbc working with Ruby 1.9 on windows... or install Ruby 1.8.6. It's looking like the latter is the better option from here. -- Paul Smith http://www.nomadicfun.co.uk paul@pollyandpaul.co.uk