PRB: Field Mapping Lost When Project Moved to Different Drive

Last reviewed: September 18, 1997
Article ID: Q173878
The information in this article applies to:
  • Microsoft Visual Studio versions 97
  • Microsoft Visual FoxPro for Windows, version 5.0a

SYMPTOMS

Moving a project, and all it's components, to a different drive clears the "Map field type to classes" information for all the tables in it.

STATUS

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

MORE INFORMATION

If a table is part of a database, then you can map a class library and a class to each of the fields in the table using the "Map field type to Classes" option in the Table Designer. This way you specify the class you want to create when you drag the field onto a form. If all these files (database, table, class library) are a part of a project and the project is moved to a different drive (for example, from drive "C:" to drive "D:"), then modifying a table within the project that had a field mapped to a class will produce "The Class.... Associated with this field cannot be found - class association is cleared" error message, and the Field Mapping information is cleared.

Steps to Reproduce Behavior

  1. Using the Windows Explorer to create a directory "c:\vfp5app", or from Visual FoxPro type the following command:

          MD c:\vfp5app
    

  2. In the directory you created in the previous step, create a class library and class by issuing the following commands from the Visual FoxPro Command window:

          CREATE CLASSLIB C:\vfp5app\ccontrols.vcx
          CREATE CLASS ctextbox OF ccontrols AS TextBox
    

  3. Save the class and close the Class Designer.

  4. Create a project, database, and table in the "c:\vfp5app\" directory and name all three of them "QA" with the following commands:

          CREATE PROJECT c:\vfp5app\qa
          CREATE DATABASE c:\vfp5app\qa
          CREATE TABLE qa ( iID i, cText c(10) )
    

    Make sure that the database is open and active when you create the table so that the table is added to it.

  5. Add the "QA" database and the class library, created in the previous step, to the "QA" project.

  6. Open the "QA" project. From the Project Manager, modify table "QA". When the table designer appears, click the Fields tab.

  7. Select "iID" field, and then under the "Map Field type to Classes" section set "Display Library" to "C:\vfp5app\ccontrols.vcx" and "Display Class" to "cTextBox". Do the same for the "cText" field.

  8. Close the Table Designer and the project.

  9. Using the Windows Explorer, MOVE the whole project, including all the files, to another drive, for example "D:" or "E:", with the same directory structure (D:\vfp5app\ or E:\vfp5app).

  10. Open the project.

  11. Modify table "QA".

  12. When the "The Class.... Associated with this field cannot be found -

        class association is cleared" error message is displayed, click OK.
    

  13. When the Table designer appears, click the Fields Tab and look at the

        "Map Field type to Classes" section for each of the fields. Note that
        both the "Display Library" and "Display Class" properties are blank.
    

NOTE: Rebuilding the project does not resolve this problem.
Keywords          : vfoxwin
Version           : WINDOWS:5.0a; WINNT:97
Platform          : NT WINDOWS winnt
Issue type        : kbprb


================================================================================


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: September 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.