Solved

Connecting MS Chart with MS Access Database

Posted on 2000-04-07
9
198 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
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

770 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