Solved

MSChart help - damzil in distress!

Posted on 2004-04-05
10
207 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 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…

821 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