VB6 MS Chart and Access Database

Hello Experts,

I have an Access database that is being updated every 30 seconds with a new record in the "DATA" table. The record that is inserted contains (Timestamp, Sales, Voids, Coupons).

I want to use MSChart to graph the 3 values (Sales, Voids, Coupons) on the Y axis and use the Timestap as the X axis.

I am having a hell of a time getting this to work. My programming skills are crappy at best :)

Any help is appreciated.
triphenAsked:
Who is Participating?
 
BrianVSoftConnect With a Mentor Commented:
You could have a Timer that fires every 5 secs or so. It does a FindLast on the TimeStamp field and compares that value with a variable PreviousTimeStamp.
If different then..
  (a new record has been added)
  Set PreviousTimeStamp = ThisTimeStamp
   Extract the 3 data values.
  Put them in the Next Column of the Standard style Numeric arrays that the MS Chart examples use.
  Ie. NextRow = NextRow + 1
  ChartData(1 , NextRow) = Sales : ChartData(2 , NextRow) =  Voids : ChartData(3 , NextRow) = Coupons

Add  this timestamp to the data in the X-Axis (I think in row zero of ChartData)

Then refresh the chart display with..  MSChart1 = ChartData

When the chart reaches some limit, you obviously need to sort out a way to move all the elements of the ChartData numeric array back by one row each time (very simple) so that the chart doesn't keep getting tighter.
0
 
triphenAuthor Commented:
The input into the chart will be a constant 4 columns. The application will be similar to a stock market graph updating constantly from an Access database.
0
 
triphenAuthor Commented:
Brain,

Thank you for your response. I am having trouble getting this thing to work like I want it to. If I send you my access database, can you help me write the code that goes in the timer to refresh the graph?
0
 
BrianVSoftCommented:
I could give you an example - but not write the full code..
I would need to know which database "method set" you prefer to work with..
There are about 6 method sets you can use that are like language sub-sets..
You would need to be familiar with at least one of them.
If you are not familiar with ADO or DAO, you might try looking at common examples using Data-Controls. They are fairly easy to use.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.