Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Create a Chart from a table column
Message
 
To
09/08/2000 06:27:57
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00402692
Message ID:
00404415
Views:
10
>i need to know that a chart is to be create from all 10 values of a table's column prophet against year
>ie
>Year-------Prophet
>1990-------10000
>1991-------12000
>1992-------11000
>1993-------12500
>1994-------12900
>1995-.......
>i am using Access tbl please provide a code to create a chart from these values from VB
>any help will highly be appriciated.
>thanx
>rafiq_1398@yahoo.com

This should suffice:
Private Sub Command1_Click()
Dim rst As ADODB.Recordset

    Set rst = New ADODB.Recordset
    With rst
        .ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=d:\Projets VB\Tips & Techniques\MS-Chart\db1.mdb"
        .CursorLocation = adUseClient
        .CursorType = adOpenStatic
        .LockType = adLockReadOnly
        .Source = "Table1"
        .Open
        .MoveFirst
    End With
    
    Set MSChart2.DataSource = rst
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform