You are on page 1of 13

WORKING WITH FORMS- A STEP BY STEP GUIDE

For making ODBC Data Source Control Panel (Switch to Classic View) Administrative tools Data Sources (ODBC)

www.skedocs.blogspot.com

Choose System DSN Tab Add IBM DB2 ODBC DRIVER

www.skedocs.blogspot.com

Your DB Name created using DB2

To Opening Visual Basic Form Start Programs Microsoft Visual Studio 6.0 Microsoft Visual Basic 6.0

Standard EXE Open www.skedocs.blogspot.com

Design the form with required fields

Labels, Text Box, Buttons, etc..

Properties

To Access the ADODC Option for connecting VB to DB Click Project option from tool bar components

www.skedocs.blogspot.com

www.skedocs.blogspot.com

Check Microsoft ADOdata control 6.0, Microsoft DataGrid Control 6.0

www.skedocs.blogspot.com

To Connect VB to DB Select and open the ADODC component into the form Right click ADODC properrties

www.skedocs.blogspot.com

In General Tab check Use ODBC Data Source Name have added the data source through Control Panel)

Select the DB name (It will be available only if you Apply

In Record Source Tab, select Command type as Table and select the table name(Which you have already created using DB2)

www.skedocs.blogspot.com

To Connect the Text box to Respective Fields Click each textbox and in its properties, set DataSource as ADODC1 Set Data Field as the respective fields

www.skedocs.blogspot.com

To Connect to the Grid Select and open the grid component in the form. In grid properties, set the DataSource as ADODC1

www.skedocs.blogspot.com

Click the start button on the menu tool bar (or) select from menu Run start to see the results

WORKING WITH REPORTS


Go to project components designers tab add data report and data environment

Go to project add data environments

www.skedocs.blogspot.com

Right click connection properties IBM OLE DB Provider for DB2 next Data source name ok

Right click Connection1 add Command Right click command1 In properties set database object as Table and select the object name as Table name Click project in menu, select add data report Select data report1, in properties set data source as dataenvironment1 Set datamember as command1 In the Detail part of the report right click insert control Text box In the properties of the text box set Data member as Command1 Set Data field as the respective field

www.skedocs.blogspot.com

www.skedocs.blogspot.com

You might also like