From: arthur8@... (Arthur) Date: 2003-04-14T11:16:03+09:00 Subject: Re: DBI and MSAccess A quick follow-up to this ealier question, which I am now facing: Since Access is not required to be install in order to use DBI to access the database, can I then: (1) Move the Access .mdb file to a Linux box (2) Use DBI to access the .mdb file on Linux I am not very familiar with ODBC. It certainly appears to be required to access MS databases on Windows, but how about on Linux? Does the Ruby DBI module include an ODBC driver for Linux? Thanks, Arthur debitsch@t-online.de (Rasmus) wrote in message news:<1289054f.0303200823.31d51e5@posting.google.com>... > Thanks to all trying to help me. > > Here is what I figured out: > - The ODBC module of DBD can't handle DSN-less connection. > - I solved the problen by two methods: > (1) Create a DSN and using the DSN in the connection > (2) Changing the connect method in ODBC.rb to > > def connect(dbname, user, auth, attr) > if dbname.split(';').length > 1 > # DSNless connection > drv = ::ODBC::Driver.new; > drv.name = 'DSNless' > dbname.split(';').each do |param| > pv = param.split('='); > if pv.length < 2 > next > end > drv.attrs[pv[0]] = pv[1] > end > db = ::ODBC::Database.new > handle = db.drvconnect(drv) > return Database.new(handle, attr) > else > # DSN given > handle = ::ODBC.connect(dbname, user, auth) > return Database.new(handle, attr) > end > rescue ODBCErr => err > raise DBI::DatabaseError.new(err.message) > end > end > > and using the DSN-less connection > > db=DBI.connect('DBI:ODBC:driver=Microsoft Access Driver (*.mdb); > dbq=path_of_my_database.mdb') > > in my program. > > Rasmus > > > > "Rasmus Debitsch" wrote in message news:... > > I want to access a MSAccess database with Ruby. I'm new to databases and > > Ruby, so my question is quite basic. > >