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
- Using the Windows Explorer to create a directory "c:\vfp5app", or from
Visual FoxPro type the following command:
MD c:\vfp5app
- 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
- Save the class and close the Class Designer.
- 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.
- Add the "QA" database and the class library, created in the previous
step, to the "QA" project.
- Open the "QA" project. From the Project Manager, modify table "QA".
When the table designer appears, click the Fields tab.
- 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.
- Close the Table Designer and the project.
- 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).
- Open the project.
- Modify table "QA".
- When the "The Class.... Associated with this field cannot be found -
class association is cleared" error message is displayed, click OK.
- 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
|