I Have a problem in my project..
I develop database application and use TQuery to view and update data,
but TQuery have no metode for refresh dataset, so I have been close and open
TQuery to refresh dataset. that way not efective because potition a pointer
cursor always on top and I have to locate last potition of record.
I see in TIBQuery have metode for refresh dataset.
Any sugestion for its.... ?
Amin.
Closing and opening is the only way to do it for a TQuery. Perhaps you could
order your data last-to-first so that the record you want is always on top?
Christopher Latta
are you have a procedure for refresh TQuery ?
regards,
Amin.
"Christopher Latta" <nob...@nowhere.not> wrote in message
news:3b26d6cb_2@dnews...
That's the correct way to do it. It's also the same thing as
TTable.Refresh does internally.
> I see in TIBQuery have metode for refresh dataset.
TIBQuery.Refresh refreshes the current record only. To refresh the
entire selection with IBQuery, you need to do exactly what you've
described above.
HTH,
-Craig
--
Craig Stuntz (TeamB) Senior Developer, Vertex Systems Corp.
Delphi/InterBase weblog: http://delphi.weblogs.com
Use Borland servers; posts via others are not seen by TeamB.
For more info, see http://www.borland.com/newsgroups/genl_faqs.html
This is the code in the public section of the reclassed object
procedure Refresh(aKeepPos : boolean = True; aPrimaryKeyFieldName : string
= 'PK');
procedure TMLSQuery.Refresh;
var
iStorePK : Integer;
begin
try
DisableControls;
iStorePK := 0;
if aKeepPos then
iStorePK := FieldByName(aPrimaryKeyFieldName).AsInteger;
Close;
Open;
if aKeepPos and (iStorePK <> 0) then
try Locate(aPrimaryKeyFieldName, iStorePK, []) except end;
finally
EnableControls;
end;
end;
Heres a couple sample calls
MyQuery.Refresh;
MyQuery.Refresh(False);
MyQuery.Refresh(True,'DifferentPrimaryKeyField');
"Amin" <ami...@hotmail.com> wrote in message news:3b26f650_2@dnews...
Sorry, my english not good.
regards,
Amin.
"David Gagnon" <le...@freeway.net> wrote in message
news:3b27861a$1_1@dnews...
regards,
Amin
regards,
Amin
They have nothing to do with one another.
FetchAll retrieves every record from the DB server and buffers it on
the client.
ApplyUpdates is used only with Cached Updates (or TClientDataset) and
is used to tell the TQuery to post all cached changes to the DB server.
Because it depends on Paradox, among other reasons, I strongly recommend
that you do not use Cached Updates with TQuery when your DB back end is
a C/S database.
"Craig Stuntz (TeamB)" wrote:
>
> ApplyUpdates is used only with Cached Updates (or TClientDataset) and
> is used to tell the TQuery to post all cached changes to the DB server.
> Because it depends on Paradox, among other reasons, I strongly recommend
> that you do not use Cached Updates with TQuery when your DB back end is
> a C/S database.
What is your recommendation or the best way to work with TQuerys?
This question is because we are working with D5 and Oracle 8i and we use Tquerys
and cache updates. Are we "walking" in the wrong direction?
Either don't cache updates at all or do it with TClientDataset.
> This question is because we are working with D5 and Oracle 8i and we use Tquerys
> and cache updates. Are we "walking" in the wrong direction?
The BDE's implementation of cached updates uses Paradox errors
internally. When used in a multiuser configuration, Paradox tends to
become unstable. There are fixes for most of the issues, but some of
them are rather involved, and involve updating the OS at each customer
installation. IMHO, it's more trouble than it's worth. TQuery works
fine if you don't cache updates, and if you do want to cache updates
then using TClientDataset instead will give you a growth path to
DataSnap and n-tier architectures.
Personally, I don't like caching updates, as I feel that the server
should always be the final arbiter of what is or is not allowed into the
DB.
Just curious, how is cachedupdates (versus MIDAS/DataSnap) not allowing the
sever to be the final arbiter?
krf
"Craig Stuntz (TeamB)" wrote:
> Rogelio Argueta wrote:
> >
> > What is your recommendation or the best way to work with TQuerys?
>
> Either don't cache updates at all or do it with TClientDataset.
I can't find the TClientDataset in my Data Access palette. Where is it?
>
>
> > This question is because we are working with D5 and Oracle 8i and we use Tquerys
> > and cache updates. Are we "walking" in the wrong direction?
>
> The BDE's implementation of cached updates uses Paradox errors
> internally. When used in a multiuser configuration, Paradox tends to
> become unstable. There are fixes for most of the issues, but some of
> them are rather involved, and involve updating the OS at each customer
> installation. IMHO, it's more trouble than it's worth. TQuery works
> fine if you don't cache updates, and if you do want to cache updates
> then using TClientDataset instead will give you a growth path to
> DataSnap and n-tier architectures.
Is there a friendly help to learn the use of this component?
It's just a user interface issue. IMHO, it's a bad idea to let the
user leave a record when it contains invalid data -- having to wade
through a long list of reconcile errors later on is burdensome on the
non-technical user. This means you need to either re-implement server
constraints on the client (error-prone) or not cache updates.
That said, I do like the "DataSnap as a replacement for cached updates"
architecture, because it allows very easy upscaling to n-tier
architectures. I just ApplyUpdates after every post.
Again, IMHO,
On D5E it's in the MIDAS tab. On D6P/E it's on the Data Access tab.
> Is there a friendly help to learn the use of this component?
Yes:
http://www.borland.com/midas/papers/clientdataset