vb6 using ado data control

15
Objects/controls are connected to ADO Data Control ADO Data Control is connected to MS Access Data All information will be save to MS Access Database (Table) Note: you can only connect all the objects/control you Set-up first the ADO data control. Important Properties! Datasource DataField Important Properties! ConnectionString Visible

Upload: notre-dame-of-midsayap-college

Post on 15-Dec-2014

15.370 views

Category:

Education


20 download

DESCRIPTION

 

TRANSCRIPT

Page 1: VB6 Using ADO Data Control

Objects/controls are connected to ADO Data Control

ADO Data Control is connected to MS Access Database

All information will be save to MS Access Database (Table)

Note: you can only connect all the objects/control IF !you Set-up first the ADO data control.

Important Properties!DatasourceDataField

Important Properties!ConnectionStringVisible

Page 2: VB6 Using ADO Data Control

Database1. click file2. click New3. click Blank Database4. type Filename is StudentInfo (name of the database)5. click Create

Page 3: VB6 Using ADO Data Control

Table1. click table2. double click create table in design view3. type the fields (do what is given)4. click X or Save button5. type tblStudinfo (the name table)6. click Ok and click NO/Yes (setting the PK)

Page 4: VB6 Using ADO Data Control

Converting a Database1. click tools2. click database utilities3. click convert database4. click access 97 format5. click OK

Page 5: VB6 Using ADO Data Control

Adding other component in VB61. right click the toolbox2. click/check Microsoft ADO data Control3. click Apply4. click Close

Page 6: VB6 Using ADO Data Control

How to set the connection string (connect a database)1. select/click the object Ado Data Control (adodc1)2. go properties, click connection string ....

Page 7: VB6 Using ADO Data Control

3. click build4. select/click the Microsoft JET 3.515. click NEXT

Page 8: VB6 Using ADO Data Control

6. select your converted database7. click Test Connection8. click Ok9. click ok

Page 9: VB6 Using ADO Data Control

10. click apply11. click RecordSource TAB

Page 10: VB6 Using ADO Data Control

12. select 2cmdTable13. select the name of the table14. click apply15. click Ok

You have now successfully connect the ADO data control to MS Access database

Page 11: VB6 Using ADO Data Control

Connecting other objects (textbox,combobox) to ADO data control1. select/click the object (textbox/combobox)2. go to properties window then click categories3. click DataSource and select the ADO data control (Adodc1-you can change this name)4. click DataField and select the field assigned of the object/control(textbox/combobox)

ex. lastname - lname5.do the same step in step4 with the other objects needs to connect to your ADO data Control

...you are now successfully connect the objects to your ADO Data Control...

Page 12: VB6 Using ADO Data Control

Inserting a code1. double click each command button with the corresponding codes shown (code window)

Page 13: VB6 Using ADO Data Control
Page 14: VB6 Using ADO Data Control
Page 15: VB6 Using ADO Data Control