USE THE DATA CONTROL

To use a data control programmer must follow the following steps.

STEP-1 PLACING DATA CONTROL ON TO THE FORM

To use a data control it is just pick up from Toolbox and placed on the form.

STEP-2 CONNECTION MAKING

After placing the data control on the form, a connection is established b/w the database & data control. Although data control has several properties but only two properties are required to establish the link to a database.

DATABASE NAME

Specifying database name “connects” a data control to a specific database. The database file (being connected) must exist on to the disk. The file can be browsed through properties window.

RECORD SOURCE

Record source specifies a table with in that database. The properties window displays all tables’ names into a drop list. Programmer can select one of them.

After setting these two properties, the data control is ready to retrieve, create, and edit information.

STEP-3 CONNECTING A DATA CONTROL TO A BOUND CONTROL

A control, which can be bound with a database, has following two properties:

DATA SOURCE

The name of the data control is set as a property value.

DATA FIELD

The name of the field of a table is written in data field property. So that bound is able to display the information from that particular field of the table.

FOR EXAMPLE

To connect a text box to a data control, text box’s data source property set by entering to the name of the data control. To display a particular field in the text box’s data field property.

Following are the names of those intrinsic controls those can be bound with database.

CONTROL

AVAILABLE DATA TYPE

Text Box

 

 Label

  

Image

  

Picture

 

 

Check Box  

  

List Box

 

Combo Box

Any data types. Editing is allowed.

 

 Any data types. Editing is not allowed.

 

 Displays graphics stored in the database but does not allow editing of the image.

 

Displays graphics stored in the database and allows editing of the image.

 

Boolean data type only. This allows updating of the record.

 

Text data types. Editing is allowed.

 

Text data types. Editing is allowed on the selected record.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s