I just realised I misread your original email. It was returning -1, not the 
1 that I saw.

this is some code I have used. It wasnt for access, but that may not matter

connection =  DBI.connect("DBI:ODBC:[EMAIL PROTECTED]" , @userName , @password)
a_2d_array = connection.select_all(sql)

the select all returns a 2 d array of the data. Ive also used fetch as well, 
but couldnt find the code for that

Paul



----- Original Message ----- 
From: "Eric Nachman" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, May 30, 2006 9:30 PM
Subject: Re: [Wtr-general] newbie help


> Thanks Paul,
>
> It did not work, any other ideas. It like it does not
> recognize the execute, or fetch commands..
>
> e
> --- Paul Rogers <[EMAIL PROTECTED]> wrote:
>
>> 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
>>
>
>
> __________________________________________________
> 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