Using the Project Manager
Susan Graham
Microsoft Corporation
Welcome to Microsoft Visual FoxPro, the powerful new object-oriented environment for database construction and application development. Visual FoxPro provides the tools you need to manage data, whether you are organizing tables of information and running queries, creating an integrated relational database system, or programming a fully-developed data management application for end users.
The easiest way to get familiar with Visual FoxPro is to start it and begin using the Project Manager. The Project Manager provides an easy, visual way to organize and work with tables, files, databases, reports, queries, and other files when managing tables and databases or creating an application.
If you have your own set of tables from earlier versions of FoxPro, you can add them to a project immediately to get a feel for how Visual FoxPro works. If you have other data you want to organize (be it in spreadsheets, text files, or tables from other applications), you can import them into Visual FoxPro and add them to a project.
There are also some sample files provided for you to work with as you become familiar with Visual FoxPro and the Project Manager. These samples, TESTDATA.DBC and TASTRADE.DBC, are located in the Samples subdirectory where you installed Visual FoxPro.
Using the Project Manager
The Project Manager is the primary organizational tool for working with data and objects in Visual FoxPro. A project is a collection of files, data, documents, and Visual FoxPro objects that is saved as a file with a .PJX extension.
You can use the Project Manager to organize and manage files as you create tables and databases, write queries, set up forms and reports, and build applications. For more information about building applications with the Project Manager, see the Developer’s Guide included in your Developer Conference materials.
The Project Manager presents an organized, hierarchical view of your data. To focus on a particular type of file or object in your project, click the appropriate tab. When you are setting up tables and databases and creating forms, queries, views, and reports, you work primarily with the items shown under the Data and Documents tabs.
Organizing Data with the Data Tab
This tab contains all the data for a project: the databases, free tables, queries, and views.
Databases are sets of related tables. You create a database by relating tables in the Database. Database files have a .DBC extension.
Free tables are tables which are not part of a database and are stored in a file with a .DBF extension.
Queries are a structured way to request specific information stored in tables. Using the Query Designer, you format a question that extracts records from your tables based on the criteria you enter. Queries are saved as files with a .QPR extension.
Views are specialized queries that enable you to access remote data and update data sources by making changes to the records returned by the query. Views exist only within a database and are not independent files.
Organizing Documents with the Documents Tab
The Documents tab contains all the documents you use when working with data: forms for entering data, and reports and labels for printing out tables and query results.
Forms are used to display and edit the contents of tables.
Reports are files that tell Visual FoxPro how to format and print the results of queries run on tables
Labels are special reports formatted to print on label stock.
Organizing Classes with the Classes Tab
The Classes tab in the Project Manager contains the available visual classes (.VCX). A visual class is a library file containing one or more class definitions.
Organizing Code with the Code Tab
The Code tab in the Project Manager contains available programs (.PRG), API libraries and other applications.
Organizing Other types of files with the Other Tab
The Other tab in the Project Manager contains all remaining files including menus, text files and other files such as spreadsheets, etc.
Viewing the Contents of a Project
The items in the Project Manager are organized in an outline-like view that you can expand or collapse to look at different levels of detail.
A plus sign appears next to a symbol if there are one or more items of that type in the project. Click the plus sign next to a symbol to display the names of items of that type in the project. Click the plus sign next to the name of an item to see the components of that item.
For example, click the plus sign next to the Free Tables symbol to see the names of free tables in the project; click the plus sign next to a table name to see the names of the fields and indexes within that table.
To collapse a list once it is expanded, click the minus sign that appears next to the list.
Adding and Removing Files
To use the Project Manager, you must add existing files to it or use it to create new files. For example, if you have a set of existing .DBF tables you want to add to a project, just select Free Tables in the Data tab, and use the Add button to add them to the project.
To add a file to a project
The Project Manager simplifies creating and changing files. Just choose the type of file you want to create or modify and click the New or Modify button. Visual FoxPro displays the design tool appropriate to the type of file you selected.
To create a file to add to the Project Manager
To modify a file
Viewing Tables
From the Project Manager, you can browse the contents of the tables in your project.
To browse a table
Adding Files From One Project to Another
You can have more than one project open at the same time and you can drag files from one project to another. The files are not duplicated, because the project stores only a reference to the file. Files can simultaneously be associated with different projects.
To add files from a project to another project
Initially the Project Manager appears as a separate window. You can move the container around, resize it, or collapse it so that only the tabs show.
To move the Project Manager
To restore the Project Manager
To tear off a tab
To restore a tab
To dock the Project Manager
Introducing the Visual FoxPro Design Tools
The Project Manager gives you quick access to the Visual FoxPro design tools. These tools make it easy to create tables, forms, databases, queries, and reports to manage your data. Use of the tools is described in different chapters in this book. You can also assemble the items you create with the design tools into an application. Creating an application from tables, databases, and forms is discussed in the Developer’s Guide.
If you choose, you can also use the design tools independently of the Project Manager by using the options of the New command on the File menu. The following table summarizes which tool to use to accomplish different tasks:
To Use this design tool
Create tables and set indexes on tables Table Designer
Run queries on local tables Query Designer
Run queries on remote data sources; create updatable queries View Designer
Create a form for viewing and editing the data in your tables Form Designer
View and create relationships between tables; set up a database Database DesignerTo use the design tools to create new files
Wizards are interactive programs that can help you quickly accomplish common tasks, such as creating forms, formatting reports, and setting up queries.
By answering questions or choosing options on the series of wizard screens, you are telling the wizard to build a file or perform a task based on your responses. For example, if you choose the Report Wizard, you can select the type of report you want to create. The wizard then asks you which table you want to use and provides choices for formatting the report.
Starting a Wizard
When you create a new item using the Project Manager or the File menu, you can choose to use a wizard to help you create the item.
To start a Wizard
You can also choose New from the File menu, and select the type of file you want to create.
Navigating the Wizard Screens
Once you have the wizard running, just answer the questions on each screen, and choose the Next button when you are ready to proceed to the next screen.
If you make a mistake or change your mind, choose the Back button to see the previous screen so you can make changes. Choose Cancel to exit the wizard without producing any results. If you have a question about using the wizard, choose the Hint button to see more information.
When you reach the last screen, choose the Finish button when you are ready to exit the wizard.
If you are in a hurry, you can choose the Finish button to proceed to the end of the wizard sequence, skipping the entry of optional information and using defaults supplied by the wizard.
Saving Wizard Results
The last screen of each wizard might ask you to supply a title and, depending upon the type of wizard you are using, give you save, browse, modify, or print options.
Use the Preview option to see the results of the wizard before you are finished with the wizard. You can rerun the wizard if you want to make different choices to change the results. When you are satisfied with the wizard results, choose the Finish button.
Modifying Wizard-Created Items
One you have created a table, form, query, or report, you can open it in the appropriate design tool and make further changes to it. You cannot re-open a wizard-generated file with a wizard, but you can preview the wizard results and make changes before exiting the wizard.