Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 6 Jahren, 8 Monaten
Letzter Beitrag:
vor 6 Jahren, 8 Monaten
Beteiligte Autoren:
Piet van Zanten, Al

WD16: deleting a record from a subquery

Startbeitrag von Piet van Zanten am 17.07.2011 08:39

Hi all,

I have successfully tested the deletion of a record from a subquery in a small project before I decided to implement this feature in real life. Yes, I have become cautious to implement features I have not used before ;)
I have two single file queries, both using HFsql with the hModify constant.
What I call the subquery is a query on the first query.
When deleting a record from the subquery in the test project, the record is successfully removed from the first query and from the main file. This is as documented.

To my great annoyance, in real life I'm stuck with an unexpected system error: Access violation (GPF) :mad:.
In my experience most of the time this kind of error is due to a programming error not caught by the compiler. However no matter what I try (delete .cpl dir, recompile, repair etc.) I'm not able to find any errors. I don't really have the time to create a project to send to PCsoft, because I'm on a tight schedule.

Note that when I do a hModify on the subquery, everything works fine.

Before I have to find another workaround, I would like to check if anyone had a similar problem and was able to solve it.

grtz, Piet


Hello Piet

I have no direct knowledge re sub queries but because you think it might be a programming error not picked up by the compiler, one thing to try would be to use quotes where possible around names.
My reasoning is that there are some instances where the doco states that names can be with or without quotes but in some cases this does not apply.
e.g. HReadSeekFirst(FileName,IndexKey, Item) is ok but when you use an alias file you have to use quotes in the index name HReadSeekFirst(AliasFilename,"IndexKey",Item)

So I am suggesting that if there are any parts of your code where quotes are "optional" and you haven't used them, then try them with quotes.


von Al - am 17.07.2011 13:39
Thanks Al, but I'm off that road already.
I switched to arrays of structures using filetomemory and memorytofile functions,without any nasty surprises (sofar). I had this approach in mind already. Just had to implement it a bit sooner than I thought.

Regards, Piet

von Piet van Zanten - am 17.07.2011 20:40
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.