Solved

MSChart help - damzil in distress!

Posted on 2004-04-05
10
206 Views
Last Modified: 2013-12-25
Hi guys, i have a little problem,

I have a database called 97medical.mdb.

In this database are some tables, and one in particular called "patient".

In patient table, there is a field called "gender", in which it specifies if the patient is a male or female..

What i want to know is how do i create a bar graph, showing how many male patients are on the database and how many female patients there are?

I am really really new to this, so it would be great if you could post each step by step.

Many thanks in advance you lurvley people!  (Oh what! - no smileys, o well....cheeky_galuk winks)LOL

ps,i,m using VB6.
0
Comment
Question by:cheeky_galuk
  • 5
  • 3
10 Comments
 
LVL 29

Expert Comment

by:leonstryker
ID: 10759875
Take a look here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mschrt/html/vbobjVtChartObject.asp

Basically once you have the numbers from the database just setup the properties of the object.

Leon
0
 

Author Comment

by:cheeky_galuk
ID: 10760677
Hey there Leon,

thanks for that, but i,ve already tried MSDN, planet-source code and other various sites/books, but i really dont understand it.

That MSDN site is soo confusing.  Why dont microsoft write that sort of help in proper english so that complete newbies like me can understand it.

o well, enough ranting -

When you mean numbers from the database, how do you mean?

I thought that VB would calcualte how many patients are male and how many are female by reading it from the database.?

Thanks + looking forward to your reply...
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 10761750
Create a connection to the database, setup an DAO or an ADO object and write a SQL query to return you the number of male and female patients, something like:

SELECT COUNT(gender)  FROM patient WHERE gender = 'male'
UNION
SELECT COUNT(gender)  FROM patient WHERE gender = 'female'

Now you have a recordset with the number of men and women, you can then display these values any way you need to.

Leon

0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:cheeky_galuk
ID: 10763874
Hi leonstryker,

sorry if i am asking silly questions, but i,m not that familar with VB..

how do i set a DAO/ADO object to my database?

Also, that SQL query, do i type that into the MSChart1's code page?

Once again, sorry if this questions seem silly to you, but i,m not too familar with this..

thanks
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 10765200
cheeky_galuk,

You are asking at least 3 separate questions here and it seems you do not have I lot of experience with VB as well.  Is this project by change school work?

Leon
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 10765522
Same question by different person:

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Databases/Q_20941092.html

You guys must be taking the same class.  ;)

Leon
0
 

Author Comment

by:cheeky_galuk
ID: 10765854
LOL, Leon, i am 38 years old and can assure you i am not at school, lol

As it is holidays here, i decided to pratice with some VB stuff, and just asking out of curiosity,

as for the the other post, i actually didnt see that on here, but similar question - i agree..
0
 
LVL 29

Accepted Solution

by:
leonstryker earned 125 total points
ID: 10765984
Well the first thing you need to know is to how to use ADO so take alook here:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=12050&lngWId=1

Leon
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

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