Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help Please re proper error msg for DBC with RI & Triggers
Message
From
25/04/2001 09:20:35
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Help Please re proper error msg for DBC with RI & Triggers
Miscellaneous
Thread ID:
00499520
Message ID:
00499520
Views:
72
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
Next
Reply
Map
View

Click here to load this message in the networking platform