Solved

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

Posted on 2014-03-19
5
261 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 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 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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month5 days, 2 hours left to enroll

636 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