Thread View: borland.public.cppbuilder.database.multi-tier
1 messages
1 total messages
Started by Sveta
Thu, 26 Jul 2001 08:50
TDataSetProvider can't aasign NULL value
Author: Sveta
Date: Thu, 26 Jul 2001 08:50
Date: Thu, 26 Jul 2001 08:50
41 lines
2291 bytes
2291 bytes
Hi collegues!
I use Builder4 in multi-tier application.
Trying to set NULL in memo field, I've found that
function Param->AssignFieldValue can't do it!
Not null - please, but when I clear field on client
side and use standart event on DataSetProvider in server,
that field in table has old value. Anybody knows is it bug
or I am big fool? (See the code below)
void __fastcall TDBServer::GridConfigProviderBeforeUpdateRecord(
TObject *Sender, TDataSet *SourceDS, TClientDataSet *DeltaDS,
TUpdateKind UpdateKind, bool &Applied)
{
TQuery * Query = UpdateSQLGrid->Query[UpdateKind];
Query->SessionName=MtrDatabase->SessionName;
Query->DatabaseName=MtrDatabase->DatabaseName;
//for(int i=0; i < 9; i++)
for(int i=0; i < SourceDS->Fields->Count; i++)
{
AnsiString Name=SourceDS->Fields->Fields[i]->FieldName;
TParam * Param=Query->Params->FindParam(Name);
if(Param)
{
Variant var = DeltaDS->Fields->Fields[i]->NewValue;
Variant old = DeltaDS->Fields->Fields[i]->OldValue;
if(var.IsEmpty()) // || var.IsNull())
Param->AssignFieldValue(DeltaDS->Fields->Fields[i], old);
else
Param->AssignFieldValue(DeltaDS->Fields->Fields[i], var);
}
Param=Query->Params->FindParam("OLD_"+Name);
if(Param)
{
Param->AssignFieldValue(DeltaDS->Fields->Fields[i], DeltaDS->Fields->Fields[i]->OldValue);
}
}
Query->Prepare();
Query->ExecSQL();
Applied=true;
}
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