🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
2 messages
2 total messages Started by Alex Sun, 18 Jul 1999 00:00
Using cached updates and UpdateSQL on server
#1660
Author: Alex
Date: Sun, 18 Jul 1999 00:00
11 lines
987 bytes
I use view as source of data on server side. I need use UpdateSQL for
applying updates to tables. View is connected with TDatasetProvider, which
is exposed for clients using.
When I don't use cached updates with my view, UpdateSQL doesn't work. As I
see on SQL Monitor, BDE tries to apply updates into my read only view and
fails, of cause.
When I use cached updates, it always adds only first record in cache. How
can I manage to apply my updates when I use chaging data through Dataset and
UpdateSQL.

Alex
Re: Using cached updates and UpdateSQL on server
#1668
Author: Boris Tihomirov
Date: Thu, 22 Jul 1999 00:00
55 lines
2307 bytes
Hi, Alex!

There is 2 ways to solve this problem:

1).

Use TQuery component with SQL='SELECT * FROM ViewName' and TDataSetProvider
(or TProvider with option ResolveToDataSet=true). In this case you should
write AfterUpdateRecord event handler like this:

{
    ((TBDEDataSet *)SourceDS)->ApplyUpdates();
}

or add to RDM interface method, for example, ApplySourceDS and at client
side write something like this:

{
    if(0 == ClientDataSet->ApplyUpdates(-1))
    {
        (* I don't remember, how to call RDM's method in C++Builder, but in
Delphi it
            sounds like this: TMidasConnection.AppServer.ApplySourceDS;
*)
    }
}

Note, that TQuery must have CachedUpdates and RequestLive properties set
into TRUE. Also, all it works probably when you set TProvider->UpdateMode =
upWhereKeyOnly. In this case on TClientDataSet you should set key fields
(see ProviderFlags property for TField component).

2). The second one:
If you're using IB5 you can create updatable views (see IB documentation).

--
Boris Tihomirov
SPb, Russia

P.S. You can write me directly btihomirov@mail.ru (in russian)

Alex <alex740@mail.ru> wrote in message
news:7mspv8$d341@forums.borland.com...
| I use view as source of data on server side. I need use UpdateSQL for
| applying updates to tables. View is connected with TDatasetProvider, which
| is exposed for clients using.
| When I don't use cached updates with my view, UpdateSQL doesn't work. As I
| see on SQL Monitor, BDE tries to apply updates into my read only view and
| fails, of cause.
| When I use cached updates, it always adds only first record in cache. How
| can I manage to apply my updates when I use chaging data through Dataset
and
| UpdateSQL.
|
| Alex
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads