Code: Select all
/* Connection Settings*/
ConnDba->Pooling = true;
ConnDba->PoolingOptions->Validate = true;
ConnDba->Options->LocalFailover = true;
ConnDba->Options->DisconnectedMode = true;
/* TIBCQuery Seetings*/
T_JRNL1->CacheUpdates = true;
T_JRNL2->CacheUpdates = true;
When executed this code :
Code: Select all
void __fastcall TInpBnkInOtFrm::OpnJrn1Done(TObject *Sender)
{
if(T_JRNL1->IsEmpty()) T_JRNL1->Append();
OpnDt *Dt4 = new OpnDt(true);
Dt4->Dt = T_JRNL2;
Dt4->Id = T_JRNL1JRNL1ID->AsInteger;
Dt4->Resume();
Dt4->OnTerminate = OpnJrn2Done;
}
//---------------------------------------------------------------------------
That codes, basically open an Query on another thread, here is the thread code :
Code: Select all
__fastcall OpnDt::OpnDt(bool CreateSuspended)
: TThread(CreateSuspended)
{
FreeOnTerminate = true;
}
//---------------------------------------------------------------------------
void __fastcall OpnDt::Execute()
{
Dt->Close();
Dt->ParamByName("id")->Value = Id;
Dt->Open();
}
//---------------------------------------------------------------------------
Code: Select all
void __fastcall TInpBnkInOtFrm::OpnJrn1Done(TObject *Sender)
{
if(T_JRNL1->IsEmpty()) T_JRNL1->Append();
PauseInSec(1); -> this will pause app for a second
OpnDt *Dt4 = new OpnDt(true);
Dt4->Dt = T_JRNL2;
Dt4->Id = T_JRNL1JRNL1ID->AsInteger;
Dt4->Resume();
Dt4->OnTerminate = OpnJrn2Done;
}
//---------------------------------------------------------------------------