Solved

Connecting MS Chart with MS Access Database

Posted on 2000-04-07
9
180 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
Comment Utility
Adjusted points from 0 to 77
0
 

Author Comment

by:johanesj
Comment Utility
URGENT !!
0
 
LVL 12

Accepted Solution

by:
mark2150 earned 77 total points
Comment Utility
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
 
LVL 6

Expert Comment

by:Marine
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 6

Expert Comment

by:Marine
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
No problem. Email me direct at lambertm@netexperts.cc

M
0
 

Author Comment

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

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now