PRB: Error When Running Gendbc.prg

Last reviewed: April 5, 1996
Article ID: Q149125
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b

SYMPTOMS

When you run Gendbc.prg, the following error is produced at line 722 in Visual FoxPro 3.0 and at line 834 in Visual FoxPro 3.0b:

   cannot find object cust_id in the database

CAUSE

This error occurs when a database contains two views where the name of the second view matches the first part of the name of the first view. An example is a database that has a view called myview1 and a second view called myview.

WORKAROUND

To prevent this problem, alter the Gendbc.prg program file, or change the setting of EXACT. For example, type the following command in the command window:

   SET EXACT ON

Or type the following command in the command window:

   MODIFY Gendbc.prg.

In version 3.0, the offending line is 711, and in version 3.0b this line is 823. The line reads:

   LOCATE FOR UPPER(GenViewCursor.ObjectName ) = cViewName AND ;
      GenViewCursor.Objecttype = 'View'

Change this line to read:

   LOCATE FOR ALLTRIM(UPPER( GenViewCursor.ObjectName )) == cViewName AND ;
      GenViewCursor.Objecttype = 'View'

This change includes the ALLTRIM function to remove all trailing spaces and changes the equals to double equals to ensure that an 'Exactly Like' match is used. The first time GENDBC is run after the change, it will automatically recompile and run correctly.

STATUS

Microsoft is researching this behavior and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional reference words: 3.00 3.00b VFoxWin
KBCategory: kbtool kbprb
KBSubcategory: FxtoolGeneral



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 5, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.