PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD21] - Hiding / Showing records
[WD21] - Hiding / Showing records
Iniciado por guest, 15,sep. 2017 07:22 - 3 respuestas
Publicado el 15,septiembre 2017 - 07:22
Hi All

I have a database file with various records. How I can hide some of these records from HREAD...() searches and at other times allow them to be included in HREAD...() searche results?

I thought of using HFILTER() on a field condition to exclude records but when I apply the filter and then subsequently run a HREADSEEKFIRST() on a different index key WinDev crashes and says the HREADSEEKFIRST() caused a fault: unexpected system error.

Thanks.
Publicado el 15,septiembre 2017 - 08:40
Hi,
why dont you use SQL?
Publicado el 15,septiembre 2017 - 09:17
Hi JP,

If you're thinking of using hFilter, don't do it. I started out using filters, but soon realised that SQL with parameters is much more flexible. E.g. if you write a query using parameters, you can use it with tables, but if you've designed it properly, you can use the query anywhere in your project
Publicado el 15,septiembre 2017 - 16:27
Hi JP

it doesn't matter if you use a filter or a query. For what you want to do, the best way is to create a COMPOSITE key made of:
1. your exclusion criteria
2. your 'real' key

By doing that, you can either use a hfilter on the composite key and get what you need, or do a query with conditions on both fields and get a speedy answer. In the query, if you want to completely ignore the exclusion criteria, you can do that by setting that parameter to null.

best regards