Professional Documents
Culture Documents
ANDHRA PRADESH
Name : Y. Vijaya Bhaskara Reddy
Designation : Senior Lecturer
Branch : Commercial and Computer
Practice
Institute : G.P.W ., Kakinada
Year/Semester : VI Semester
Subject : Visual Basic – II
Subject Code : CCP – 603
Topic : Database Programming
Duration : 50 Mts
Sub Topic : Connecting to database tables
Teaching Aids : PPTs
CCP603.16 1
Objective :
CCP603.16 2
Structure Of The Period :
CCP603.16 3
Recap :
CCP603.16 4
Location of Data Control Icon :
Data Control
CCP603.16 5
Adding the Data Control to the
Form :
Double Click on the Data Control Icon in
the Tool Box
A new Data Control with name “Data1” is
placed on the Form, which looks as shown
below:
CCP603.16 6
Procedure of connecting
database tables :
Properties window of Data Control
CCP603.16 7
Procedure of Connecting
Database Tables :
Press Ctrl+N in Visual Basic to start a new
project
From the New Project dialog box, select
Standard EXE and Click OK
Add two text boxes to the top of a form
Double-click the data control in the Tool Box
to add it to the form
Drag the newly added data control to position
it below the Text boxes
CCP603.16 8
Procedure of Connecting
Database Tables :
This example uses ‘Authors’ tabel of Biblio.mdb
supplied by Microsoft
Widen the data control to see its caption. It
looks as shown below
Remove the text of Text boxes
CCP603.16 9
Procedure of Connecting
Database Tables :
Set the properties of the data control as follows:
CCP603.16 11
Procedure of Connecting
Database Tables :
Run the program and scroll through the records
with the navigation buttons on the data control
When clicked on Move First, it shows the first
record as shown below:
CCP603.16 12
Procedure of Connecting
Database Tables :
When clicked on Move Last, it shows the last
record as shown below:
CCP603.16 13
Summary :
Data Control is used to connect database
tables to the form in Visual Basic
By setting the Database Name and Record
Source properties of data control, tables
are connected
To display the data, text boxes are used
Data Source and Data Field properties of
text box are used for this purpose
CCP603.16 14
Quiz :
1. How Data Control is added to the form ?
Ans: By double clicking the icon in tool box
CCP603.16 16
Assignment :
CCP603.16 17
Thank You
CCP603.16 18