Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need help for auto update a running balance in adotable - Part III

Posted on 2014-03-19
5
Medium Priority
?
264 Views
Last Modified: 2014-03-24
Part I: http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_28387628.html?anchor=a39927760

Part II: http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_28390885.html#a39936844

... and although it works, there is a new problem. I made an import with 500 records. So new access.accdb is only 460 kb but now running ADODataset with AutoCalcFields needs more than 14 !! seconds to update the balance.

Is there any way to speed up like an excel tabsheet?

Next 500 points from me!

Thanks,
Hair fighting Tom
0
Comment
Question by:Brainwashed2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 27

Expert Comment

by:Sinisa Vuk
ID: 39940335
If it is no problem, can you post this database file here. (or made some test one)
Is ID and Date fields indexed? (Is ID set as primary key?)
0
 

Author Comment

by:Brainwashed2
ID: 39940942
No problem :) See randomized data in attachment.
HHB.accdb
0
 
LVL 27

Accepted Solution

by:
Sinisa Vuk earned 1000 total points
ID: 39949165
As you have db under control (and this is for your own personal usage) - I suggest to add field (in example I add Balance) in which will be added real calculated balance.
I add two buttons - one for recalculate balance and one for just open table (for later usage - once you have balance). Calculating balance can be done after you enter new data - this works a little faster than using sub-select. Hope this help.
db-example.zip
0
 

Author Comment

by:Brainwashed2
ID: 39949725
Thank you for this suggestion. This way was my first strategy, but I wanted to find a solution like Excel with AutoCalcFields.

Your first idea was very good and fast enough, but there was the problem with later added entries and an "useless" new ID. Your second response has now prompted me to another approach. I give each record a unique ID, containing date and a AutoInc time.

02.01.2014 00:00:01
02.01.2014 00:00:02
02.01.2014 00:00:03
03.01.2014 00:00:01
...
15.01.2014 00:00:01
15.01.2014 00:00:02
...
17.01.2014 00:00:01

This way I can use your fast CommandText from your first answer and there is no need, to loop through (perhaps?) >500 entries only at 'refreshtime'.

For your help many thanks and I think, 500 Points are justyfied:)
0
 
LVL 27

Expert Comment

by:Sinisa Vuk
ID: 39949732
Thnx. Access databse is simple to use but not powerful ... so glad that solution comes up...
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

705 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