PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Pairing query fields and database fields
Pairing query fields and database fields
Iniciado por carl.bergman, 29,oct. 2017 12:49 - 2 respuestas
Publicado el 29,octubre 2017 - 12:49
I have a query that selects ALL the fields in a database file, like

SELECT *
FROM DBfile
WHERE ...


I use the records in the query to fill the fields in a window.

If I modify a (query)field, is there any way to write the modified record back to the datafile whitout having to manually pair each queryfield with the corresponding databasefield?

Insted of ...
DBfile.field1 = QRY.field1
DBfile.field2 = QRY.field2
DBfile.field3 = QRY.field3
HModify(DBfile)

I am looking for something like
DBfile.Record = QRY.Record
HModify(DBfile)

Best regards,
Carl
Publicado el 30,octubre 2017 - 12:30
Hello Carl,

1. your query has to have the MODIFY option set
2. Your query has to wrok on only one file
3. You fields must be linked (in their description) to the query fields
4. if 1 and 2 and 3 are true, then you can use the screentofile function


Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com

Le 10/29/2017 à 6:49 AM, Carl Bergman a écrit :
I have a query that selects ALL the fields in a database file, like

SELECT *
FROM DBfile
WHERE ...


I use the records in the query to fill the fields in a window.

If I modify a (query)field, is there any way to write the modified
record back to the datafile whitout having to manually pair each
queryfield with the corresponding databasefield?

Insted of ...
DBfile.field1 = QRY.field1
DBfile.field2 = QRY.field2
DBfile.field3 = QRY.field3
HModify(DBfile)

I am looking for something like
DBfile.Record = QRY.Record
HModify(DBfile)

Best regards,
Carl
Publicado el 31,octubre 2017 - 12:55
Hi Fabrice, thanks, I tested it and it works. :)