SQLRefresh?

SQLRefresh?

Postby tom » Thu 18 Nov 2004 20:50

Can anyone tell me when do I need to use the SQLRefresh property of a TMyQuery? I have never needed to use it before, but I am coming up with a message telling me that the refresh failed (found 0 records) when I try to modify a reocrd - it seems that the record can't be found after I change one of the numeric fields. Are there any guidelines as to when this needs to be used? Also, is there any simplified way of putting SQL statements in here? Currently, I am filling it with an (almost) exact copy of the original query in order for it to find the record that it being changed, but it seems that it should only really need to know what the key fields are that identify the record, rather than the whole query complete with select clause and joins. Am I making sense?
tom
 

Re: SQLRefresh?

Postby Ikar » Fri 19 Nov 2004 16:23

> Can anyone tell me when do I need to use the SQLRefresh property of a TMyQuery?

At the most cases there is no need to fill SQLRefresh, SQLInsert, SQLUpdate and SQLDelete.

> message telling me that the refresh failed (found 0 records)

As usual, these problems can happen if you don't have a unique key field in the query. Add unique key fields and the problem will be solved.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56


Return to MySQL Data Access Components