If you need additional help while using the Connection Editor, click the Help button...

Linki


» Dzieci to nie książeczki do kolorowania. Nie da się wypełnić ich naszymi ulubionymi kolorami.
»
01900–02039: SQL Parsing ORA–02020 too many database links in use Cause The maximum number of active connections to remote databases...
»
The iconography of the Haggadah obviously could not fail to contain a scene depicting the sacrifice of Isaac, who was thus closely connected to the ritual of Pesach...
»
any inference from the appearance of one to the existence of another...
»
{retraining_complete_body_barbarian} Ta jednostka zakoDczyBa doszkalanie
»
\par nego i mistycznego na przyk\'b3adzie postaci Moj\'bfesza...
»
– Kiedy pojawiły się słowa ‼niedobra miłość”?– Ten świr wykrzyczał je, kiedy uciekał po zamordowaniu Becky...
»
nie, mówiÂąc, Âże król zmĂŞczony jest i wraz z nim skierowaÂłsiĂŞ do starego dworca...
»
Należy wspomnieć, że wielu teologów począwszy mniej więcej od XII wieku stworzyło dla dzieci nieochrzczonych ich własne, odpowiednie dla nich piekło...
»
Mówi jedynie o tym słowie; a my możemy zobaczyć, jak apostołowie zostaliporażeni przez tę wielką prawdę, ogłoszenie słowa, które jest Chrystusem,aby objawić...
»
pomocy”

Dzieci to nie książeczki do kolorowania. Nie da się wypełnić ich naszymi ulubionymi kolorami.


8 Choose File|Save All to save your project.
5-4
Q u i c k S t a r t
S e t t i n g u p d a t a a c c e s s c o m p o n e n t s
Setting up the unidirectional dataset
A basic database application uses a dataset to access information from the database.
In dbExpress applications, you use a unidirectional dataset. A unidirectional dataset
reads data from the database but doesn’t update data.
To add the unidirectional dataset:
1 From the dbExpress tab, drop TSQLDataSet at the top of the form.
2 In the Object Inspector, set its SQLConnection property to SQLConnection1 (the
database connection created previously).
3 Set the CommandText property to “select * from SALES” to specify the command
that the dataset executes. You can either type the Select statement in the Object
Inspector or click the ellipsis to the right of CommandText to display the
CommandText Editor where you can build your own query statement.
Tip
If you need additional help while using the CommandText Editor, click the Help
button.
4 Set Active to true to open the dataset.
5 Choose File|Save All to save the project.
Setting up the provider, client dataset, and data source
The Data Access page contains components that can be used with any data access
mechanism, not just dbExpress.
Provider components are the way that client datasets obtain their data from other
datasets. The provider receives data requests from a client dataset, fetches data,
packages it, and returns the data to the client dataset. If using dbExpress, the
provider receives updates from a client dataset and applies them to the database
server.
To add the provider:
1 From the Data Access page, drop a TDataSetProvider component at the top of the
form.
2 In the Object Inspector, set the provider’s DataSet property to SQLDataSet1.
The client dataset buffers its data in memory. It also caches updates to be sent to the
database. You can use client datasets to supply the data for data-aware controls on
the user interface using the data source component.
To add the client dataset:
1 From the Data Access page, drop a TClientDataSet component to the right of the
TDataSetProvider component.
2 Set the ProviderName property to DataSetProvider1.
3 Set the Active property to true to allow data to be passed to your application.
C r e a t i n g a C L X d a t a b a s e a p p l i c a t i o n — a t u t o r i a l
5-5
D e s i g n i n g t h e u s e r i n t e r f a c e
A data source connects the client dataset with data-aware controls. Each data-aware
control must be associated with a data source component to have data to display and
manipulate. Similarly, all datasets must be associated with a data source component
for their data to be displayed and manipulated in data-aware controls on a form.
To add the data source:
1 From the Data Access page, drop a TDataSource component to the right of the
TClientDataSet component.
2 Set the data source’s DataSet property to ClientDataSet1.
3 Choose File|Save All to save the project.
So far, you have added the nonvisual database infrastructure to your application.
Next, you need to design the user interface.
Designing the user interface
Now you need to add visual controls to the application so your users can view the
data, edit it, and save it. The Data Controls page provides a set of data-aware controls
that work with data in a database and build a user interface. You’ll display the
database in a grid and add a few commands and a navigation bar.
Creating the grid and navigation bar
To create the interface for the application:
1 You can start by adding a grid to the form. From the Data Controls page, drop a
TDBGrid component onto the form.
2 Set DBGrid’s properties to anchor the grid. Click the + next to Anchors in the Object Inspector to display akLeft, akTop, akRight, and akBottom; set them all to true. The easiest way to do this is to double-click false next to each property in the Object
Inspector.
3 Align the grid with the bottom of the form by setting the Align property to
alBottom. You can also enlarge the size of the grid by dragging it or setting its
Height property to 400.
4 Set the grid’s DataSource property to DataSource1. When you do this, the grid is
populated with data from the employee database. If the grid doesn’t display data,
make sure you’ve correctly set the properties of all the objects on the form, as
explained in previous instructions.
5-6
Q u i c k S t a r t
D e s i g n i n g t h e u s e r i n t e r f a c e
So far your application should look like this:
The DBGrid control displays data at design time while you are working in the IDE.
This allows you to verify that you’ve connected to the database correctly. You
cannot, however, edit the data at design time; to edit the data in the table, you’ll
have to run the application.
5 From the Data Controls page, drop a TDBNavigator control onto the form. A
database navigator is a tool for moving through the data in a dataset (using next
and previous arrows, for example) and performing operations on the data.
6 Set the navigator bar’s DataSource property to DataSource1 so the navigator is
looking at the data in the client dataset.
7 Set the navigator bar’s ShowHint property to true. (Setting ShowHint to true allows Help hints to appear when the cursor is positioned over each of the items on the
navigator bar at runtime.)
8 Choose File|Save All to save the project.

Powered by MyScript