Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help Please re proper error msg for DBC with RI & Triggers
Message
De
25/04/2001 09:20:35
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Help Please re proper error msg for DBC with RI & Triggers
Divers
Thread ID:
00499520
Message ID:
00499520
Vues:
74
How can I substitute a proper ( one of my own) error message for a database that has triggers and RI?

For example:

A table in my DBF CLIENTS has a field "clientname" and an index that is CANDIDATE. It also has an ID field as a primary index. The reason I have a candidate index is that I do NOT want duplicate "clientname"s.

I add the table to the DE on my form, setup fields, and drop the txtbtns class from the WIZARD's directory to handle data entry. The table is set with Bufering 5.

If user enters a duplicate ClientName and with Buffering OFF I can trap the error in the lostfocus of the textbox for that field and supply a message that says that that field is a duplicate or some such. I put code in the form Error method.

With buffering of Optimistic record/file I cannot trap the error and VFP pops up with a meaningless error on save - "Unique Field Violated etc"

My generic "OnError" routine is never called.

Is there any way of trapping this error WITH Buffering 5 and display my message - "Duplicate Client Name"?

Preferably this would be in a stored proc of the DBC or in the error routine of a Template Form or Form Class.

I have searched the net but cannot find any help on this.

Dough Henning's article helped a bit but I cannot find any way to trap Trigger/RI errors and substitute my own message.

Thank You

Bernard
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform