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

--- Robert Mann <robmann at> 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"
> put curID into fld "error"
> exit mouseUp
> 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

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

"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 

More information about the Use-livecode mailing list