FIX: Using RI Builder & Long Table Names Makes Triggers FailID: Q142313 3.00 3.00b WINDOWS kbtool kbbuglist kbfixlist The information in this article applies to:
SYMPTOMSUsing the RI Builder's code along with tables that have long table names and Private datasessions results in triggers constantly failing. The underlying error causing the triggers to fail is Error 1 "File <file_name> does not exist."
CAUSEThere are two causes. First the SET DATABASE command is scoped to Private Datasessions. Thus, there is no Database current and the appropriate database must be current for Visual FoxPro to be able to resolve long table names. Second, the Referential Integrity (RI) Builder does not take this previous issue into account.
WORKAROUNDModify the RIOPEN procedure the RI Builder created. The modifications would consist of finding the Database the table with the long table name belongs to, using CURSORGETPROP(), SET DATABASE to this Database. Let the RIOPEN routine open the table. Then use SET DATABASE to set the database back to the original database if any.
Example WorkaroundTo work around this problem, make the following modifications to the RIOPEN Procedure: 1. Copy the entire RIOPEN procedure, and paste it below the "__RI_FOOTER" 2. Add the following variables to the copied RIOPEN's LOCAL declarations:
3. Insert the following lines immediately after the copied RIOPEN's LOCAL
4. Insert the following line immediately after the first ENDIF of the
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0 for Windows.
MORE INFORMATION
Steps to Reproduce Problem1. Create a new database with a Parent Child Persistent Relation, and give 2. Set the RI Builder so that there is RESTRICT on the Child table's
3. Create a new form, and add both tables to its Data Environment.
4. Set the Child Cursors's BuffermodeOverride property to 5. 5. Set the form's DataSession property to 2-Private Datasession. 6. Add the child table's Foreign Key to the Form. 7. Add a Command button to the form. Set its Caption property to Add, and 8. Add another Command button to the form. Set its caption property to
9. Run the form. Click the Add button, and type in a value that is not in
KBCategory: kbtool kbbuglist kbfixlist
KBSubcategory: FxtoolBuilder VFoxWin buglist3.00 buglist3.00b fixlist5.00
Additional reference words: 3.00 3.00b
*
|
Last Reviewed: February 23, 1997 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |