BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Wrestling with BeforeUpdateRecord

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Frank Burleigh
Guest





PostPosted: Tue May 11, 2004 11:41 pm    Post subject: Wrestling with BeforeUpdateRecord Reply with quote



Greetings group. I've spent the better part of the day learning the
trick that makes client data set (midas) update a (sybase) table when
the sql that populated the client data set is like:

select care.*,nocare.Description
from realdatatable care, humantexttable nocare
where care.SomeKey*=nocare.Description

What I learned is that Delta in the CDS is like a dataset on its own,
and that you have to hide fields within it from BeforeUpdateRecord on
the client data set.

void __fastcall Something::BeforeUpdateRecord(
TObject *Sender, TDataSet *SourceDS, TCustomClientDataSet *DeltaDS,
TUpdateKind UpdateKind, bool &Applied)
{
TField* f=DeltaDS->FieldByName("Description");
f->ProviderFlags.Clear();
}

I also learned that, with this sql, this callback wasn't necesary:

void __fastcall Something::BDEClientDataSet1GetTableName(TObject
*Sender, TDataSet *DataSet, AnsiString &TableName)
{
TableName="realdatatable";
}

Now some questions:

1. could this be done more efficiently?

2. upWhewreAll seems ineffecient but upWhereKeyOnly can't be
satisfactory (I'd guess) because the client data set doesn't really know
the indexes for the underlying table. Is there a means to tell it?

3. Has the client data set / midas architecture squirled away somewhere
any record of the table source for each field? If so, that would
obviate any need for me to keep separate records about which fields need
the ProviderFlags.Clear() treatment.

If it matters, all my client data sets are made with new not d'n'd; db
server is either Sybase or Oracle.
--
Frank Burleigh
Indiana University School of Law
[email]burleigh (AT) indiana (DOT) edu[/email]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.