From: Christoph Rippel Date: 2001-01-10T14:02:48+09:00 Subject: [ruby-talk:8981] Re: Database access with ADO > -----Original Message----- > From: David Naseby [mailto:dnaseby@affinityforbusiness.com] > Sent: Tuesday, January 09, 2001 07:22 PM > To: ruby-talk ML > Subject: [ruby-talk:8976] Re: Database access with ADO > > > Thanks for the quick response, but I tried this code > > From: Ernest Ellingson [mailto:erne@powernav.com] > > require 'win32ole' > > oConn=WIN32OLE.new('ADODB.Connection') > > oConn.ConnectionString="DSN=xxxxx;uid=xxxx;pwd=xxxx" > > oConn.Open > > rs=oConn.Execute("SQLString") > > (of course, substituting the xxxxx and SQLString), and I got the following > error: > ado2.rb:4:in 'method missing': Open (RuntimeError) > OLE rb_compile_error:80004005 in Microsoft OLE DB Provider for ODBC > Drivers > [Microsoft][ODBC Driver Manager] Data source name not found and no > default driver specified > Exception occurred > from ado2.rb:4 > > The code worked (with the usual conversions) in a VBScript file. > > David Naseby Hi, I successfully run the Excel's examples with 1.6.2 - however the cygwin rubies have problem stemming from problem of cygwin it self I believe (you might be thinking of installing cygwin if you want to run ruby on windows IMO). For example, consider the following dirty MultiSet script - it works fine for small m,n =1000,1200 but the behavior is non-deterministic for bigger m,n. (My setup is W2K SP1 with cgwin 1.1.7 ... ) # this either finishes quickly or never finishes # or core dumps - its more likely to crash if initialize # like this # n = 10000 # m = 12000 # instead of # m,n = 10000, 12000 # weird! n,m = 10000,12000 x = Array.new m y = Array.new n x.collect! { |i| rand(n).floor } y.collect! { |i| rand(m).floor } def nil.succ # you should not use this in real life 1 end def min(n,m) n < m ? n : m end mx={} x.each do |i| mx[i] = mx[i].succ end my = {} y.each do |i| my[i] = my[i].succ end mxy={} mx.each_key do |i| if my[i] mxy[i] = min(mx[i],my[i]) end end puts mx.keys.size puts my.keys.size puts mxy.keys.size Christoph