On Wed, Jul 10, 2002 at 10:48:26AM +0900, kk wrote:
> Can anyone tell me why I get this error when I access a database
> (MSSQL Server 2K)using DBI:ODBC? :
> 
> irb(main):008:0> URL = 'DBI:ODBC:slxwork', 'sysdba', 'masterkey'
> ["DBI:ODBC:slxwork", "sysdba", "masterkey"]
> irb(main):009:0> URL = 'DBI:ODBC:slxwork'
> "DBI:ODBC:slxwork"
> irb(main):010:0> dbh = DBI.connect(URL, 'sysdba', 'masterkey')
> #<DBI::DatabaseHandle:0xd063e0
> @handle=#<DBI::DBD::ODBC::Database:0xd06338
> @handle=#<ODBC::Database:0xd063b0>, @attr={}>,
> @trace_output=#<RW_CONSOLE:0x8eacc0>, @trace_mode=2>
> irb(main):011:0> rows = dbh.select_all("SELECT * FROM ACCOUNT")
> TypeError: no implicit conversion from string
> 	from C:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:714:in `[]'
> 	from C:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:714:in `column_names'
> 	from C:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:714:in `collect'
> 	from C:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:714:in `each'
> 	from C:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:714:in `collect'
> 	from C:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:714:in `column_names'
> 	from C:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:665:in `initialize'
> 	from C:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:553:in `new'
> 	from C:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:553:in `execute'
> 	from C:/ruby/lib/ruby/site_ruby/1.6/dbi/dbi.rb:584:in `select_all'
> 	from (irb):11

Which version of Ruby/DBI do you use?


Regards,

  Michael