clientunit.cpp

来自「Direct Oracle Access 非常好的Oracle数据库直接访问组」· C++ 代码 · 共 55 行

CPP
55
字号
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "ClientUnit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TMainForm *MainForm;
//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormCreate(TObject *Sender)
{
  DeptClientDataSet->Active = true;
  EmpClientDataSet->Active  = true;
}
//---------------------------------------------------------------------------
// Apply the updates in the dept table
void __fastcall TMainForm::DeptApplyBtnClick(TObject *Sender)
{
  DeptClientDataSet->ApplyUpdates(1);
}
//---------------------------------------------------------------------------
// Apply the updates in the demp table
void __fastcall TMainForm::DeptClientDataSetReconcileError(
      TClientDataSet *DataSet, EReconcileError *E, TUpdateKind UpdateKind,
      TReconcileAction &Action)
{
  Action = HandleReconcileError(this, DataSet, UpdateKind, E);
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::EmpClientDataSetReconcileError(
      TClientDataSet *DataSet, EReconcileError *E, TUpdateKind UpdateKind,
      TReconcileAction &Action)
{
  Action = HandleReconcileError(NULL, DataSet, UpdateKind, E);
}
//---------------------------------------------------------------------------
// Cancel the updates
void __fastcall TMainForm::DeptCancelBtnClick(TObject *Sender)
{
  DeptClientDataSet->CancelUpdates();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::EmpClientDataSetNewRecord(TDataSet *DataSet)
{
  EmpClientDataSet->FieldByName("DEPTNO")->Value = DeptClientDataSet->FieldByName("DEPTNO")->Value;        
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?