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" <Debitsch / T-Online.de> wrote in message news:<b4o3eg$kpn$04$1 / news.t-online.com>...
> I want to access a MSAccess database with Ruby. I'm new to databases and
> Ruby, so my question is quite basic.
> 
> When I try to connect to the database with DBI a error message shows up. I
> have no idea if there is something wrong with my code or my system
> configuration. Perhaps someone can provide a working code fragment?
> 
> Environment:
> Windows ME, MSAccess not installed
> Ruby 173-7
> A mbd file
> 
> Code:
> require 'dbi'
> 
> dbq = "dbq=C:/Benutzer/Test.mdb"
> dsn = "driver=Microsoft Access Driver(*.mdb);#{dbq}"
> 
> DBI.connect("DBI:ODBC:#{dsn}","","")
> 
> Error:
> C:/PROGRAMME/RUBY/lib/ruby/site_ruby/1.7/DBD/ODBC/ODBC.rb:71:in `connect':
> S1090 (0) [Microsoft][ODBC Driver Manager] Ung?ltige Zeichenfolgen- oder
> Pufferl?nge. (DBI::DatabaseError)
>  from C:/PROGRAMME/RUBY/lib/ruby/site_ruby/1.7/dbi/dbi.rb:496:in `connect'
>  from C:/PROGRAMME/RUBY/lib/ruby/site_ruby/1.7/dbi/dbi.rb:322:in `connect'
> 
> -
> Rasmus