Freetutes.com

VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

VB .NET - Learn Visual Basic .NET

Systems Analysis - System analysis and Design tutorial for Software Engineering

Browse Topics

- Getting started
- Data Types
- Modules
- Operators in VB6
- VB6 Variable
- VB6 Procedures
- VB6 Control Structures
- Loops in VB6
- VB6 Exit Do & With End With
- Arrays in VB6
- User-Defined Data Types
- VB6 Constants
-
VB6 Built-in Functions
- Date and Time in VB6
- VB6 Controls
- TextBox Control
- ComboBox & OptionButton
- Label & Frame
- PictureBox & ImageBox
- Timer Control
- ListBox & ComboBox
- VB6 ScrollBar
- Control Arrays in VB6
- Files controls in VB6
- VB6 CheckBox
- Forms in VB6
- Menus in VB6
- MDI Form in VB6
- InputBox
- MessageBox
- Mouse events
- Mouse Move
- Error Handling
-
Error Handling (2)
-
VB6 Database

You are here: Visual Basic > VB6 (Beginners Tutorial)

Tutorial Main Page | Previous Page | Contents | Next Page

Bound Data Tools

• Most of the Visual Basic tools we’ve studied can be used as bound, or data-aware, tools (or controls). That means, certain tool properties can be tied to a particular database field. To use a bound control, one or more data controls must be on the form.

• Some bound data tools are:

Label - Can be used to provide display-only access to a specified text data field.

Text Box - Can be used to provide read/write access to a specified text data field. Probably, the most widely used data bound tool.

Check Box - Used to provide read/write access to a Boolean field.

Combo Box - Can be used to provide read/write access to a text data field.

List Box - Can be used to provide read/write access to a text data field.

Picture Box - Used to display a graphical image from a bitmap, icon, or metafile on your form. Provides read/write access to a image/binary data field.

Image Box - Used to display a graphical image from a bitmap, icon, or metafile on your form (uses fewer resources than a picture box). Provides read/write access to a image/binary data field.

• There are also three ‘custom’ data aware tools, the DataCombo (better than using the bound combo box), DataList (better than the bound list box), and DataGrid tools, we will look at later.

• Bound Tool Properties:

DataChanged - Indicates whether a value displayed in a bound control has changed.

DataField - Specifies the name of a field in the table pointed to by the respective data control.

DataSource - Specifies which data control the control is bound to.

If the data in a data-aware control is changed and then the user changes focus to another control or tool, the database will automatically be updated with the new data (assuming LockType is set to allow an update).

• To make using bound controls easy, follow these steps (in order listed) in placing the controls on a form:

  1. Draw the bound control on the same form as the data control to which it will be bound.

  2. Set the DataSource property. Click on the drop-down arrow to list the data controls on your form. Choose one.

  3. Set the DataField property. Click on the drop-down arrow to list the fields associated with the selected data control records. Make your choice.

  4. Set all other properties, as required.

By following these steps in order, we avoid potential data access errors.

• The relationships between the bound data control and the data control are:


  

Tutorial Main Page | Previous Page | Contents | Next Page

   

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved