Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 6 Jahren
Letzter Beitrag:
vor 6 Jahren
Beteiligte Autoren:
ccc2, Allard , Arie, Clarion Ghost

The data is in conflict with the integrity constraints defined for the database.

Startbeitrag von Clarion Ghost am 06.05.2012 10:00

I am get the warning message "The data is in conflict with the integrity constraints defined for the database." because I am trying to delete a record which has child records.

I would like to display my own 'You can't do this' message before my 'Delete' Form appears.

How may I do this please?

Many Thanks

Antworten:

HOnError() is your friend. Take a look at the help for this one.

von Arie - am 07.05.2012 07:11
Before you do the delete() seek the record for child records. If a record has chield records ( orderline ) desplay an error() followed by a retrun ( will stop the proces )

Or Something like this, get all orders that donnot have a child and delete them.

For all orders where order.orderlineid Orderline.orderlineID
Hdelete( orders)
else
error()
end

If you want to delete a specific order. Then you can do a hreadseek to find the order and run the script above to check wether it has orderlines.

regards
Allard

von Allard - am 08.05.2012 08:59
HOnError() will help you but be very carefull with the error code .

if you using hyperfile or hyperfile server , the accuracy is 100%, but beware if you using external database .

I suggest you also show the full message in order to not get confuse.

von ccc2 - am 08.05.2012 13:01
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.