FIX: Cannot Trap Error Number 1884 on Form (170148)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
This article was previously published under Q170148 SYMPTOMS
You cannot trap duplicate key errors such as the following when the error
is caused by a user's interaction with a grid on a form:
Uniqueness of index "name" is violated (Error 1884)
RESOLUTION
For a workaround that uses record buffering, place the following code in
the Valid method of a TextBox of the Grid:
IF .NOT. TABLEUPDATE()
*Invalid Primary Key Trapped here since Error method of Grid does not.
=AERROR(arrtemp)
=MESSAGEBOX('Error:'+STR(arrtemp(1,1));
+CHR(13)+arrtemp(1,2),0,'Error')
RETURN 0
ENDIF
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This has been corrected in Visual FoxPro
6.0.
Modification Type: | Major | Last Reviewed: | 5/12/2003 |
---|
Keywords: | kbbug kberrmsg kbfix kbprb kbvfp600fix KB170148 |
---|
|