Article View: borland.public.cppbuilder.database.multi-tier
Article #1668Re: Using cached updates and UpdateSQL on server
From: Boris Tihomirov
Date: Thu, 22 Jul 1999 00:00
Date: Thu, 22 Jul 1999 00:00
55 lines
2307 bytes
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
Technical Details
Message-ID:
<7n72rq$mdu2@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7mspv8$d341@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd2b,8b8dfd1fdc39789b X-Google-Attributes: gidfcd2b,public From: "Boris Tihomirov" <btihomirov@mail.ru> Subject: Re: Using cached updates and UpdateSQL on server Date: 1999/07/22 Message-ID: <7n72rq$mdu2@forums.borland.com> X-Deja-AN: 503987357 References: <7mspv8$d341@forums.borland.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: M@Nevka X-MSMail-Priority: Normal Newsgroups: borland.public.cppbuilder.database.multi-tier