.


:




:

































 

 

 

 


ProcedureTablelBeforeOpen(DataSet: TDataSet); private




{ Private declarations } public

{ Public declarations } end;

var

Forml: TForml;

BmpPath: string; // .

// Data .

Implementation

($R *.DFM}

// Imagel
procedure ShowFoto(foto: string);
begin

try

Forml.Imagel.Picture.LoadFromFile(BmpPath+foto);
Forml.Imagel.Visible:=True;
except

OnEFOpenError dobegin

MessageDlg(' '+foto+' .',

mtlnformation, [mbOk], 0);
end;
end;
end;

// (, ,
// )

ProcedureTForm1.TablelAfterScroll(DataSet: TDataSet); begin.

if form1.DBEdit3.Visible then
begin

form1.DBEditS.Visible:= False;
form1.Label4.Visible:=False;
end;
if
Forml.DBEditS.Text <> "

then ShowFoto(Form1.DBEditS.Text)
else form1.Imagel.Visible:=False;
end;

//

ProcedureTForml.DBEdit3KeyPress(Sender: TObject; varKey: Char); begin

if (key = #13) then

if Forml.DBEdit3.Text <>''

then ShowFoto(Forml.DBEdit3.Text) //
else forml,Imagel.Visible:=False;
end;

//

procedure TForml.DBNavigatorlClick(Sender: TObject; Button:
TNavigateBtn);

Begin

CaseButton of nblnsert: begin

Imagel.Visible:=False;//
DBEdit3.Visible:=True; //
Label4.Visible:=True; //
end;
nbEdit: begin //

DBEdit3.Visible:=True; //
Label4.Visible:=True; //
end;

end;

end;

//

procedure TForml.TablelBeforeOpen(DataSet: TDataSet);

Begin

BmpPath:=ExtractFilePath(ParamStr(0))+'data\';
end;

End.

End.

(showFoto) TForm1.Table1AfterScroll, 䳿 AfterScrool Table1. AfterScrool (, , , ) DBNavigator. TForml.Table1AfterScroll (photo) Form1.DBEdit3.Text , , , .

(DBEdits) (Label4) . DBNavigator, 䳿 onclick TForm1.DBNavigatorlciick, DBEdits, ' .

TForm1.DBEdit3KeyPress OnKeyPress DBEdits. Edits (photo) ' <Enter> ( 13), TForm1.DBEdit3KeyPress ShowFoto.

 

 

" ' -" , . . , .

, , "".

"" ( ), , School.db. school : Name ('), Fam (), class (), Adr () N ( ). Name, Fam, class Adr ( ), N , .

BDE Administrator, ( school.db) Database Desktop.

, , Table DataSource, , (.14).

14. Table1 DataSource1

       
   
  Tablel. DatabaseName Tablel. TableName Tablel. Active DataSourcel. Dataset school. db True Tablel  
       

DBGrid, Data Controls (. 13). , , DBGrid .14.

. 13. DBGrid

.14. DBGrid

DBGrid . DBGridl 䳿, . . 17.15 DBGrid.

15. DBGrid

       
   
  Name '  
  DataSource  
  Columns ,  
  Options. dgTitles  
  Options. dgIndicator . ϳ , ,  
  Options. dgColumnResize  
  Options. dgColLines ,  
  Options. dgRowLines ,  
       

, , , ( DataSource), Columns. DataSource , Object Inspector. Columns, Object Inspector . (. 15).

. 15.

, DBGrid , , Add New, ( ), , Object Inspector, (. 17.16). columns DBGrid TCoiumn. . column, DBGrid, 񳺿 .

16. column

       
   
  FieldName ,  
  Width  
  Font ,  
  Color  
  Alignment . (taLeftJustify), (taCenter) (taRight Justify)  
  Title. Caption . '  
  Title.Alignment . (taLeftJustify), (taCenter) (taRight Justify)  
  Title. Color  
  Title. Font  
       

FieldName, ' , , Title.Caption, . . 17 columns DBGridl.

17. DBGridl

         
  FieldName Title. Caption  
  DBGrid1. Columns [0] DBGrid1. Columns [1] Fam Name '  
         
         
  DBGrid1. Columns [2] DBGrid1. Columns [ 3 ] Class Adr ,  
         
             

, DBNavigator, - ( DataSource Table1).

. 17.16.

. 16. DBGrid1

ϳ . , , ' , , , Active - True.

, , Microsoft Excel. , (<Page Up> <Page Down>), , , . <Ins>, , <Del> . , , , , <F2>.

 





:


: 2017-01-28; !; : 298 |


:

:

, , .
==> ...

2071 - | 1713 -


© 2015-2024 lektsii.org - -

: 0.012 .