From: "Peter Zevenaar" Newsgroups: pnews.paradox-development References: <3c71789f@jedstarmail.jedstar> Subject: Re: Trapping for Key Violations, Referential integrity violations Date: Mon, 18 Feb 2002 23:27:42 +0100 Lines: 60 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 NNTP-Posting-Host: 62.45.7.18 Message-ID: <3c71852d@jedstarmail.jedstar> X-Trace: jedstarmail.jedstar 1014072621 62.45.7.18 (18 Feb 2002 14:50:21 -0800) Organization: Paradox Community Member Path: jedstarmail.jedstar Xref: jedstarmail pnews.paradox-development:295 Manuele, Maybe this is a start. You could place the following code in the form's error event: if eventInfo.errorCode()=peKeyViol then errorshow("Keyviolation in table "+active.tablename) endif but this will only show you "key violation" and not the value that causes it. Since you can't leave the table's record at least you will be able to show the user which table causes the keyviolation by using active.tablename. These are the mapped error constants I could find in ProView for referential integrity errors. Not sure if "referential integrity master missing" is part of them. peInvalidRefIntgDesc peInvalidRefIntgStruct peRefIntgReqIndex Further there are about 13 other unmapped errors for ref integrity which you can find in the RTL constants list in free ProView. Regards, -- Peter... Manuele Grueff schreef in berichtnieuws 3c71789f@jedstarmail.jedstar... > Hi! > I'm trying to trap the "key violation" and "referential integrity master > missing" errors as to show a message to the user telling him that he should > verify the field "name" for correctness. > > I already have a system in place wich can give me a message given an > object in any of my forms, so i'm tring to understand when and where and how > should i trap the two errors, and if there's a way to get back what is the > bad field! > > Many thanks! > > -- > Manuele Grueff > IT Consulting, Database & Web design > http://www.atipica.it > shores@paradoxcommunity.com > grueff@atipica.it > for the quickest and best FREE Paradox® support see > http://www.thedbcommunity.com > http://www.thedbcommunity.com/support/ > news://pnews.thedbcommunity.com > > >