WD21 - Error with HSave using Table with detail form

Startbeitrag von Sam Asid am 24.03.2017 08:13

Hello All,

I will appreciate some help with a problem I have.

I have created a "Table with Detail Form" window using Simple RAD in Windev 21. Everything seem to work well except when I click on button to apply editing changes, then I get the error below;
==================================================
HSave function called.
Unexpected system error.
If this error systematically occurs in the same conditions, contact PC SOFT Hot Line.
==================================================

The code in the "Apply" button is as below;
===================================================
ScreenToFile()

// Add / modify the record
HSave(mastfileQRY)

TableDisplay(TABLE_mastfileQRY, taCurrentRecord)
====================================================
Note: I use MySQL database and Query is built with WD Query editor.


Best regards

Antworten:

Hi,

maybe pass the screen( NAME) and the file(NAME) into the screentofile() helps.



I never use hsave I always use hadd() and hmodify()

Then use the following consept:

Search for a record with the ID you are on
If found do a hmodify() else do a hadd()

IF hreadseekfirst( file,identifier, value to ssearch on ) then
--
--
--
Hmodify()

else
--
--
--
Hadd()

end

This makes sure you are always where you want to be. OK Hsave may do this as well I donnot know . I read something about calculating an ID and that doesnot give me a good fealing. Better do I t yourself.

von Allard - am 24.03.2017 08:55
Hello Allard,

Thanks for the the tip. I tried it and it seem to work. I will have to fashion a way to put it into a procedure to cater for all points that I may need it.

Best regards,

Sam

von Sam Asid - am 24.03.2017 09:56
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.