VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

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

Example - Accessing the Books Database

1. Start a new application. We’ll develop a form where we can skim through the books database, examining titles and ISBN values. Place an ADO data control, two label boxes, and two text boxes on the form.

2. If you haven’t done so, create a data link for the BIBLIO.MDB database following the steps given under Data Links in these notes.

3. Set the following properties for each control. For the data control and the two text boxes, make sure you set the properties in the order given.

BorderStyle - 1-Fixed Single
Caption - Books Database
Name - frmBooks

Caption - Book Titles
ConnectionString - BIBLIO.UDL (in whatever folder you saved it in - select, don’t type)
RecordSource - SELECT * FROM Titles
Name - dtaTitles

Caption - Title

Caption - ISBN

DataSource - dtaTitles (select, don’t type)
DataField - Title (select, don’t type)
Locked - True
MultiLine - True
Name - txtTitle
Text - [Blank]

DataSource - dtaTitles (select, don’t type)
DataField - ISBN (select, don’t type)
Locked - True
Name - txtISBN
Text - [Blank]

When done, the form will look something like this (try to space your controls as shown; we’ll use all the blank space as we continue with this example):

4. Save the application. Run the application. Cycle through the various book titles using the data control. Did you notice something? You didn’t have to write one line of Visual Basic code! This indicates the power behind the data tool and bound tools.


Tutorial Main Page | Previous Page | Contents | Next Page


Home | About Us | Privacy Policy | Contact Us

Copyright © | All Rights Reserved