Vous êtes sur la page 1sur 2

Use the Data Environment Designer to visually create and modify the data environment of forms, form sets,

and reports. When the Data Environment Designer window is active, Visual FoxPro (Visual FoxPro is the object-oriented relational
database management system that makes it possible for you to create database solutions for the desktop to the Web. Visual FoxPro provides powerful data handling capabilities, rapid application development tools for maximum productivity, and the flexibility needed to build all types of database solutions.)

displays the Data Environment menu, which makes it possible for

you to manipulate data environment objects (Created when you create a form, form set, or
report. A DataEnvironment object functions as a container for the Cursor, CursorAdapter, and Relation objects associated with the form, form set, or report) .

To display the Properties window and Code window, right-click to display the Data Environment shortcut menu, and then click Properties and Code. A data environment defines the source for the data used in a form or report. This can include tables, views, and relationships. The data environment is saved with the form or report and can be modified whenever you are using the Report Designer or Form Designer. The Data Environment designer is one of the most intriguing new features of Visual Basic 6. In short, it's a design-time representation of the ADO objects that you would otherwise create at run time. This capability is very exciting because it brings the same programming paradigm to database development that Visual Basic itself introduced several years ago and that made Windows programming so easy and immediate. When you use a form designer, you're actually defining at design time the forms and controls Visual Basic will create at run time. you can use the DataEnvironment designer to define the behavior of ADO Connections, Commands, and Recordset objects. You can set their properties at design time by pressing the F4 key to bring up the Properties window or by using their custom property pages, exactly as you would do with forms and controls.

To add a DataEnvironment designer to the current project, you can choose the Add Data Environment command from the Project menu. This command appears only if you've added a reference to the Microsoft Data Environment Instance 1.0 library. You can also create a DataEnvironment designer from the DataView window. Finally, you can create a new Data Project from the project gallery. In this case, Visual Basic creates a project for you with all the necessary references and an instance of the DataEnvironment designer.

Designing a DataEnvironment Object At , you can use the Data Environment designer to create a DataEnvironment object. The DataEnvironment object can include Connection and Command objects, hierarchies (relationships between Command objects), groupings, and aggregates. Before designing your DataEnvironment object, you should determine what information you want to present, identify the databases that contain the information, and determine your objective. Before you can access the Data Environment designer, you must reference it in Visual Basic. To reference the Data Environment designer 1. On the Project menu, click References. 2. From the References dialog box, select Data Environment 1.0, and then click OK. To add a Data Environment designer object to a new Visual Basic project 1. From the New tab of the New Project dialog box, choose Standard

EXE project, and then click Open. 2. From the Project menu, choose Add Data Environment. The Data Environment designer is added to your Visual Basic project, the Data Environment designer window appears, and a Connection object is added to your Data Environment.

Vous aimerez peut-être aussi