Database Query Builder: workaround please

Alex Rice alex at mindlube.com
Thu Nov 13 10:47:01 EST 2003


On Nov 13, 2003, at 12:56 AM, David Wilkinson wrote:

> This behaviour is observable in 2.0.1, although perhaps not as
> severely.
>
> My experience is that there appear to be three iterations of the
> query loop, and they are repeated for each object on the card that
> is attached to the query.  Each iteration produces the error message.
>
> FWIW, deleting the query seems to fix the problem here.

David, I think you are talking about something else. What I am seeing 
is a bug. A GUI bug, and doesn't have anything to do with the query 
loop going for 3 iterations.

On the Database Query Builder, Record Set Tab, SQL query field:

1) enter some syntactically bad SQL
2) click the refresh query button (or close the Database Query Builder 
window)
3) now Rev gets stuck in an endless loop of modal error dialogs.

The problem is this code in revDBQuerySetup stack / recordSet card. The 
SQL is evaluated, causing a modal error dialog, causing the keyboard 
focus to leave the field, then reenter it the field. Then another 
closeField fires, another modal error dialog. Endlessly.

on closefield
   put the cActiveQuery of this stack into tActiveQuery
   put revQueryLongName(tActiveQuery) into tObjects
   revSetSQLOfQuery tObjects,the text of me
   if revCursorOfQuery(tObjects) is not empty then
     revUpdateRecordSourceDetails
   else
     set the label of button "cREVDatabaseQuery[primarykey]" to "None"
     disable button "cREVDatabaseQuery[primarykey]"
   end if
end closefield

So Runrev- the Database Query builder is effectively useless. How about 
a fix? I can't just comment out the handler, because then the query is 
not evaluated at all.

Alex Rice <alex at mindlube.com> | Mindlube Software | 
<http://mindlube.com>

what a waste of thumbs that are opposable
to make machines that are disposable  -Ani DiFranco



More information about the use-livecode mailing list