Solved

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

Posted on 2014-03-19
5
247 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
  • 3
  • 2
5 Comments
 
LVL 25

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 25

Accepted Solution

by:
Sinisa Vuk earned 500 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 25

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now