RefreshQuick strange behavior ?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

RefreshQuick strange behavior ?

Post by swierzbicki » Fri 12 Dec 2008 15:54

Hi,

Today I started working with the RefreshQuick method for the 1rst time.
I've read the documentation and added a TimeStamp field called TimeStampModification (my table had already an Unique / Primary / AutoInc field).

When calling the refreshQuick method and setting the debugger to true MyDAC is generating this query :

Select
...
From Planning
Inner join ....
....
Where
....
AND planning.TimeStampModification >= '2008-12-29 00:00:00'
This looks good but the TimeStamp date is false !
'2008-12-12 00:00:00' instead of '2008-12-29 00:00:00'

Any clue ?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 16 Dec 2008 12:13

A TimeStamp field keeps the date of the record latest modification. Therefore the RefreshQuick method gets the maximum timestamp value of an open recordset and uses it in the generated query. In this case it gets all records that were changed after last opening the recorset.
In your case it seems that your table contains a timestamp field with the specified value, which is incorrect, and you should correct it.

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Tue 16 Dec 2008 15:30

Hi Dimon,

I have search through my record and didn't find a record having this value.
This SQL query always return an empty set :

Code: Select all

select * from planning where planning.TimeStampModification >= now()
I'll try to make you a demo project.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 17 Dec 2008 13:36

It is possible that your query contains TimeStamp fields from this table or from other tables which belong to the same TableInfo object.

Post Reply