revQueryDatabase

Jan Schenkel janschenkel at yahoo.com
Mon Dec 18 16:04:24 EST 2006


--- Robert Mann <robmann at gp-racing.com> wrote:
> I am having a problem with revQueryDatabase
> returning a number when it
> should not be I think?
> In the following sql statement if there is no
> wt_springcalc.year_model='" &
> gyearmodel & "' curID should not be a number?
> 
> 
> put "SELECT * FROM wt_springcalc WHERE
> wt_springcalc.year_model='" &
> gyearmodel & "' and wt_springcalc.company_id='1'"
> into theSQL
> put revQueryDatabase(dbID2, theSQL) into curID
> put curID into fld "curIDnum"
> 
> IF curID is a number THEN
> put revDatabaseColumnNamed(curID,"fr_mx_multiplier")
> into fld "frmxm1"
> 
> ELSE
> put curID into fld "error"
> exit mouseUp
> 
> END IF
> 
> 
> What happens is curID is returned as a number then
> when the
> revDatabaseColumnNamed(curID,"fr_mx_multiplier")
> into fld "frmxm1" executes
> it puts ”revdberr,invalid column number” in the fld
> and then rev shuts down
> 
> Not sure where I have gone wrong?
> 
> 
> Thanks
> Robert Mann
> 

Hi Robert,

The above looks correct to me, and I've used this
approach for ages to fetch data and extract individual
columns. And the RevDB library should definitely not
crash Revolution.

A few things to check:
- did you use the correct column name? (use the
function 'revDatabaseColumnNames' to display a list)
- are there any results in your record set? (use the
function 'revNumberOfRecords' to find out - beware
that this doesn't work for ODBC databases at the
moment)

You may want to file a bugzilla report that this leads
to a crash. Make sure to send along the crash report
so they can try and figure it out.

Hope this helped,

Jan Schenkel.

Quartam Reports for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the use-livecode mailing list