Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Connecting MS Chart with MS Access Database

Posted on 2000-04-07
9
Medium Priority
?
232 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 154 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
Industry Leaders: 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

972 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