Use a TSession component and attach all your TTable and TQuery components to it. It has a property called SqlHourGlass that is defined in the help as:
Set SQLHourGlass to False if you do not want the mouse cursor to change to an hourglass while the BDE is waiting for an SQL server to perform...
My suggestion would be to convert the minutes into a standard Delphi Date/Time and then just subtract.
To convert the minutes to a DateTime just divide the number of minutes by (60*24).
i.e.
function subtractMinutesFromDateTime(Time1 : TDateTime;Minutes : extended) : TDateTime;
var...
You say that it saves when you click on another cell. Are you clicking a cell on another row?. Changing rows in a dbGrid does an implicit post of the edited record. Closing a table doesn't.
Here is some code that will do that conversion.
function SecondsBetweenDates(const StartDate, StopDate : TDateTime) : cardinal;
const
SecondsPerDay = 60 * 60 * 24;
RoundFactor = 0.5;
var
DateDiff : TDateTime;
begin
DateDiff := StopDate - StartDate;
result := trunc(DateDiff *...
I've looked at the code for TTable and TQuery. Calling open sets active := true, calling close sets active := false. I don't see an advantage to calling close and open.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.