1. VB6 Using ADO Data Control with MS Access 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! Datasource DataField Important Properties! ConnectionString Visible
2. Database 1. click file 2. click New 3. click Blank Database 4. type Filename is StudentInfo (name of the database) 5. click Create
3. Table 1. click table 2. double click create table in design view 3. type the fields (do what is given) 4. click X or Save button 5. type tblStudinfo (the name table) 6. click Ok and click NO/Yes (setting the PK)
4. Converting a Database 1. click tools 2. click database utilities 3. click convert database 4. click access 97 format 5. click OK
5. Adding other component in VB6 1. right click the toolbox 2. click/check Microsoft ADO data Control 3. click Apply 4. click Close
6. How to set the connection string (connect a database) 1. select/click the object Ado Data Control (adodc1) 2. go properties, click connection string ....
7. 3. click build 4. select/click the Microsoft JET 3.51 5. click NEXT
8. 6. select your converted database 7. click Test Connection 8. click Ok 9. click ok
10. 12. select 2cmdTable 13. select the name of the table 14. click apply 15. click Ok You have now successfully connect the ADO data control to MS Access database
11. Connecting other objects (textbox,combobox) to ADO data control 1. select/click the object (textbox/combobox) 2. go to properties window then click categories 3. 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 - lname 5.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...