Welcome! Log In Create A New Profile

Advanced

HFCS and Queries.

Posted by Aad Gouka 
Aad Gouka
HFCS and Queries.
October 14, 2008 09:12PM
Hi all,

I have an application that i'm converting from Classic to HFCS. In this application I made heavy use of hFilter. I'm very new to queries and I've noticed a large speedgain against hFilter when using HFCS.

Behind every table with hFilter is a form where I can add, delete or modify records in the standard Windev way. When using queries, the forms are not filled anymore with data from the table.

Can anybody suggest any easy solution, where I can use queries/hfcs and keep the structure of my table/form application.

Thanx in advance for any hints.


Regards,

Aad
Fabrice Harari
Re: HFCS and Queries.
October 14, 2008 09:32PM
Hello Aad...

Before opening the form, read the desired record with a hreadseek(FileName, UNikIDReturnedByTheQuery), and it will work as it was before

best regards

Fabrice Harari
WinDev, WebDev, WinDev Mobile consulting
Aad Gouka
Re: HFCS and Queries.
October 14, 2008 10:43PM
Hello Fabrice,

Thank for your reply. I don't exactly know what you mean by UNikIDReturnedByTheQuery), what syntax to use. When I use hReadseek(Customer,CustomerId,Customer.ID) I get the same result on every tableline. By the way, the tables are filled with several records meeting the query. So when i choose the first line in the table, i get the same result on the form, as when i choose the last line.
I hope i've made myself clear.

Thanks for your help.


Regards,

Aad
Fabrice Harari
Re: HFCS and Queries.
October 14, 2008 11:23PM
Hello Aad...

what I mean is that you have to modify your query to have it return not only displayable information for your table, but also the unique ID of each record (can be an automatic ID or anything else declared as a unique key in the file)...

This information should be stored in the table (visible column or not) ith the rest of the query results...

So when the user ask for a record form, you just have to read the record FROM THE FILE, using the value of the unik ID that was returned by the query and stored in the table...

So if the ID column is col_ID, and the table is MyTable, you should do something like
<code>
if hreadseek(MyFile, UniqueIDKey, col_ID[TableSelect(MyTable)]) = true then
open the form
else
display a message saying that the record was probably deleted by another user
end
</code>

Best regards

Fabrice Harari
WinDev, WebDev, WinDev Mobile consulting
Aad Gouka
Re: HFCS and Queries.
October 15, 2008 12:21PM
Hi Fabrice,

Works great. Thank you for your trouble.


Regards,

Aad

Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: