Visual Basic Reference
Data Environment Designer
The Data Environment designer provides an interactive, design time environment for creating programmatic run-time data access. At design time, you set property values for Connection and Command objects, write code to respond to ActiveX Data Object (ADO) events, execute commands, and create aggregates and hierarchies. You can also drag Data Environment objects onto forms or reports to create data-bound controls.
Shortcut Menus
You can access a shortcut menu by right-clicking any object within the Data Environment designer.
DataEnvironment Object Shortcut Menu
The DataEnvironment object shortcut menu contains the following items:
Expand All
Expands the Outline view of the Data Environment designer, showing all Connection and Command objects within the current DataEnvironment object.
Collapse All
Collapses the Outline view of the Data Environment designer.
Arrange by Object
Displays all objects within the Data Environment designer arranged by the categories of Connection and Command.
Arrange by Connection
Displays the objects grouped by connection, with all the Command objects listed beneath the Connection object to which they are associated.
Add Connection
Adds a new Connection object to the Data Environment designer.
Add Command
Adds a new Command object to the Data Environment designer.
Insert Stored Procedures
Accesses the Insert Stored Procedures dialog box. From this dialog box, you can create one or more Command objects from a list of stored procedures that are available in each Connection object.
View Code
Accesses the Code Editor window for the current DataEnvironment object.
Show Fields
When selected, the Field objects appear beneath their associated Command objects in the Data Environment Outline view. (Default)
Options
Accesses the Data Environment Options dialog box. From this dialog box, you can change the global settings of the Data Environment, such as field mapping settings and whether warning messages display.
Command Object Shortcut Menu
The Command object shortcut menu contains the following items:
Expand All
Expands the Outline view of the current Command object, showing all Field and Parameter objects.
Note If Show Fields is not selected on the General tab of the Options dialog box, no Field objects display.
Collapse All
Collapses the Outline view of the current Command object, hiding all Field and Parameter objects.
Delete
Deletes the currently selected Command object. Since the deletion permanently removes the object from the DataEnvironment object a confirmation message box appears, if specified. Once the deletion is confirmed, the Command object is removed from the DataEnvironment object.
Rename
Renames a Command object. When a Command object is renamed, its link to the Connection object and other Command objects is maintained.
Note Each object within the Data Environment designer must have a unique name. For example, if you are creating a Command object based on a customers' table, a logical name would be "Customers."
Refresh
Refreshes a Command object, ** rebuilding all its stored meta-data, such as Field and Parameter objects. Any changes to the table or stored procedure's definition is reflected in the Command object after the refresh.
Caution User-defined property settings are lost during the refresh. For Fields, the Control and Caption properties are reset to their defaults. For Parameters, the Name, Direction, DataType, Precision, Scale, Size, and HostDataType properties are reset.
Add Child Command
Adds a child Command object to the current Command object.
Use the Relation tab of the Command Properties dialog box to specify the parameters that relate these two Command objects.
View Code
Accesses the Code Editor window for the currently selected Command object.
Debug
Uses the T-SQL Debugger to debug a stored procedure.
Design
Accesses the Structured Query Language (SQL) query designer for a Command object when the command source is text.
Properties
Accesses the Command Properties dialog box, from which you can specify general, parameter, relation, grouping, aggregate, and advanced management information for the current Command object.
Hierarchy Info
Accesses the Hierarchy Information dialog box, which enables you to view the Shape command and ADO hierarchy information for the current Command object. This is disabled if the Command object is not in a relation hierarchy.
Connection Object Shortcut Menu
The Connection object shortcut menu contains the following items:
Expand All
Expands the Outline view of the current Connection object, showing all associated Command objects.
Collapse All
Collapses the Outline view of the Connection object, hiding all Command objects within the current Connection object.
Delete
Deletes the currently selected Connection object. Since the deletion permanently removes the object from the DataEnvironment object a confirmation message box appears, if specified. Once the deletion is confirmed, the Connection object is removed from the DataEnvironment object.
Rename
Renames a Connection object. When a Connection object is renamed, any Command objects associated with it are automatically updated.
Note Each object within the Data Environment designer must have a unique name. For example, if you are creating a connection based on the Northwind database, a logical name would be "Northwind."
Refresh
Refreshing a Connection ** object clears the internal cache of the list tables and stored procedures associated with the connection. After a Connection object is refreshed, this list is rebuilt the next time you drop down a list of tables or stored procedures.
Add Command
Adds a Command object to the DataEnvironment object and associates it with the current Connection object. The Command Properties dialog box automatically appears.
Insert Stored Procedures
When clicked, the Insert Stored Procedures dialog box appears. From this dialog box, you can insert one or more Command objects from a list of stored procedures that are available from each Connection object.
View Code
Accesses the Code Editor window for the currently selected Connection object.
Properties
In Visual Basic, accesses the Data Link Properties dialog box, from which you can specify provider, connection, advanced, and view all initialization properties for the current Connection object.
In Visual InterDev, accesses the Connection Properties dialog box, from which you can specify general, authentication, and miscellaneous information for the current Connection object.
Field Object Shortcut Menu
The Field object shortcut menu contains the following items:
Properties
Accesses the Field Properties dialog box, from which you can view general information, or set the Caption and Control properties for the current Field object.
View Code
Accesses the Code Editor window for the currently selected Field object.