.


:




:

































 

 

 

 


1. 1.




1. .

2. (- DMod) TQuery, TDataSource.

3. TQuery :

DatabaseName- .

Name AnimalsQuery

SQL select * from Animals

Active-True

( RequestLive -True)

4. TDataSource :

Name-AnimalsSource

DataSet-AnimalsQuery

5. TQuery Fields Editor. Add Field. , .

6. . New Field. New Field Name Mass, Integer Calculated

 

 

7. , AnimalsQuery.

8. OnCalcField:

void __fastcall TDMod::AnimalsQueryCalcField(TDataSet *DataSet)

{

AnimalsQuerymass->AsInteger=

AnimalsQuerySIZE->AsInteger*AnimalsQueryWEIGHT->AsInteger;

}

9. .

10. TPanel, TButton.

11. TDBImage TDBGrid .

 

12. : NAME, SIZE, WEIGHT, MASS. Columns Editor .

13. .

14. TDBImage BMP.( DataSource, DataField)

15. Modify Field. ( Name-ModifyBtn)

void __fastcall TForm1::ModifyBtnClick(TObject *Sender)

{

int i;

AnsiString S;

 

DMod->AnimalsQuery->Edit();

i = DMod->AnimalsQuerySIZE->Value;

S = DMod->AnimalsQueryNAME->Value;

i += 1;

S = "FFF";

DMod->AnimalsQuerySIZE->Value = i;

DMod->AnimalsQueryNAME->Value = S;

 

}

16. Cancel Modify Field :

void __fastcall TForm1::Button2Click(TObject *Sender)

{

Dmod->AnimalsQuery->Cancel();

}

17. . .

 





:


: 2015-10-01; !; : 455 |


:

:

- , .
==> ...

1744 - | 1558 -


© 2015-2024 lektsii.org - -

: 0.02 .