From: Robert Klemme Date: 2009-10-27T23:31:59+09:00 Subject: Re: SQL Shell for MS Access 2009/10/27 Paul Smith : > 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. Oh, OK, ODBC is a different story. I didn't think of that. > 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&gl=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&sig=-Vk-Jpfm0f_LlS5z-AaCKw67NGU&hl=en&ei=8MzmSpmeLZXSjAediLW1CA&sa=X&oi=book_result&ct=result&resnum=1&ved=0CA4Q6AEwAA#v=onepage&q=&f=false >> Having said that, you can use OpenOffice to open mdb files and also >> execute queries against it. > > Maybe this is the right way to go, I just really like the command > line, as I'm used to working with mysql, and there you can just fire > up mysql-client, get a mysql> prompt, and start typing things like > show tables to list all the tables in the db, desc table to describe > the layout of a given table. You could as well try a generic DB client (e.g. SQirreL) which should also be capable of making use of Access's ODBC driver via the JDBC ODBC bridge (although that is not perfect as well). Maybe there's also a native Windows ODBC SQL client around that you could use. > I'm just trying to make working with MS Access feel more like working > with mysql :) Seems like you are forced to work with MS Access. I would try to avoid it if possible. :-) Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/