Creating a Chart using Data from a Database with MS Chart Control - Visual Basic Project to retrieve data
(Page 2 of 4 )
Adding a Microsoft Chart Control
Create a standard exe project and going from Project-->Components, add a reference to the MS Chart Control as shown in the next picture.

This control, Microsoft Chart Control 6.0 (SP4)(OLE DB)[mschrt20.ocx] is located at C:windowssystem32 directory. With this added you will be able to access its properties and methods. It has a large number of properties and methods out of which we will be using only a few. The object browser shows all the properties and methods. Interestingly enough, the DataSource class is not found, a property used in one of Microsoft's own examples. This is very interesting in light of the fact that Microsoft considers MS Chart a control to which data can be bound.

Adding a reference to the ADO 2.8 library
Going from Project-->References in the drop-down, the References window can be accessed, which shows the large number of library references that VB 6 programs can access. Make sure that the Microsoft Activex Data Objects 2.8 library has a check mark against it before you close this window. There are a large number of tutorials on the ASPFree.com site where you can find details about the various objects represented by the ADO object model.

Next: Connecting the chart to data >>
More Code Examples Articles
More By Jayaram Krishnaswamy