PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Table Query - how to stop the query from executing when page load
Table Query - how to stop the query from executing when page load
Iniciado por guest, 20,mar. 2015 11:48 - 2 respuestas
Publicado el 20,marzo 2015 - 11:48
Hi,

I have a table content to a query in webdev and the query will execute by itself when the page load.

How to make it don't run the query ?

The reason is that it will take some time for it to load and i want to end user to click on a button to run the query,

Regards,

Peter Zhou
Publicado el 20,marzo 2015 - 12:47
Hi Peter,

In such cases I feed the query an initial parameter that has a non existing value such as -1 for an identifier.
The query will return no records and run very fast.

Regards,
Piet
Publicado el 20,marzo 2015 - 13:53
Hi Peter,

The solution of Piet is the simplest which I also use in some cases.

The other solution is to set the property ..BrowsedFile empty (in the page declaration code). Then when the user clicks on a button, you set the property to the desired query. We use this technique in many cases.

Here is a small example of that last option:

TABLE..BrowsedFile="" REQ.sParam1 = "MyParam" IF NOT HExecuteQuery(REQ,hQueryDefault) THEN Error() RESULT False END TABLE..BrowsedItem = "" TABLE..BrowsedFile = "REQ"
Best regards,
Alexandre Leclerc