Solved

Connecting MS Chart with MS Access Database

Posted on 2000-04-07
9
210 Views
Last Modified: 2013-12-25
Currently I have created database using the MS Access then I used the Visual Data Manager to create a data form, but still don't know how to create a chart.

The table in the database has several column e.g. company_name, price, and transactions.

How to create a chart, by using MS Chart to show the data stored in the database (trade.mdb)-> X-axis=company_name and Y-axis=price ???
And how to create the legend?
0
Comment
Question by:johanesj
  • 3
  • 3
  • 3
9 Comments
 

Author Comment

by:johanesj
ID: 2695680
Adjusted points from 0 to 77
0
 

Author Comment

by:johanesj
ID: 2695681
URGENT !!
0
 
LVL 12

Accepted Solution

by:
mark2150 earned 77 total points
ID: 2697178
The M$Chart control is a turd and should be deleted from your system as it isn't worth the disk space it takes up.

Even if you can get your chart to look nice you'll run into a *nasty* surprise when you find out the !@#$%^ thing doesn't have a .Print method! Yes, you can FormPrint it but it'll look like *crap* when it hits the paper.

Now myself, I've found that for 2D work you can easily draw a chart on any form or picturebox by setting the .Scale property and then using the .Line and .Circle commands to render what you want. You can move the print cursor with .CurrentX/Y and .Print whatever text you want whereever you want in whatever font you want.

With just minor changes you can make the *same* routine act as both your on screen print preview rendering routine as well as the final print driver. You simply pass an Object to the routine as a parameter and then the .Scale etc are all on that object instead of hard coding the picturebox. If you want to show it on screen pass it the picturebox or a form, if you want it on paper pass it the Printer object.

Within the routine itself you'll have to put conditional logic around a few statements that aren't common to both types of control. You can't .Cls the printer and you can't .EndDoc a picture box. Use a statement like:

If TypeName(Obj) = "Printer" then ...

to gate around the few device specific statements.

Anyway, this will give you much better control over your graphs and the ability to print with the full resolution possible on your printer.

M
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:Marine
ID: 2697738
Hey Mark wanna give me some code example on that ? I would like to do that as well. For example i have field
catagories in books. And i want to show one catagory has this many books the other has so many books and the last has that many. How would i plot the values for these ? Thanks.
0
 
LVL 6

Expert Comment

by:Marine
ID: 2697774
Hey mark would this work if i do so or just point me to rgiht direction. Say i get a recordcount of how many records i have in each catagory . And then just plot the number of records i have. Would that work for this ?
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2697923
You can easily plot stuff. Check out my web page and there is an app there that does exactly what you're after (if the link is dead let me know, my site got toasted at the first of the year and I'm still rebuilding...)

www.netexperts.cc/~lambertm

M
0
 
LVL 6

Expert Comment

by:Marine
ID: 2697997
Wow Mark this is really cool it looks Great. My problem is understanding math there a little bit. Mind if i ask you a few questions here and there on your code ? I just want to understand it more clearly. Thank you.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2698382
No problem. Email me direct at lambertm@netexperts.cc

M
0
 

Author Comment

by:johanesj
ID: 2727061
WHat I want is to use MS CHart not draw manually using line.
But thanks mark :)
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question