Professional Documents
Culture Documents
Start up VB with a standard Exe project. Go to project menu and select components or Ctrl+T) (fig).
` ` ` `
When we select components a dialog box appear and add:Microsoft FlexGrid control 6.0 From that dialog box.
` `
Now we will see the new tool populated in the toolbox can be shown in the toolbox (fig):Now change the name of the main form to frmflexgrid or any other name acording to our wish.
` `
`
` ` ` `
`
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `
9. We have to sepecify the connection location to data Access for that purpose do coding upon the form load event as Private Sub Form_Load() Set DB = OpenDatabase("D:\BCA.MDB") Set RS = DB.OpenRecordset("SELECT DISTINCT CLASS FROM BCA") Do Until RS.EOF Combo1.AddItem RS!Class RS.MoveNext Loop End Sub 10.Save and run the project it will display in the following format and help us to show in a flexgrid with using data combo as it source. our data
` ` ` ` ` ` ` ` ` ` `
` `
1. Start up VB with a standard Exe project. 2. Go to project menu and select components (Ctrl+t) (figure). 3. Now add control to our project that is:Microsoft Data list control 6.0 (OLDEB) Then click apply and ok.(figure)
` `
3. Now we will see that toolbox is populated with two more icons as shown in the figure:4. Now change the property of the main form as :S.no i. ii. iii. Name Name Font Window Status Caption Frm_Datagrid Times new Roman (14) Maximize
7.
Now it will display property page (Figure) for the ADODC control that we added In our project . Select the source of the connection as use connection string and click build Button.
8. Now it will display another dialog DATA LINK PROPERTY pops up. Select Microsoft jet 3.51OLE DB Provider from the list and click next.(figure)
9. We have to sepecify the connection to data access. Select the data base name. and then click on test connection button. If the connection is properly connected to our ACCESS database then it will display the dialog box as text connection succeded.(fig)
10. Once all we have done then click OK on Data Link dialogbox and again in property page dialog.
11. Now once again in the property pages select the record source tab, set command type the source string which contain access statement. i.e. 2 adcmdTable
12. Table name this contain name of the access file. i.e.
12 .Now draw the data list into the form and set all the property of it as
S.NO
PROPERTY
13. After all is done save the form and create the start up object as our ok.
14. Run the form by clicking (f5) or by clicking start from the tool bar. It will display the form in this way.