PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Window/Table initialization code
Window/Table initialization code
Started by Martin Brekhof, Aug., 09 2004 10:13 AM - 7 replies
Posted on August, 09 2004 - 10:13 AM
I have a mdi-child-window that has a tab control with 11 tabs, on two of these tabs I have a table control that gets their data from two different queries.
Somehow I get the error message 'Unable to initialize 'Table_qryContactpersoon' control, hyper file error : qryContactpersoon file unknown in analysis. Placing a HExecuteQuery(qryContactPersoon,hQueryDefault,"11")in the Table initialization event makes it go away.
What I do not understand:
- the second table uses exact the same query (slightly different WHERE) and gives no error
- ingnoring the error has no negative consequences, the screen works perfectly afterwards (including this table control).
Related mystifying behaviour:
- Using 'qryOrga.org_code' from the master screen instead of "11" in the table initialization event (in the HExecuteQuery mentioned above) gives an error, using it in the 'whenever modified' event of the Tab control it works great.
By the way, what I really would like is the table controls not to open the related queries until needed, is this possible?
regards,
Martin
Posted on August, 09 2004 - 1:44 PM
Everyone - sorry for the erroneous posting again, seem unable to contol my fingers this morning.
Martin,
I have just had this frustrating experience too.
If you do not want to open execute the queries then I think you will need to open a new window when you click on the tab. I have done this before - create the subordinate window with no title bar and a single border, and then fiddle with the relative position of it until it just fits the tab and looks as if it is not a window at all!
You probably do not want to do this.
Regards,
Andy
I have a mdi-child-window that has a tab control with 11 tabs, on two of these tabs I have a table control that gets their data from two different queries.
Somehow I get the error message 'Unable to initialize 'Table_qryContactpersoon' control, hyper file error : qryContactpersoon file unknown in analysis. Placing a HExecuteQuery(qryContactPersoon,hQueryDefault,"11")in the Table initialization event makes it go away.
What I do not understand:
- the second table uses exact the same query (slightly different WHERE) and gives no error
- ingnoring the error has no negative consequences, the screen works perfectly afterwards (including this table control).
Posted on August, 09 2004 - 3:15 PM
>You probably do not want to do this.
Thanks, it's a solution anyway. Submitted my question to PCSoft, I'll see what they have to say.
regards,
Martin
Posted on August, 09 2004 - 3:17 PM
window over a tab ? - not a very elegant way, sorry !
The table init code is executed as soon as you open the window, so if you want to prevent this, you should not place the query in the table init but at the place where you click the tab (or wherever it makes sense)
I have such windows with different tables on each tab and 9 of 10 times the users just uses the first tab, so there is no need to fill this tables before switching to the tab.
If you have a table and you choose automatic handling, then there is (or i know) no way to prevent the filling at window opening. in this case it's better to fill by programming or to use a memory table.
heinz
Everyone - sorry for the erroneous posting again, seem unable to contol my fingers this morning.
Martin,
I have just had this frustrating experience too.
If you do not want to open execute the queries then I think you will need to open a new window when you click on the tab. I have done this before - create the subordinate window with no title bar and a single border, and then fiddle with the relative position of it until it just fits the tab and looks as if it is not a window at all!
You probably do not want to do this.
Regards,
Andy
I have a mdi-child-window that has a tab control with 11 tabs, on two of these tabs I have a table control that gets their data from two different queries.
Somehow I get the error message 'Unable to initialize 'Table_qryContactpersoon' control, hyper file error : qryContactpersoon file unknown in analysis. Placing a HExecuteQuery(qryContactPersoon,hQueryDefault,"11")in the Table initialization event makes it go away.
What I do not understand:
- the second table uses exact the same query (slightly different WHERE) and gives no error
- ingnoring the error has no negative consequences, the screen works perfectly afterwards (including this table control).
Posted on August, 09 2004 - 6:40 PM
Heinz,
inelegant, I agree.
Sometimes filling by programming or using a memory table is not desirable.
Regards,
Andy
window over a tab ? - not a very elegant way, sorry !
If you have a table and you choose automatic handling, then there is (or i know) no way to prevent the filling at window opening. in this case it's better to fill by programming or to use a memory table.
Posted on August, 10 2004 - 3:48 PM
I have a mdi-child-window that has a tab control with 11 tabs, on two of these tabs I have a table control that gets their data from two different queries.
Somehow I get the error message 'Unable to initialize 'Table_qryContactpersoon' control, hyper file error : qryContactpersoon file unknown in analysis. Placing a HExecuteQuery(qryContactPersoon,hQueryDefault,"11")in the Table initialization event makes it go away.
What I do not understand:
- the second table uses exact the same query (slightly different WHERE) and gives no error
- ingnoring the error has no negative consequences, the screen works perfectly afterwards (including this table control).
Related mystifying behaviour:
- Using 'qryOrga.org_code' from the master screen instead of "11" in the table initialization event (in the HExecuteQuery mentioned above) gives an error, using it in the 'whenever modified' event of the Tab control it works great.
By the way, what I really would like is the table controls not to open the related queries until needed, is this possible?
regards,
Martin

Hello Martin,
Not an answer to your question, but maybe some more info. I have the same problem I think. See http://f16.parsimony.net/forum28986/messages/13683.htm
If you want to use a query in a table, then you have to execute the query in the global declaration and not in the table initialisation (that's what info witch came with the error told me). The query has to create a file witch the table can use (even it's empty).
I noticed that a query is executed in the background and so the table column initialisations). To force the completion of the query use hnumrec() after HexcuteQuery() (but it's slowing down the performance on start).
I already informed PCSOFT about this problem, but they need an example. Our project is too complex too give as an example. Maybe you can provide them.
So if you getting an reply, please keep us up to date.
Greetings,
Alex
Posted on August, 10 2004 - 4:17 PM
>>So if you getting an reply, please keep us up to date.
Here you are (got it today):
Dear Sir,
Table related question
We suggest you to use a query with a parameter in such a way that the query is
empty at first (according to the parameter value). After that, when you want
the query filled , you simply change the parameter value.

Best regards,

I already implemented this in providing each and every query with a non-existing hard-coded param-value. Performance is reasonable on HyperFile. I'll switch to Oracle next week, if performance changes I'll let you know.
gr.
Martin
Posted on August, 10 2004 - 5:39 PM
So if you getting an reply, please keep us up to date.
Here you are (got it today):

Dear Sir,
Table related question
We suggest you to use a query with a parameter in such a way that the query is
empty at first (according to the parameter value). After that, when you want
the query filled , you simply change the parameter value.

Best regards,
I already implemented this in providing each and every query with a non-existing hard-coded param-value. Performance is reasonable on HyperFile. I'll switch to Oracle next week, if performance changes I'll let you know.

gr.
Martin

Thank You.
However this we already knew. And I have another problem with the background execution of the query and reading the same time a file with HReadSeek. To avoid this problem to I have to use HNumrec() after HExecuteQuery to force completion of the query execution. Even with an empty query it takes some time at start. So no solution for me.
Alex