I think that sth contains the number of rows returned fro mthe query
if you change your second line from

sth.execute("SELECT * FROM DATA").fetch do |row|


to 

dbh.execute("SELECT * FROM DATA").fetch do |row|

It might be what you want

Paul


----- Original Message -----
From: Eric Nachman <[EMAIL PROTECTED]>
Date: Monday, May 29, 2006 9:24 am
Subject: [Wtr-general] newbie help

> Ok,
> 
> I am trying to do something real simple, but I can't
> figure it out. I am trying to run a querry against an 
> MsAccess database using ODBC. I am connecting via
> Database but I can't get the querry to run. Any ideas?
> 
> Below is the error I am getting:
> 
> login.rb:25: undefined method `execute' for -1:Fixnum
> (NoMethodError)
> 
> code is:
> dbh=ODBC::connect('MyData')
> 
> sth=dbh.do("SELECT * FROM DATA")
> sth.execute("SELECT * FROM DATA").fetch do |row|
> 
> I am sure it something easy. But any help will be
> appreciated.
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
> 
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to