|
IDE에서 DsEdit에 커서를 두고 F1 키를 눌러서 도움말을 불러보니, 다음과 같이 나오네요..
Indicates the current operating mode of a dataset component.
Unit
DB
enum TDataSetState { dsInactive, dsBrowse, dsEdit, dsInsert, dsSetKey, dsCalcFields, dsFilter, dsNewValue, dsOldValue, dsCurValue, dsBlockRead, dsInternalCalc, dsOpening };
Description
TDataSetState represents the values that may be in the State property of a dataset component. TDataSetState indicates the current operating mode of that dataset component. The following table lists all possible values in the TDataSetState type and describes what they indicate in the State property:
Value Meaning
dsInactive Dataset is closed, so its data is unavailable.
dsBrowse Data can be viewed, but not changed. This is the default state of an open dataset.
dsEdit Active record can be modified.
dsInsert The active record is a newly inserted buffer that has not been posted. This record can be modified and then either posted or discarded.
dsSetKey TTable and TClientDataSet only. Record searching is enabled, or a SetRange operation is under way. A restricted set of data can be viewed, and no data can be edited or inserted.
dsCalcFields An OnCalcFields event is in progress. Noncalculated fields cannot be edited, and new records cannot be inserted.
dsFilter An OnFilterRecord event is in progress. A restricted set of data can be viewed. No data can edited or inserted.
dsNewValue Temporary state used internally when a field component뭩 NewValue property is accessed.
dsOldValue Temporary state used internally when a field component뭩 OldValue property is accessed.
dsCurValue Temporary state used internally when a field component뭩 CurValue property is accessed.
dsBlockRead Data-aware controls are not updated and events are not triggered when moving to the next record.
dsInternalCalc Temporary state used internally when values need to be calculated for a field that has a FieldKind of fkInternalCalc.
dsOpening DataSet is in the process of opening but has not finished. This state occurs when the dataset is opened for asynchronous fetching.
즉 DB.hpp 를 인클루드 하시면 될거구요..
Post()는 DB에 있는 데이터를 ClientDataSet으로 불러온뒤에, Edit나 Update가 되었으므로,
ClientDataSet의 변경된 내용을 DB에 적용시키는 함수입니다.
seiyes 님이 쓰신 글 :
: 일단...
: c++ builder에 대한 책을 사려고
: 어제 영풍,교보를 다 가봤지만.....ㅜ.ㅜ
: c++ builder3밖엔 없더군요.....
: 그래서....볼랜드에서 나온 예제를 c++ builder6에서 따라하고 있는 도중에
: 컴파일 오류가 나서 ..질문드립니다..
:
: 첫번째 질문..
: /////////////////////////
:
: if ( ClientDataSet1->State == DsEdit || ClientDataSet1->State == DsUpdate )
: {
: ClientDataSet1->Post());
: }
: ClientDataSet1->ApplyUpdates(-1);
:
: ////////////////////////
:
: 이 코드를 보면 dataSet이 edit되거나 update된 상태를 감지하여
: post()를 하고 최종적으로 DB에 applyUpdate를 하는소스인데요..
:
: ClientDataSet1->State 의 타입은 TDataSetState인데...
: DsEdit 이나 DsUpdate에 어떤 값이 들어가는건가요?
: (Undefined Symbol error가 나는거 봐서는 선언을 해줘야 할꺼 같은데...음...)
: 예제에서는..선언해주는곳도 없고...ㅡ.ㅡ;;
: 선언해준다면 무슨 값이 들어가는지도...궁금합니다..
: 도움말을 봐도 내용이 없네요..ㅜㅜ
: 그리고 Edit, Insert, update, delete에 대한 값이 따로 있는지도 궁금합니다..
:
: 두번재는 post() 메서드의 역할이 궁금합니다....
:
|