# DBI ADO problem

**URL:** <https://www.ruby-forum.com/t/dbi-ado-problem/50277>\
**Category:** Ruby\
**Created:** [December 14, 2005, 8:13pm UTC](https://www.ruby-forum.com/t/dbi-ado-problem/50277 "2005-12-14T20:13:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@marke](https://www.ruby-forum.com/u/marke)\
**Post date:** [December 14, 2005, 8:13pm UTC](https://www.ruby-forum.com/t/dbi-ado-problem/50277/1 "2005-12-14T20:13:28Z")

</div>

I was wondering if this exception thrown by my use of DBI ADO is  
meaningful  
to anyone?

c:/ruby/lib/ruby/site\_ruby/1.8/DBD/ADO/ADO.rb:141:in `finish': undefined method`Fields’ for nil:NilClass (NoMethodError)  
from c:/ruby/lib/ruby/site\_ruby/1.8/dbi/dbi.rb:789:in `finish' from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:631:in`prepare’

I’m simply trying to call prepare on a method and this looks like some  
kind  
of internal error within the ADO implementation.

---

<div class="post-metadata">

**Author:** ![marke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@marke](https://www.ruby-forum.com/u/marke)\
**Post date:** [May 18, 2008, 1:24am UTC](https://www.ruby-forum.com/t/dbi-ado-problem/50277/2 "2008-05-18T01:24:57Z")

</div>

Yes, because I’m getting something similar. However I was using win32ole  
directly with the ADO COM objects, using a prepared command, thus  
creating and adding parameters.

I can give my version of code if someone needs it.

I looked all over the internet (translation: googled) and couldn’t find  
someone who tried to do one of two things: Pass in a nil (NULL on the  
DB side) parameter, specified the default value (not sure if there _is_  
a way to do that using ADO, but the FIELDS of the record sets looked  
promising), or specified a “no value” for that fields which might allow  
the SQLServer provider to use the default.

BTW, a similar error happened when setting a recordset field to nil.

So I’ll piggy back on your question ;).

Related, if someone could use the WIN32OLE ADO api to specify a date,  
that would be awesome also 😉

Ger.

Mark E. wrote:

> I was wondering if this exception thrown by my use of DBI ADO is  
> meaningful  
> to anyone?
> 
> c:/ruby/lib/ruby/site\_ruby/1.8/DBD/ADO/ADO.rb:141:in `finish': undefined method`Fields’ for nil:NilClass (NoMethodError)  
> from c:/ruby/lib/ruby/site\_ruby/1.8/dbi/dbi.rb:789:in `finish' from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:631:in`prepare’
> 
> I’m simply trying to call prepare on a method and this looks like some  
> kind  
> of internal error within the ADO implementation.
