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.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
triphenAuthor Commented:

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?
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.