Page 287 - Open Soource Technologies 304.indd
P. 287
Unit 13: Working With Reports
In addition, you can create data-bound controls on a page by dragging commands and database
fields from the data environment to your page.
The following table summarizes how you can use drag and drop with the data environment?
Drag From Drop on To
Database object Data View Connection in data Create a command object for the
environment database object you dragged. For
example, dragging a table creates
a command object whose Database
Object type is table.
Command object Data Web page Create a data-bound control.
or Field object environment
Database object Data View Web page Not allowed. Drag objects from
the data environment instead.
13.1.3 The Data Environment Object Model
The data environment supports its own object model, which you can use when writing script to
manipulate the data you want to display on your Web page. The data environment object model
is based on the ActiveX Data Objects (ADO) object model, but is simpler to use.
In ADO, the main objects in the data environment object model are the Connection object,
Command object, Record set object, Field objects, and Parameter objects. Each of these ADO
objects has its own properties and methods.
The data environment abstracts this object model to make it simpler to use. The data environment
itself is an object that can be used in script and that contains these ADO objects. Within the data
environment object, command objects are exposed as methods in script. You can call a command
method to execute it and return the record set referenced by the command or to execute its SQL
command or stored procedure.
Each of the data environment objects also has properties you can set in the property page for
that object or directly in script.
13.2 Accessing Data
The Figure 13.2 is a roadmap of data access technologies found in Visual Basic. The Figure 13.2
features “hot” zones, which you can click to find out more information about any particular set
of data, access tools or technologies.
Using Visual Basic 6.0 you can create components that encapsulate every step in a data access
system. Beginning with the data source, Microsoft Visual Data Tools (accessible through the Data
View window) give you the ability to view and manipulate tables, views, stored procedures, and
database schemas on SQL Server and Oracle systems.
LOVELY PROFESSIONAL UNIVERSITY 281