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 

+++ TClientDataSet in Multi-User-Environment +++

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop)
View previous topic :: View next topic  
Author Message
FRANCK GmbH (L.Hillebrand
Guest





PostPosted: Mon Sep 13, 2004 7:22 am    Post subject: +++ TClientDataSet in Multi-User-Environment +++ Reply with quote



I use a ClientDataSet to show a table opened with ADOTable
an VFPOLEDB.

The ClientDataset works fine as single user.

When i change a record (for example with VisualFoxPro
development environment) and a few secondes later try to
change the same record in the ClientDataSet i get two
exceptions (see the code below)
The first exception is necessary, as the record is changed
by another user like it says.

So the real problem is: Directly after the first exception
the second exception appears - the code in the catch part
is NEVER executed, so it is NOT possible to solve the
problem (for example to refresh the shown data or only
that record ...)

Is this a common problem with ClientDataSets ?
How to solve it ?


Lutz

===============================================================
void __fastcall TFormDBF::cdsAfterPost(TDataSet *DataSet)
{
int iErrors ;

// ClientDataSet writes changes with ApplyUpdates()
try
{
// ApplyUpdates() makes Exception if another user
// has changed data in the meantime
// o EDatabaseError: Record not found or changed by another user
// followed by ...
// o EDatabaseError: Record not found, no key / index known
iErrors = cdsDbf->ApplyUpdates(0) ;
}
catch(Exception &ex)
{
// CATCH is NEVER executed
...
}
}
===============================================================
Back to top
Evandro Dugnani
Guest





PostPosted: Thu Sep 16, 2004 4:48 pm    Post subject: Re: +++ TClientDataSet in Multi-User-Environment +++ Reply with quote



Try catching any exception:

catch(...)
{
...
}
}


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop) 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.