. , , ,

,,,

SQL Interbase — ,

SQL Interbase

:

;

;

, SQL-;

.

:

SQL Interbase , ( ) , .

++Builder (!) , -:

, ;

, ;

;

, SQL- , ;

, - SQL- .

:

SQL Interbase :

InterBase Windows ISQL, - "<>:\Program Files\InterBase Corp\ InterBase\ Bin\wisql32.exe", , E:\Program Files\InterBase Corp\ InterBase\ Bin\wisql32.exe";

File | Create Database , (. 1.1), ( );

Metadata | Show , (. 1.2), View Information On: Database. , InterBase Windows ISQL (. 1.3).

File | Commit Work ;

( ++ Builder) Database | Explore Database Explore, Object | New | INTRBASE dbP, Databases , . 1.4; Object | Apply ;

InterBase Windows ISQL File | Run an ISQL Script , (. 1.5), Createdb.sql, ;


1.1 1.2

1.3

1.4

1.5

:

/* 璺 */

CONNECT "e:\Lr2\dbP\dbP.gdb" USER "SYSDBA" PASSWORD "masterkey";

/* PERS */

create table pers(

Num smallint Not Null Primary Key,

Dep char(15),

Fam char(20) Not Null,

Nam char(20) Not Null,

Par char(20) Not Null,

Year_b smallint,

Sex char(1),

Charact blob,

Photo blob

);

/* DEP */

create table dep(

Dep char(15) Not Null Primary Key,

Proisv char(15)

);

/* PERS */

Insert Into PERS(Num, Dep, Fam, Nam, Par, Year_b, Sex)

Values(1, "", "", "", "", 1950, "");

Insert Into PERS(Num, Dep, Fam, Nam, Par, Year_b, Sex)

Values(2, " 1", "", "", "", 1960, "");

Insert Into PERS(Num, Dep, Fam, Nam, Par, Year_b, Sex)

Values(3, " 2", "", "", "", 1955, "");

Insert Into PERS(Num, Dep, Fam, Nam, Par, Year_b, Sex)

Values(4, " 1", "", "", "", 1971, "");

Insert Into PERS(Num, Dep, Fam, Nam, Par, Year_b, Sex)

Values(5, "", "", "", ", 1930, ");

Insert Into PERS(Num, Dep, Fam, Nam, Par, Year_b, Sex)

Values(6, " 2", "", "", "", 1930, "");

Insert Into PERS(Num, Dep, Fam, Nam, Par, Year_b, Sex)

Values(7, " 1", "", "", "", 1937, "");

Insert Into PERS(Num, Dep, Fam, Nam, Par, Year_b, Sex)

Values(8, " 1", "", "", "", 1975, "");

Insert Into PERS(Num, Dep, Fam, Nam, Par, Year_b, Sex)

Values(9, "", "", "", "", 1965, "");

Insert Into PERS(Num, Dep, Fam, Nam, Par, Year_b, Sex)

Values(10, " 2", "", "", "", 1962, "");

Insert Into PERS(Num, Dep, Fam, Nam, Par, Year_b, Sex)

Values(11, " 2", "", "", "", 1975, "");

/* DEP */

Insert Into DEP( Dep,Proisv) Values("", "");

Insert Into DEP( Dep,Proisv) Values(" 1", "");

Insert Into DEP( Dep,Proisv) Values(" 2", "");

Commit;

ϳ , Result.txt. .

(, PERS) Meta-data | Show (. 1.6)

1.6

SHOW TABLE PERS

NUM SMALLINT Not Null

DEP CHAR(15) Nullable

FAM CHAR(20) Not Null

NAM CHAR(20) Not Null

PAR CHAR(20) Not Null

YEAR_B SMALLINT Nullable

SEX CHAR(1) Nullable

CHARACT BLOB segment 80, subtype UNKNOWN Nullable

PHOTO BLOB segment 80, subtype UNKNOWN Nullable

CONSTRAINT INTEG_2:

Primary key (NUM)

(, PERS) Select * from PERS InterBase Windows ISQL, Database Explore (. 1.7):

1.7

PERS, , CreateINDEXESdbP.sql:

/* ' */

CONNECT "e:\Lr3\dbP\dbP.gdb" USER "SYSDBA" PASSWORD "masterkey";

/* */

create index Person On PERS Fam,Nam,Par;

create index DepPerson On PERS Dep,Fam,Nam,Par;

create index Year On PERS Year_b;

PERS, , CreateVIEWSdbP.sql:

/* ' */

CONNECT "e:\Lr3\dbP\dbP.gdb" USER "SYSDBA" PASSWORD "masterkey";

/* PERS */

Create VIEW dep_1 as

select Dep, Num, Fam, Nam, Par, Year_b, Sex from Pers

where Dep = "";

Create VIEW dep_2 as

select Dep, Num, Fam, Nam, Par, Year_b, Sex from Pers

where Dep = " 1";

Create VIEW dep_3 as

select Dep, Num, Fam, Nam, Par, Year_b, Sex from Pers

where Dep = " 2";

++ Builder Database | Explore Database Explore PERSGEN, . 1.8;

1.8

PERSSWITCH PERS, , - CreateTRIGGERdbP.sql:

CONNECT "e:\Lr3\dbP\dbP.gdb" USER "SYSDBA" PASSWORD "masterkey";

/* PERSSWITCH */

SET TERM ^;

CREATE TRIGGER PERSSWITCH FOR PERS

BEFORE INSERT AS

BEGIN

NEW.NUM = GEN_ID(PERSGEN, 1);

END;^

SET TERM ;^

COMMIT;

SQL- (INSERTdbP), (DELETEdbP) (UPDATEdbP) PERS, :

, CreateProcINSERTdbP.sql:

CONNECT "e:\Lr3\dbP\dbP.gdb" USER "SYSDBA" PASSWORD "masterkey";

/* INSERTdbP. , */

SET TERM ^;

CREATE PROCEDURE INSERTdbP

(

pDEP CHAR(15),

pFAM CHAR(20),

pNAM CHAR(20),

pPAR CHAR(20),

pYEAR_B INTEGER,

pSEX CHAR(1)

)

AS

BEGIN

Insert into PERS (DEP, FAM, NAM, PAR, YEAR_B, SEX)

VALUES (:pDEP, :pFAM, :pNAM, :pPAR, :pYEAR_B, :pSEX);

END;^

SET TERM ;^

COMMIT;

, CreateProcDELETEdbP.sql:

CONNECT "e:\Lr3\dbP\dbP.gdb" USER "SYSDBA" PASSWORD "masterkey";

/* DELETEdbP */

SET TERM ^;

CREATE PROCEDURE DELETEdbP

(

pNUM INTEGER

)

AS

BEGIN

DELETE FROM PERS WHERE NUM = :pNUM;

END;^

SET TERM ;^

COMMIT;

, CreateProcUPDATEdbP.sql:

CONNECT "e:\Lr3\dbP\dbP.gdb" USER "SYSDBA" PASSWORD "masterkey";

/* UPDATEdbP.

, 0, */

SET TERM ^;

CREATE PROCEDURE UPDATEdbP

(

pDEP CHAR(15),

pFAM CHAR(20),

pNAM CHAR(20),

pPAR CHAR(20),

pYEAR_B INTEGER,

pSEX CHAR(1)

)

RETURNS

(number integer)

AS

BEGIN

number = 0;

Select NUM From PERS

Where (FAM = :pFAM) and (NAM = :pNAM) and (PAR = :pPAR)

Into number;

if (number > 0) then

Update PERS Set DEP = :pDEP, YEAR_B = :pYEAR_B, SEX = :pSEX

Where (FAM = :pFAM) and (NAM = :pNAM) and (PAR = :pPAR);

END;^

SET TERM ;^

COMMIT;

, . 1.10.

1.10

:

(. 1.11).

1.11

main_Form . 1.12 . 1.13.

1.12

1.13

main_Form:

object main_Form: Tmain_Form

Left = 147

Top = 103

Width = 709

Height = 460

Caption = ' 2'

Color = clBtnFace

Font.Charset = DEFAULT_CHARSET

Font.Color = clWindowText

Font.Height = -11

Font.Name = 'System'

Font.Style = [fsBold]

OldCreateOrder = True

Position = poScreenCenter

OnCreate = FormCreate

PixelsPerInch = 96

TextHeight = 16

object PageControl: TPageControl

Left = 421

Top = 0

Width = 280

Height = 428

ActivePage = find_TabSheet

Align = alClient

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

MultiLine = True

ParentFont = False

TabOrder = 0

OnChange = PageControlChange

object find_TabSheet: TTabSheet

Caption = '³'

object select_GroupBox: TGroupBox

Left = 1

Top = 5

Width = 268

Height = 212

Caption = '³ ...'

TabOrder = 7

end

object sex_RadioGroup: TRadioGroup

Left = 8

Top = 120

Width = 257

Height = 53

Caption = ' '

Columns = 2

ItemIndex = 0

Items.Strings = (

''

'')

TabOrder = 0

OnClick = minage_CSpinEditChange

end

object speedfind_GroupBox: TGroupBox

Left = 0

Top = 224

Width = 257

Height = 169

Caption = ' '

TabOrder = 5

object Image1: TImage

Left = 8

Top = 16

Width = 105

Height = 145

Picture.Data = { }

Stretch = True

end

object speedfind_Label: TLabel

Left = 154

Top = 42

Width = 56

Height = 16

Caption = ''

end

object speedfind_Image: TImage

Left = 32

Top = 48

Width = 57

Height = 73

Picture.Data = { }

Stretch = True

end

end

object age_GroupBox: TGroupBox

Left = 8

Top = 32

Width = 257

Height = 81

Caption = ' '

Enabled = False

TabOrder = 4

object minage_Label: TLabel

Left = 65

Top = 15

Width = 28

Height = 16

Caption = ' ...'

end

object maxage_Label: TLabel

Left = 192

Top = 15

Width = 25

Height = 16

Caption = ' ...'

end

object minage_Image: TImage

Left = 8

Top = 24

Width = 41

Height = 49

Picture.Data = { }

Stretch = True

Transparent = True

end

object maxage_Image: TImage

Left = 136

Top = 24

Width = 41

Height = 49

Picture.Data = { }

Stretch = True

Transparent = True

end

end

object speedfind_Edit: TEdit

Left = 120

Top = 296

Width = 129

Height = 22

Hint = ' '

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

ParentShowHint = False

ShowHint = True

TabOrder = 1

OnChange = speedfind_EditChange

end

object minage_CSpinEdit: TCSpinEdit

Left = 62

Top = 66

Width = 65

Height = 26

TabStop = True

MaxValue = 80

MinValue = 16

ParentColor = False

TabOrder = 2

Value = 16

OnChange = minage_CSpinEditChange

end

object maxage_CSpinEdit: TCSpinEdit

Left = 190

Top = 66

Width = 65

Height = 26

TabStop = True

MaxValue = 80

MinValue = 16

ParentColor = False

TabOrder = 3

Value = 30

OnChange = minage_CSpinEditChange

end

object select_BitBtn: TBitBtn

Left = 8

Top = 184

Width = 257

Height = 25

Cursor = crHandPoint

Caption = ' '

TabOrder = 6

OnClick = select_BitBtnClick

Kind = bkOK

end

end

object TabEdit: TTabSheet

Caption = ''

Font.Charset = RUSSIAN_CHARSET

Font.Color = clBlack

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

object ch_GroupBox: TGroupBox

Left = 2

Top = 5

Width = 269

Height = 388

Caption = ' '

TabOrder = 9

object chdp_Label: TLabel

Left = 12

Top = 38

Width = 50

Height = 16

Caption = '³'

FocusControl = chdp_ComboBox

end

object chname_Label: TLabel

Left = 12

Top = 138

Width = 25

Height = 16

Caption = ''#39''

FocusControl = chname_Edit

end

object chgrand_Label: TLabel

Left = 12

Top = 188

Width = 73

Height = 16

Caption = ' '

FocusControl = chgrand_Edit

end

object chyear_Label: TLabel

Left = 12

Top = 232

Width = 95

Height = 16

Caption = 'г '

end

object chfam_Label: TLabel

Left = 12

Top = 87

Width = 56

Height = 16

Caption = ''

FocusControl = chfam_Edit

end

object oper_Bevel: TBevel

Left = 18

Top = 282

Width = 251

Height = 96

end

object oper_Shape: TShape

Left = 19

Top = 283

Width = 248

Height = 94

Brush.Color = clBlack

end

object Animate1: TAnimate

Left = 24

Top = 291

Width = 60

Height = 80

Active = True

FileName = 'Frage.avi'

StopFrame = 31

Transparent = False

end

end

object sex2_RadioGroup: TRadioGroup

Left = 185

Top = 218

Width = 77

Height = 41

Caption = ''

Columns = 2

ItemIndex = 0

Items.Strings = (

''

'')

TabOrder = 4

end

object chdp_ComboBox: TComboBox

Left = 101

Top = 40

Width = 162

Height = 22

Style = csDropDownList

Font.Charset = RUSSIAN_CHARSET

Font.Color = clBlack

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ItemHeight = 0

ParentFont = False

TabOrder = 0

end

object chfam_Edit: TEdit

Left = 101

Top = 90

Width = 162

Height = 22

Font.Charset = RUSSIAN_CHARSET

Font.Color = clBlack

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

TabOrder = 1

Text = 'chfam_Edit'

end

object chname_Edit: TEdit

Left = 101

Top = 140

Width = 162

Height = 22

Font.Charset = RUSSIAN_CHARSET

Font.Color = clBlack

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

TabOrder = 2

Text = 'chname_Edit'

end

object chgrand_Edit: TEdit

Left = 101

Top = 190

Width = 162

Height = 22

Font.Charset = RUSSIAN_CHARSET

Font.Color = clBlack

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

TabOrder = 3

Text = 'chgrand_Edit'

end

object chadd_Button: TButton

Left = 88

Top = 294

Width = 169

Height = 25

Hint = ' '

Caption = '&'

ParentShowHint = False

ShowHint = True

TabOrder = 5

OnClick = chadd_ButtonClick

end

object chdelete_Button: TButton

Left = 88

Top = 322

Width = 169

Height = 25

Hint = ' '

Caption = '&'

ParentShowHint = False

ShowHint = True

TabOrder = 6

OnClick = chdelete_ButtonClick

end

object chpost_Button: TButton

Left = 88

Top = 351

Width = 169

Height = 25

Hint = ' '

Caption = '&'

ParentShowHint = False

ShowHint = True

TabOrder = 7

OnClick = chpost_ButtonClick

end

object chyear_CSpinEdit: TCSpinEdit

Left = 119

Top = 233

Width = 50

Height = 23

TabStop = True

Font.Charset = RUSSIAN_CHARSET

Font.Color = clBlack

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

MaxValue = 2000

MinValue = 1900

ParentColor = False

ParentFont = False

TabOrder = 8

Value = 1950

end

end

end

object left_Panel: TPanel

Left = 0

Top = 0

Width = 421

Height = 428

Align = alLeft

BevelInner = bvLowered

Caption = 'left_Panel'

TabOrder = 1

object find_TPanel: TPanel

Left = 6

Top = 5

Width = 406

Height = 420

Caption = 'find_TPanel'

TabOrder = 1

object find_Label: TLabel

Left = 110

Top = 20

Width = 265

Height = 24

Alignment = taCenter

Caption = ' ϲʲ'

Font.Charset = RUSSIAN_CHARSET

Font.Color = clRed

Font.Height = -21

Font.Name = 'Arial Cyr'

Font.Style = [fsBold, fsItalic]

ParentFont = False

end

object dp_GroupBox: TGroupBox

Left = 8

Top = 56

Width = 393

Height = 57

Caption = ' ³ '

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

TabOrder = 0

object dp_ComboBox: TComboBox

Left = 8

Top = 24

Width = 177

Height = 24

ItemHeight = 16

Items.Strings = (

'')

TabOrder = 0

OnChange = dp_ComboBoxChange

end

end

object dp2_GroupBox: TGroupBox

Left = 200

Top = 66

Width = 193

Height = 41

Caption = ' '

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsItalic]

ParentFont = False

TabOrder = 1

object dp2_DBEdit: TDBEdit

Left = 5

Top = 15

Width = 182

Height = 23

Color = clSilver

DataField = 'PROISV'

DataSource = dp_DataSource

Enabled = False

TabOrder = 0

end

end

object pr_GroupBox: TGroupBox

Left = 8

Top = 115

Width = 393

Height = 226

Caption = ' '

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

TabOrder = 2

object Bevel1: TBevel

Left = 10

Top = 197

Width = 41

Height = 24

end

object pr_Label: TLabel

Left = 16

Top = 201

Width = 29

Height = 16

Alignment = taCenter

AutoSize = False

end

end

object find_Animate: TAnimate

Left = 32

Top = 8

Width = 48

Height = 45

Active = True

CommonAVI = aviFindComputer

StopFrame = 8

end

object GroupBox1: TGroupBox

Left = 8

Top = 340

Width = 393

Height = 77

Caption = ' SQL'

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

TabOrder = 4

object sql_Label: TLabel

Left = 11

Top = 16

Width = 372

Height = 57

AutoSize = False

Color = clBtnFace

Font.Charset = RUSSIAN_CHARSET

Font.Color = clRed

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentColor = False

ParentFont = False

WordWrap = True

end

end

end

object pr_DBGrid: TDBGrid

Left = 22

Top = 144

Width = 379

Height = 169

DataSource = pr_DataSource

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsItalic]

Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit]

ParentFont = False

TabOrder = 0

TitleFont.Charset = RUSSIAN_CHARSET

TitleFont.Color = clWindowText

TitleFont.Height = -11

TitleFont.Name = 'Times New Roman'

TitleFont.Style = [fsItalic]

OnCellClick = pr_DBGridCellClick

Columns = <

item

Expanded = False

FieldName = 'FAM'

Title.Caption = ''

Width = 59

Visible = True

end

item

Expanded = False

FieldName = 'NAM'

Title.Caption = ''#39''

Width = 57

Visible = True

end

item

Expanded = False

FieldName = 'PAR'

Title.Caption = ' '

Width = 67

Visible = True

end

item

Alignment = taCenter

Expanded = False

FieldName = 'YEAR_B'

Title.Caption = ' '

Width = 85

Visible = True

end

item

Alignment = taCenter

Expanded = False

FieldName = 'SEX'

Title.Caption = ''

Visible = True

end

item

Expanded = False

FieldName = 'AGE'

Title.Caption = ''

Width = 38

Visible = True

end

item

Expanded = False

FieldName = 'CHARACT'

Title.Caption = ''

Visible = True

end

item

Expanded = False

FieldName = 'PHOTO'

Title.Caption = ''

Visible = True

end>

end

object pr_Button: TButton

Left = 326

Top = 319

Width = 75

Height = 20

Hint = ', '

Caption = '& ...'

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

ParentShowHint = False

ShowHint = True

TabOrder = 2

OnClick = pr_ButtonClick

end

object pr_DBNavigator: TDBNavigator

Left = 73

Top = 319

Width = 244

Height = 20

DataSource = pr_DataSource

VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast]

TabOrder = 3

end

end

object dp_DataSource: TDataSource

DataSet = dp_Query

Left = 140

Top = 55

end

object pr_DataSource: TDataSource

DataSet = pr_Query

Left = 298

Top = 268

end

object dp_Query: TQuery

DatabaseName = 'dbP'

RequestLive = True

SQL.Strings = (

'Select * from Dep where DEP = :PDEP')

Left = 169

Top = 55

ParamData = <

item

DataType = ftString

Name = 'PDEP'

ParamType = ptUnknown

end>

object dp_QueryDEP: TStringField

FieldName = 'DEP'

Origin = 'DEP.DEP'

Size = 15

end

object dp_QueryPROISV: TStringField

FieldName = 'PROISV'

Origin = 'DEP.PROISV'

Size = 15

end

end

object update_Query: TQuery

DatabaseName = 'dbP'

DataSource = pr_DataSource

RequestLive = True

Left = 356

Top = 268

end

object pr_Query: TQuery

BeforePost = pr_QueryBeforePost

AfterScroll = pr_QueryAfterScroll

OnCalcFields = pr_QueryCalcFields

DatabaseName = 'dbP'

RequestLive = True

SQL.Strings = (

'Select * from Pers where DEP = :DEP order by FAM,NAM,PAR')

Left = 327

Top = 268

ParamData = <

item

DataType = ftString

Name = 'DEP'

ParamType = ptUnknown

end>

object pr_QueryNUM: TSmallintField

FieldName = 'NUM'

Origin = 'PERS.NUM'

end

object pr_QueryDEP: TStringField

FieldName = 'DEP'

Origin = 'PERS.DEP'

Size = 15

end

object pr_QueryFAM: TStringField

FieldName = 'FAM'

Origin = 'PERS.FAM'

end

object pr_QueryNAM: TStringField

FieldName = 'NAM'

Origin = 'PERS.NAM'

end

object pr_QueryPAR: TStringField

FieldName = 'PAR'

Origin = 'PERS.PAR'

end

object pr_QueryYEAR_B: TSmallintField

FieldName = 'YEAR_B'

Origin = 'PERS.YEAR_B'

end

object pr_QuerySEX: TStringField

FieldName = 'SEX'

Origin = 'PERS.SEX'

Size = 1

end

object pr_QueryCHARACT: TBlobField

FieldName = 'CHARACT'

Origin = 'PERS.CHARACT'

BlobType = ftMemo

Size = 1

end

object pr_QueryPHOTO: TBlobField

FieldName = 'PHOTO'

Origin = 'PERS.PHOTO'

BlobType = ftGraphic

Size = 1

end

object pr_QueryAGE: TSmallintField

Alignment = taCenter

DisplayLabel = ''

DisplayWidth = 7

FieldKind = fkCalculated

FieldName = 'AGE'

Calculated = True

end

end

end

ϳ character_Form . 1.14.

1.14

:

object character_Form: Tcharacter_Form

Left = 237

Top = 95

Width = 318

Height = 226

Caption = ''

Color = clBtnFace

Font.Charset = DEFAULT_CHARSET

Font.Color = clWindowText

Font.Height = -11

Font.Name = 'MS Sans Serif'

Font.Style = []

FormStyle = fsStayOnTop

OldCreateOrder = True

Position = poDefaultPosOnly

PixelsPerInch = 96

TextHeight = 13

object character_DBMemo: TDBMemo

Left = 0

Top = 0

Width = 195

Height = 194

Align = alClient

Alignment = taCenter

DataField = 'Charact'

DataSource = main_Form.pr_DataSource

ScrollBars = ssVertical

TabOrder = 0

end

object PPhoto: TPanel

Left = 195

Top = 0

Width = 115

Height = 194

Align = alRight

Caption = 'PPhoto'

TabOrder = 1

object photo_DBImage: TDBImage

Left = 5

Top = 42

Width = 105

Height = 105

DataField = 'Photo'

DataSource = main_Form.pr_DataSource

TabOrder = 0

end

end

end

:

Udb.h

#ifndef UdbH

#define UdbH

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include <ComCtrls.hpp>

#include <DBCtrls.hpp>

#include <DBGrids.hpp>

#include <ExtCtrls.hpp>

#include <Grids.hpp>

#include <Mask.hpp>

#include <Db.hpp>

#include <DBTables.hpp>

#include "cspin.h"

#include "CSPIN.h"

#include <jpeg.hpp>

#include <Buttons.hpp>

#include <Graphics.hpp>

class Tmain_Form : public TForm

{

__published: // IDE-managed Components

TPageControl *PageControl;

TTabSheet *find_TabSheet;

TRadioGroup *sex_RadioGroup;

TEdit *speedfind_Edit;

TDataSource *dp_DataSource;

TDataSource *pr_DataSource;

TTabSheet *TabEdit;

TComboBox *chdp_ComboBox;

TEdit *chfam_Edit;

TEdit *chname_Edit;

TEdit *chgrand_Edit;

TRadioGroup *sex2_RadioGroup;

TButton *chadd_Button;

TButton *chdelete_Button;

TButton *chpost_Button;

TCSpinEdit *chyear_CSpinEdit;

TCSpinEdit *minage_CSpinEdit;

TCSpinEdit *maxage_CSpinEdit;

TPanel *left_Panel;

TPanel *find_TPanel;

TLabel *find_Label;

TGroupBox *dp_GroupBox;

TGroupBox *dp2_GroupBox;

TGroupBox *pr_GroupBox;

TDBGrid *pr_DBGrid;

TButton *pr_Button;

TDBNavigator *pr_DBNavigator;

TGroupBox *ch_GroupBox;

TLabel *chdp_Label;

TLabel *chname_Label;

TLabel *chgrand_Label;

TLabel *chyear_Label;

TLabel *chfam_Label;

TGroupBox *age_GroupBox;

TLabel *minage_Label;

TLabel *maxage_Label;

TGroupBox *speedfind_GroupBox;

TLabel *speedfind_Label;

TImage *speedfind_Image;

TImage *minage_Image;

TImage *maxage_Image;

TAnimate *find_Animate;

TBitBtn *select_BitBtn;

TGroupBox *select_GroupBox;

TQuery *dp_Query;

TQuery *update_Query;

TQuery *pr_Query;

TComboBox *dp_ComboBox;

TDBEdit *dp2_DBEdit;

TStringField *dp_QueryDEP;

TStringField *dp_QueryPROISV;

TSmallintField *pr_QueryNUM;

TStringField *pr_QueryDEP;

TStringField *pr_QueryFAM;

TStringField *pr_QueryNAM;

TStringField *pr_QueryPAR;

TSmallintField *pr_QueryYEAR_B;

TStringField *pr_QuerySEX;

TBlobField *pr_QueryCHARACT;

TBlobField *pr_QueryPHOTO;

TSmallintField *pr_QueryAGE;

TLabel *pr_Label;

TBevel *Bevel1;

TGroupBox *GroupBox1;

TLabel *sql_Label;

TAnimate *Animate1;

TBevel *oper_Bevel;

TShape *oper_Shape;

TImage *Image1;

void __fastcall FormCreate(TObject *Sender);

void __fastcall dp_ComboBoxChange(TObject *Sender);

void __fastcall pr_ButtonClick(TObject *Sender);

void __fastcall speedfind_EditChange(TObject *Sender);

void __fastcall pr_QueryCalcFields(TDataSet *DataSet);

void __fastcall pr_QueryAfterScroll(TDataSet *DataSet);

void __fastcall pr_QueryBeforePost(TDataSet *DataSet);

void __fastcall chadd_ButtonClick(TObject *Sender);

void __fastcall chdelete_ButtonClick(TObject *Sender);

void __fastcall chpost_ButtonClick(TObject *Sender);

void __fastcall PageControlChange(TObject *Sender);

void __fastcall minage_CSpinEditChange(TObject *Sender);

void __fastcall select_BitBtnClick(TObject *Sender);

void __fastcall pr_DBGridCellClick(TColumn *Column);

private: // User declarations

public: // User declarations

__fastcall Tmain_Form(TComponent* Owner);

unsigned short Year;

unsigned short Month;

unsigned short Day;

bool CanPost;

int AllPers, CurrentPers;

AnsiString sql_Operator;

void __fastcall Delay(unsigned long int mSeconds);

};

extern PACKAGE Tmain_Form *main_Form;

#endif

Udb.cpp

#include <vcl.h>

#pragma hdrstop

#include "Udb.h"

#include "Udba.h"

#pragma package(smart_init)

#pragma link "cspin"

#pragma link "CSPIN"

#pragma resource "*.dfm"

Tmain_Form *main_Form;

__fastcall Tmain_Form::Tmain_Form(TComponent* Owner)

: TForm(Owner)

{}

void __fastcall Tmain_Form::FormCreate(TObject *Sender)

{

CanPost = false;

Date().DecodeDate(&Year,&Month,&Day);

// PERS

pr_Query->SQL->Clear();

sql_Operator = "Select * from PERS order by NUM";

sql_Label->Caption = sql_Operator;

pr_Query->SQL->Add(sql_Operator);

pr_Query->Open();

pr_Query->First();

AllPers = 0;

while (!pr_Query->Eof) {

++AllPers;

pr_Query->Next();

}

pr_Query->First();

dp_Query->SQL->Clear();

sql_Operator = "Select * from DEP";

sql_Label->Caption = sql_Operator;

dp_Query->SQL->Add(sql_Operator);

dp_Query->Open();

dp_Query->First();

// ComboBox dp_ComboBox chdp_ComboBox

dp_ComboBox->Clear();

chdp_ComboBox->Clear();

while (!dp_Query->Eof) {

dp_ComboBox->Items->Add(dp_QueryDEP->AsString);

chdp_ComboBox->Items->Add(dp_QueryDEP->AsString);

dp_Query->Next();

}

dp_ComboBox->Items->Add(" ");

dp_ComboBox->ItemIndex = dp_ComboBox->Items->Count - 1;

dp_ComboBoxChange(Sender);

chdp_ComboBox->ItemIndex = dp_ComboBox->ItemIndex;

PageControl->ActivePage = find_TabSheet;

}

void __fastcall Tmain_Form::dp_ComboBoxChange(TObject *Sender)

{

dp_Query->Close();

dp_Query->SQL->Clear();

sql_Operator = "Select * from DEP where DEP=:PDEP";

sql_Label->Caption = sql_Operator;

Delay(5000);

dp_Query->SQL->Add(sql_Operator);

dp_Query->Params->Items[0]->AsString = dp_ComboBox->Text;

dp_Query->Open();

dp_Query->First();

pr_Query->Close();

pr_Query->SQL->Clear();

if (dp_ComboBox->ItemIndex == dp_ComboBox->Items->Count - 1) {

sql_Operator = "Select * from PERS order by NUM";

sql_Label->Caption = sql_Operator;

Delay(5000);

pr_Query->SQL->Add(sql_Operator);

} else {

sql_Operator = "Select * from PERS where DEP = :DEP order by NUM";

sql_Label->Caption = sql_Operator;

Delay(5000);

pr_Query->SQL->Add(sql_Operator);

pr_Query->Params->Items[0]->AsString = dp_ComboBox->Text;

}

pr_Query->ExecSQL();

pr_Query->Open();

pr_Query->First();

}

void __fastcall Tmain_Form::pr_ButtonClick(TObject *Sender)

{

if (!character_Form->Visible) character_Form->Show();

}

void __fastcall Tmain_Form::speedfind_EditChange(TObject *Sender)

{

TLocateOptions SearchOptions;

pr_Query->Locate("FAM", speedfind_Edit->Text,

SearchOptions << loPartialKey << loCaseInsensitive);

}

void __fastcall Tmain_Form::pr_QueryCalcFields(TDataSet *DataSet)

{

pr_QueryAGE->Value = Year - pr_QueryYEAR_B->Value;

}

void __fastcall Tmain_Form::pr_QueryAfterScroll(TDataSet *DataSet)

{

//

CurrentPers = pr_QueryNUM->AsInteger;

pr_Label->Caption = IntToStr(CurrentPers);

if (PageControl->ActivePage == TabEdit) {

//

chdp_ComboBox -> ItemIndex =

chdp_ComboBox->Items->IndexOf(pr_QueryDEP->AsString);

chfam_Edit->Text = pr_QueryFAM->AsString;

chname_Edit->Text = pr_QueryNAM->AsString;

chgrand_Edit->Text = pr_QueryPAR->AsString;

chyear_CSpinEdit->Value = pr_QueryYEAR_B->AsInteger;

if (pr_QuerySEX->AsString == "") sex2_RadioGroup->ItemIndex = 0;

else sex2_RadioGroup->ItemIndex = 1;

}

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::pr_QueryBeforePost(TDataSet *DataSet)

{

if (!CanPost) {

DataSet->Cancel();

Abort;

}

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::chadd_ButtonClick(TObject *Sender)

{ // PERS

AnsiString NewSex; //

if (sex2_RadioGroup->ItemIndex == 0) NewSex = "";

else NewSex = "";

update_Query->Close();

update_Query->SQL->Clear();

sql_Operator = "Insert into PERS (DEP,FAM,NAM,PAR,YEAR_B,SEX,NUM) values ('"

+ chdp_ComboBox->Text + "','"

+ chfam_Edit->Text + "','"

+ chname_Edit->Text + "','"

+ chgrand_Edit->Text + "','"

+ IntToStr((int)chyear_CSpinEdit->Value) + "','"

+ NewSex + "','"

+ IntToStr(++AllPers) + "')"; // PERS

sql_Label->Caption = sql_Operator;

Delay(5000);

update_Query->SQL->Add(sql_Operator);

update_Query->ExecSQL(); //

pr_Query->Close(); // PERS

pr_Query->Open();

PageControlChange(Sender);

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::chdelete_ButtonClick(TObject *Sender)

{ // PERS

if (Application->MessageBox(" ?",

"ϳ ",

MB_YESNO + MB_ICONEXCLAMATION) == IDYES)

update_Query->Close();

update_Query->SQL->Clear();

sql_Operator = "Delete from PERS where NUM = " + IntToStr(CurrentPers);

sql_Label->Caption = sql_Operator;

Delay(5000);

update_Query->SQL->Add(sql_Operator);

update_Query->ExecSQL(); //

pr_Query->Close(); // PERS

pr_Query->Open();

--AllPers; // PERS

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::chpost_ButtonClick(TObject *Sender)

{

AnsiString s, sSQL;

const AnsiString s1 = ",";

s = "";

sSQL = "Update PERS set ";

if (pr_QueryDEP->AsString != chdp_ComboBox->Text) {

s = "";

sSQL += "DEP='" + chdp_ComboBox->Text + "'";

}

if (pr_QueryCHARACT->AsString != chfam_Edit->Text) {

if (s != "") { s += s1; sSQL += s1; }

s += " ";

sSQL += "FAM='" + chfam_Edit->Text + "'";

}

if (pr_QueryCHARACT->AsString != chname_Edit->Text) {

if (s != "") { s += s1; sSQL += s1; }

s += " '";

sSQL += "NAM='" + chname_Edit->Text+"'";

}

if (pr_QueryCHARACT->AsString != chgrand_Edit->Text) {

if (s != "") { s += s1; sSQL += s1; }

s += " ";

sSQL += "PAR='" + chgrand_Edit->Text + "'";

}

if (pr_QueryYEAR_B->AsInteger != chyear_CSpinEdit->Value) {

if (s != "") { s += s1; sSQL += s1; }

s += " ";

sSQL += "YEAR_B='" + IntToStr((int)(chyear_CSpinEdit->Value));

}

if (pr_QuerySEX->AsBoolean != (sex2_RadioGroup->ItemIndex == 0)) {

if (s != "") { s += s1; sSQL += s1; }

s += " ";

sSQL += "SEX='";

if(sex2_RadioGroup->ItemIndex == 0) sSQL += "'";

else sSQL += "'";

}

if (s != "")

if (Application->MessageBox(

("ij " + s + "?").c_str(),

"ϳ ",

MB_YESNO + MB_ICONQUESTION) == IDYES)

{ update_Query->Close();

update_Query->SQL->Clear();

sql_Operator = sSQL + " where NUM=" + IntToStr(pr_QueryNUM->AsInteger);

sql_Label->Caption = sql_Operator;

Delay(5000);

update_Query->SQL->Add(sql_Operator);

update_Query->ExecSQL();

pr_Query->Close();

pr_Query->Open();

CanPost = false;

};

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::PageControlChange(TObject *Sender)

{

character_Form->character_DBMemo->ReadOnly =

!(PageControl->ActivePage == TabEdit);

if (PageControl->ActivePage == TabEdit) pr_QueryAfterScroll(pr_Query);

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::minage_CSpinEditChange(TObject *Sender)

{

AnsiString s =

"(YEAR_B<=" + IntToStr(int(Year - minage_CSpinEdit->Value)) +

")and(YEAR_B>=" + IntToStr(int(Year - maxage_CSpinEdit->Value)) +

")and(SEX=";

if (!sex_RadioGroup->ItemIndex) s += "'')";

else s += "'')";

//

select_BitBtn->Kind = bkCancel;

select_BitBtn->Caption = "³ ";

pr_Query->Filter = s;

pr_Query->Filtered = true;

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::select_BitBtnClick(TObject *Sender)

{

if (pr_Query->Filtered) { //

pr_Query->Filtered = false;

select_BitBtn->Kind = bkYes;

select_BitBtn->Caption = " ";

} else { //

select_BitBtn->Kind = bkCancel;

select_BitBtn->Caption = "³ ";

minage_CSpinEditChange(Sender);

}

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::pr_DBGridCellClick(TColumn *Column)

{

if (PageControl->ActivePage == TabEdit) {

chdp_ComboBox -> ItemIndex =

chdp_ComboBox->Items->IndexOf(pr_QueryDEP->AsString);

chfam_Edit->Text = pr_QueryFAM->AsString;

chname_Edit->Text = pr_QueryNAM->AsString;

chgrand_Edit->Text = pr_QueryPAR->AsString;

chyear_CSpinEdit->Value = pr_QueryYEAR_B->AsInteger;

if (pr_QuerySEX->AsString == "") sex2_RadioGroup->ItemIndex = 0;

else sex2_RadioGroup->ItemIndex = 1;

}

//

CurrentPers = pr_QueryNUM->AsInteger;

pr_Label->Caption = IntToStr(CurrentPers);

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::Delay(unsigned long int mSeconds)

{ //

unsigned long int FirstTick;

FirstTick = GetTickCount();

do

Application->ProcessMessages();

while (GetTickCount() - FirstTick <= mSeconds);

}

Udba.h

//---------------------------------------------------------------------------

#ifndef UdbaH

#define UdbaH

//---------------------------------------------------------------------------

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include <DBCtrls.hpp>

#include <ExtCtrls.hpp>

//---------------------------------------------------------------------------

class Tcharacter_Form : public TForm

{

__published: // IDE-managed Components

TDBMemo *character_DBMemo;

TPanel *PPhoto;

TDBImage *photo_DBImage;

private: // User declarations

public: // User declarations

__fastcall Tcharacter_Form(TComponent* Owner);

};

//---------------------------------------------------------------------------

extern PACKAGE Tcharacter_Form *character_Form;

//---------------------------------------------------------------------------

#endif

Udba.cpp

//---------------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

#include "Udba.h"

#include "Udb.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

Tcharacter_Form *character_Form;

//---------------------------------------------------------------------------

__fastcall Tcharacter_Form::Tcharacter_Form(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------

- IBServer.EXE, "E:\Program Files\InterBase Corp\InterBase\Bin\" Interbase. ϳ - (.. 1.15) , Password: masterkey..

1.15

. 1.16 - 1.18.

1.16

1.17

1.18

: (. 1.19).

1.19

main_Form . 1.20.

1.20

main_Form:

object main_Form: Tmain_Form

Left = 63

Top = 22

Width = 709

Height = 461

Caption = ' 3'

Color = clBtnFace

Font.Charset = DEFAULT_CHARSET

Font.Color = clWindowText

Font.Height = -11

Font.Name = 'System'

Font.Style = [fsBold]

OldCreateOrder = True

Position = poScreenCenter

OnCreate = FormCreate

PixelsPerInch = 96

TextHeight = 16

object PageControl: TPageControl

Left = 421

Top = 0

Width = 280

Height = 429

ActivePage = find_TabSheet

Align = alClient

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

MultiLine = True

ParentFont = False

TabOrder = 0

OnChange = PageControlChange

object find_TabSheet: TTabSheet

Caption = '³'

object select_GroupBox: TGroupBox

Left = 1

Top = 5

Width = 268

Height = 212

Caption = '³ ...'

TabOrder = 7

end

object sex_RadioGroup: TRadioGroup

Left = 8

Top = 120

Width = 257

Height = 53

Caption = ' '

Columns = 2

ItemIndex = 0

Items.Strings = (

''

'')

TabOrder = 0

OnClick = minage_CSpinEditChange

end

object speedfind_GroupBox: TGroupBox

Left = 0

Top = 224

Width = 257

Height = 169

Caption = ' '

TabOrder = 5

object Image1: TImage

Left = 8

Top = 16

Width = 105

Height = 145

Picture.Data = {}

Stretch = True

end

object speedfind_Label: TLabel

Left = 154

Top = 50

Width = 56

Height = 16

Caption = ''

end

object speedfind_Image: TImage

Left = 32

Top = 48

Width = 57

Height = 73

Picture.Data = {}

Stretch = True

end

end

object age_GroupBox: TGroupBox

Left = 8

Top = 32

Width = 257

Height = 81

Caption = ' '

Enabled = False

TabOrder = 4

object minage_Label: TLabel

Left = 65

Top = 15

Width = 28

Height = 16

Caption = ' ...'

end

object maxage_Label: TLabel

Left = 192

Top = 15

Width = 25

Height = 16

Caption = ' ...'

end

object minage_Image: TImage

Left = 8

Top = 24

Width = 41

Height = 49

Picture.Data = {}

Stretch = True

Transparent = True

end

object maxage_Image: TImage

Left = 136

Top = 24

Width = 41

Height = 49

Picture.Data = {}

Stretch = True

Transparent = True

end

end

object speedfind_Edit: TEdit

Left = 120

Top = 310

Width = 129

Height = 22

Hint = ' '

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

ParentShowHint = False

ShowHint = True

TabOrder = 1

OnChange = speedfind_EditChange

end

object minage_CSpinEdit: TCSpinEdit

Left = 62

Top = 66

Width = 65

Height = 26

TabStop = True

MaxValue = 80

MinValue = 16

ParentColor = False

TabOrder = 2

Value = 16

OnChange = minage_CSpinEditChange

end

object maxage_CSpinEdit: TCSpinEdit

Left = 190

Top = 66

Width = 65

Height = 26

TabStop = True

MaxValue = 80

MinValue = 16

ParentColor = False

TabOrder = 3

Value = 30

OnChange = minage_CSpinEditChange

end

object select_BitBtn: TBitBtn

Left = 8

Top = 184

Width = 257

Height = 25

Cursor = crHandPoint

Caption = ' '

TabOrder = 6

OnClick = select_BitBtnClick

Kind = bkOK

end

end

object TabEdit: TTabSheet

Caption = ''

Font.Charset = RUSSIAN_CHARSET

Font.Color = clBlack

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

object ch_GroupBox: TGroupBox

Left = 2

Top = 5

Width = 269

Height = 388

Caption = ' '

TabOrder = 9

object chdp_Label: TLabel

Left = 12

Top = 38

Width = 50

Height = 16

Caption = '³'

FocusControl = chdp_ComboBox

end

object chname_Label: TLabel

Left = 12

Top = 138

Width = 25

Height = 16

Caption = ''#39''

FocusControl = chname_Edit

end

object chgrand_Label: TLabel

Left = 12

Top = 188

Width = 73

Height = 16

Caption = ' '

FocusControl = chgrand_Edit

end

object chyear_Label: TLabel

Left = 12

Top = 232

Width = 95

Height = 16

Caption = 'г '

end

object chfam_Label: TLabel

Left = 12

Top = 87

Width = 56

Height = 16

Caption = ''

FocusControl = chfam_Edit

end

object oper_Bevel: TBevel

Left = 18

Top = 282

Width = 251

Height = 96

end

object oper_Shape: TShape

Left = 19

Top = 283

Width = 248

Height = 94

Brush.Color = clBlack

end

object Animate1: TAnimate

Left = 24

Top = 291

Width = 60

Height = 80

Active = True

FileName = 'Frage.avi'

StopFrame = 31

Transparent = False

end

end

object sex2_RadioGroup: TRadioGroup

Left = 185

Top = 218

Width = 77

Height = 41

Caption = ''

Columns = 2

ItemIndex = 0

Items.Strings = (

''

'')

TabOrder = 4

end

object chdp_ComboBox: TComboBox

Left = 101

Top = 40

Width = 162

Height = 22

Style = csDropDownList

Font.Charset = RUSSIAN_CHARSET

Font.Color = clBlack

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ItemHeight = 14

ParentFont = False

TabOrder = 0

end

object chfam_Edit: TEdit

Left = 101

Top = 90

Width = 162

Height = 22

Font.Charset = RUSSIAN_CHARSET

Font.Color = clBlack

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

TabOrder = 1

Text = 'chfam_Edit'

end

object chname_Edit: TEdit

Left = 101

Top = 140

Width = 162

Height = 22

Font.Charset = RUSSIAN_CHARSET

Font.Color = clBlack

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

TabOrder = 2

Text = 'chname_Edit'

end

object chgrand_Edit: TEdit

Left = 101

Top = 190

Width = 162

Height = 22

Font.Charset = RUSSIAN_CHARSET

Font.Color = clBlack

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

TabOrder = 3

Text = 'chgrand_Edit'

end

object chadd_Button: TButton

Left = 88

Top = 294

Width = 169

Height = 25

Hint = ' '

Caption = '&'

ParentShowHint = False

ShowHint = True

TabOrder = 5

OnClick = chadd_ButtonClick

end

object chdelete_Button: TButton

Left = 88

Top = 322

Width = 169

Height = 25

Hint = ' '

Caption = '&'

ParentShowHint = False

ShowHint = True

TabOrder = 6

OnClick = chdelete_ButtonClick

end

object chpost_Button: TButton

Left = 88

Top = 351

Width = 169

Height = 25

Hint = ' '

Caption = '&'

ParentShowHint = False

ShowHint = True

TabOrder = 7

OnClick = chpost_ButtonClick

end

object chyear_CSpinEdit: TCSpinEdit

Left = 119

Top = 233

Width = 50

Height = 23

TabStop = True

Font.Charset = RUSSIAN_CHARSET

Font.Color = clBlack

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

MaxValue = 2000

MinValue = 1900

ParentColor = False

ParentFont = False

TabOrder = 8

Value = 1950

end

end

end

object left_Panel: TPanel

Left = 0

Top = 0

Width = 421

Height = 429

Align = alLeft

BevelInner = bvLowered

Caption = 'left_Panel'

TabOrder = 1

object find_TPanel: TPanel

Left = 6

Top = 5

Width = 406

Height = 420

Caption = 'find_TPanel'

TabOrder = 1

object find_Label: TLabel

Left = 109

Top = 16

Width = 265

Height = 24

Alignment = taCenter

Caption = ' ϲʲ'

Font.Charset = RUSSIAN_CHARSET

Font.Color = clRed

Font.Height = -21

Font.Name = 'Arial Cyr'

Font.Style = [fsBold, fsItalic]

ParentFont = False

end

object dp_GroupBox: TGroupBox

Left = 8

Top = 48

Width = 393

Height = 65

Caption = ' ³ '

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

TabOrder = 0

object dp_ComboBox: TComboBox

Left = 14

Top = 22

Width = 155

Height = 24

ItemHeight = 16

Items.Strings = (

'')

TabOrder = 0

OnChange = dp_ComboBoxChange

end

end

object dp2_GroupBox: TGroupBox

Left = 216

Top = 58

Width = 169

Height = 46

Caption = ' '

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsItalic]

ParentFont = False

TabOrder = 1

object dp2_DBEdit: TDBEdit

Left = 5

Top = 15

Width = 156

Height = 23

Color = clSilver

DataField = 'PROISV'

DataSource = dp_DataSource

Enabled = False

TabOrder = 0

end

end

object pr_GroupBox: TGroupBox

Left = 8

Top = 113

Width = 393

Height = 226

Caption = ' '

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

TabOrder = 2

object pr_Panel: TPanel

Left = 9

Top = 196

Width = 66

Height = 26

TabOrder = 0

object pr_Label: TLabel

Left = 9

Top = 3

Width = 47

Height = 20

Alignment = taCenter

AutoSize = False

Caption = '1'

Font.Charset = RUSSIAN_CHARSET

Font.Color = clRed

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

Layout = tlCenter

end

end

end

object find_Animate: TAnimate

Left = 40

Top = 4

Width = 48

Height = 45

Active = True

CommonAVI = aviFindComputer

StopFrame = 8

end

object GroupBox1: TGroupBox

Left = 8

Top = 340

Width = 393

Height = 77

Caption = ' SQL'

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentFont = False

TabOrder = 4

object sql_Label: TLabel

Left = 11

Top = 16

Width = 372

Height = 57

AutoSize = False

Color = clBtnFace

Font.Charset = RUSSIAN_CHARSET

Font.Color = clRed

Font.Height = -13

Font.Name = 'Times New Roman'

Font.Style = [fsBold, fsItalic]

ParentColor = False

ParentFont = False

WordWrap = True

end

end

end

object pr_DBGrid: TDBGrid

Left = 22

Top = 136

Width = 378

Height = 173

DataSource = pr_DataSource

Font.Charset = RUSSIAN_CHARSET

Font.Color = clWindowText

Font.Height = -11

Font.Name = 'Times New Roman'

Font.Style = [fsItalic]

Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit]

ParentFont = False

TabOrder = 0

TitleFont.Charset = RUSSIAN_CHARSET

TitleFont.Color = clWindowText

TitleFont.Height = -11

TitleFont.Name = 'Times New Roman'

TitleFont.Style = [fsItalic]

OnCellClick = pr_DBGridCellClick

OnKeyDown = pr_DBGridKeyDown

Columns = <

item

Expanded = False

FieldName = 'FAM'

Title.Caption = ''

Width = 59

Visible = True

end

item

Expanded = False

FieldName = 'NAM'

Title.Caption = ''#39''

Width = 57

Visible = True

end

item

Expanded = False

FieldName = 'PAR'

Title.Caption = ' '

Width = 67

Visible = True

end

item

Alignment = taCenter

Expanded = False

FieldName = 'YEAR_B'

Title.Caption = ' '

Width = 85

Visible = True

end

item

Alignment = taCenter

Expanded = False

FieldName = 'SEX'

Title.Caption = ''

Visible = True

end

item

Expanded = False

FieldName = 'AGE'

Title.Caption = ''

Width = 38

Visible = True

end

item

Expanded = False

FieldName = 'CHARACT'

Title.Caption = ''

Visible = True

end

item

Expanded = False

FieldName = 'PHOTO'

Title.Caption = ''

Visible = True

end>

end

object pr_DBNavigator: TDBNavigator

Left = 96

Top = 320

Width = 304

Height = 18

DataSource = pr_DataSource

VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast]

TabOrder = 2

end

end

object dp_DataSource: TDataSource

DataSet = dp_Query

Left = 110

Top = 58

end

object pr_DataSource: TDataSource

DataSet = pr_Query

Left = 213

Top = 263

end

object dp_Query: TQuery

DatabaseName = 'dbP'

RequestLive = True

SQL.Strings = (

'Select * from Dep where DEP = :PDEP')

Left = 139

Top = 58

ParamData = <

item

DataType = ftString

Name = 'PDEP'

ParamType = ptUnknown

end>

object dp_QueryDEP: TStringField

FieldName = 'DEP'

Origin = 'DEP.DEP'

Size = 15

end

object dp_QueryPROISV: TStringField

FieldName = 'PROISV'

Origin = 'DEP.PROISV'

Size = 15

end

end

object update_Query: TQuery

DatabaseName = 'dbP'

DataSource = pr_DataSource

RequestLive = True

Left = 271

Top = 263

end

object pr_Query: TQuery

ObjectView = True

BeforePost = pr_QueryBeforePost

AfterScroll = pr_QueryAfterScroll

OnCalcFields = pr_QueryCalcFields

DatabaseName = 'dbP'

RequestLive = True

SQL.Strings = (

'Select * from Pers where DEP = :DEP order by FAM,NAM,PAR')

Left = 242

Top = 263

ParamData = <

item

DataType = ftString

Name = 'DEP'

ParamType = ptUnknown

end>

object pr_QueryNUM: TSmallintField

FieldName = 'NUM'

Origin = 'PERS.NUM'

end

object pr_QueryDEP: TStringField

FieldName = 'DEP'

Origin = 'PERS.DEP'

Size = 15

end

object pr_QueryFAM: TStringField

FieldName = 'FAM'

Origin = 'PERS.FAM'

end

object pr_QueryNAM: TStringField

FieldName = 'NAM'

Origin = 'PERS.NAM'

end

object pr_QueryPAR: TStringField

FieldName = 'PAR'

Origin = 'PERS.PAR'

end

object pr_QueryYEAR_B: TSmallintField

FieldName = 'YEAR_B'

Origin = 'PERS.YEAR_B'

end

object pr_QuerySEX: TStringField

FieldName = 'SEX'

Origin = 'PERS.SEX'

Size = 1

end

object pr_QueryAGE: TSmallintField

Alignment = taCenter

DisplayLabel = ''

DisplayWidth = 7

FieldKind = fkCalculated

FieldName = 'AGE'

Calculated = True

end

end

object insert_StoredProc: TStoredProc

ObjectView = True

DatabaseName = 'dbP'

StoredProcName = 'INSERTDBP'

Left = 308

Top = 263

ParamData = <

item

DataType = ftString

Name = 'PDEP'

ParamType = ptInput

end

item

DataType = ftString

Name = 'PFAM'

ParamType = ptInput

end

item

DataType = ftString

Name = 'PNAM'

ParamType = ptInput

end

item

DataType = ftString

Name = 'PPAR'

ParamType = ptInput

end

item

DataType = ftInteger

Name = 'PYEAR_B'

ParamType = ptInput

end

item

DataType = ftString

Name = 'PSEX'

ParamType = ptInput

end>

end

object update_StoredProc: TStoredProc

ObjectView = True

DatabaseName = 'dbP'

StoredProcName = 'UPDATEDBP'

Left = 366

Top = 263

ParamData = <

item

DataType = ftString

Name = 'PDEP'

ParamType = ptInput

end

item

DataType = ftString

Name = 'PFAM'

ParamType = ptInput

end

item

DataType = ftString

Name = 'PNAM'

ParamType = ptInput

end

item

DataType = ftString

Name = 'PPAR'

ParamType = ptInput

end

item

DataType = ftInteger

Name = 'PYEAR_B'

ParamType = ptInput

end

item

DataType = ftString

Name = 'PSEX'

ParamType = ptInput

end

item

DataType = ftInteger

Name = 'NUMBER'

ParamType = ptOutput

end>

end

object delete_StoredProc: TStoredProc

ObjectView = True

DatabaseName = 'dbP'

StoredProcName = 'DELETEDBP'

Left = 337

Top = 263

ParamData = <

item

DataType = ftInteger

Name = 'PNUM'

ParamType = ptInput

end>

end

end

:

Udb.h

//---------------------------------------------------------------------------

#ifndef UdbH

#define UdbH

//---------------------------------------------------------------------------

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include <ComCtrls.hpp>

#include <DBCtrls.hpp>

#include <DBGrids.hpp>

#include <ExtCtrls.hpp>

#include <Grids.hpp>

#include <Mask.hpp>

#include <Db.hpp>

#include <DBTables.hpp>

#include "cspin.h"

#include "CSPIN.h"

#include <jpeg.hpp>

#include <Buttons.hpp>

#include <Graphics.hpp>

//---------------------------------------------------------------------------

class Tmain_Form : public TForm

{

__published: // IDE-managed Components

TPageControl *PageControl;

TTabSheet *find_TabSheet;

TRadioGroup *sex_RadioGroup;

TEdit *speedfind_Edit;

TDataSource *dp_DataSource;

TDataSource *pr_DataSource;

TTabSheet *TabEdit;

TComboBox *chdp_ComboBox;

TEdit *chfam_Edit;

TEdit *chname_Edit;

TEdit *chgrand_Edit;

TRadioGroup *sex2_RadioGroup;

TButton *chadd_Button;

TButton *chdelete_Button;

TButton *chpost_Button;

TCSpinEdit *chyear_CSpinEdit;

TCSpinEdit *minage_CSpinEdit;

TCSpinEdit *maxage_CSpinEdit;

TPanel *left_Panel;

TPanel *find_TPanel;

TLabel *find_Label;

TGroupBox *dp_GroupBox;

TGroupBox *dp2_GroupBox;

TGroupBox *pr_GroupBox;

TDBGrid *pr_DBGrid;

TDBNavigator *pr_DBNavigator;

TGroupBox *ch_GroupBox;

TLabel *chdp_Label;

TLabel *chname_Label;

TLabel *chgrand_Label;

TLabel *chyear_Label;

TLabel *chfam_Label;

TGroupBox *age_GroupBox;

TLabel *minage_Label;

TLabel *maxage_Label;

TGroupBox *speedfind_GroupBox;

TLabel *speedfind_Label;

TImage *speedfind_Image;

TImage *minage_Image;

TImage *maxage_Image;

TAnimate *find_Animate;

TBitBtn *select_BitBtn;

TGroupBox *select_GroupBox;

TQuery *dp_Query;

TQuery *update_Query;

TComboBox *dp_ComboBox;

TDBEdit *dp2_DBEdit;

TStringField *dp_QueryDEP;

TStringField *dp_QueryPROISV;

TGroupBox *GroupBox1;

TLabel *sql_Label;

TAnimate *Animate1;

TBevel *oper_Bevel;

TShape *oper_Shape;

TImage *Image1;

TQuery *pr_Query;

TSmallintField *pr_QueryNUM;

TStringField *pr_QueryDEP;

TStringField *pr_QueryFAM;

TStringField *pr_QueryNAM;

TStringField *pr_QueryPAR;

TSmallintField *pr_QueryYEAR_B;

TStringField *pr_QuerySEX;

TSmallintField *pr_QueryAGE;

TStoredProc *insert_StoredProc;

TStoredProc *update_StoredProc;

TStoredProc *delete_StoredProc;

TPanel *pr_Panel;

TLabel *pr_Label;

void __fastcall FormCreate(TObject *Sender);

void __fastcall dp_ComboBoxChange(TObject *Sender);

void __fastcall speedfind_EditChange(TObject *Sender);

void __fastcall pr_QueryCalcFields(TDataSet *DataSet);

void __fastcall pr_QueryAfterScroll(TDataSet *DataSet);

void __fastcall pr_QueryBeforePost(TDataSet *DataSet);

void __fastcall chadd_ButtonClick(TObject *Sender);

void __fastcall chdelete_ButtonClick(TObject *Sender);

void __fastcall chpost_ButtonClick(TObject *Sender);

void __fastcall PageControlChange(TObject *Sender);

void __fastcall minage_CSpinEditChange(TObject *Sender);

void __fastcall select_BitBtnClick(TObject *Sender);

void __fastcall pr_DBGridCellClick(TColumn *Column);

void __fastcall prview_RadioGroupClick(TObject *Sender);

void __fastcall pr_DBGridKeyDown(TObject *Sender, WORD &Key,

TShiftState Shift);

private:// User declarations

public:// User declarations

fastcall Tmain_Form(TComponent* Owner);

unsigned short Year;

unsigned short Month;

unsigned short Day;

bool CanPost;

AnsiString sql_Operator;

void __fastcall Delay(unsigned long int mSeconds);

};

//---------------------------------------------------------------------------

extern PACKAGE Tmain_Form *main_Form;

//---------------------------------------------------------------------------

#endif

Udb.cpp

#include <vcl.h>

#pragma hdrstop

#include "Udb.h"

#pragma package(smart_init)

#pragma link "cspin"

#pragma link "CSPIN"

#pragma resource "*.dfm"

Tmain_Form *main_Form;

fastcall Tmain_Form::Tmain_Form(TComponent* Owner)

TForm(Owner)

{}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::FormCreate(TObject *Sender)

{

CanPost = false;

Date().DecodeDate(&Year,&Month,&Day);

pr_Query->SQL->Clear();

sql_Operator = "Select * from PERS order by NUM";

sql_Label->Caption = sql_Operator;

pr_Query->SQL->Add(sql_Operator);

pr_Query->Open();

pr_Query->First();

dp_Query->SQL->Clear();

sql_Operator = "Select * from DEP";

sql_Label->Caption = sql_Operator;

dp_Query->SQL->Add(sql_Operator);

dp_Query->Open();

dp_Query->First();

// ComboBox dp_ComboBox chdp_ComboBox

dp_ComboBox->Clear();

chdp_ComboBox->Clear();

while (!dp_Query->Eof) {

dp_ComboBox->Items->Add(dp_QueryDEP->AsString);

chdp_ComboBox->Items->Add(dp_QueryDEP->AsString);

dp_Query->Next();

}

dp_ComboBox->Items->Add(" ");

dp_ComboBox->ItemIndex = dp_ComboBox->Items->Count - 1;

dp_ComboBoxChange(Sender);

chdp_ComboBox->ItemIndex = dp_ComboBox->ItemIndex;

PageControl->ActivePage = find_TabSheet;

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::dp_ComboBoxChange(TObject *Sender)

{

dp_Query->Close();

dp_Query->SQL->Clear();

sql_Operator = "Select * from DEP where DEP=:PDEP";

sql_Label->Caption = sql_Operator;

Delay(3000);

dp_Query->SQL->Add(sql_Operator);

dp_Query->Params->Items[0]->AsString = dp_ComboBox->Text;

dp_Query->Open();

dp_Query->First();

pr_Query->Close();

pr_Query->SQL->Clear();

if (dp_ComboBox->ItemIndex == dp_ComboBox->Items->Count - 1) {

//

sql_Operator = "Select * from PERS order by NUM";

sql_Label->Caption = sql_Operator;

Delay(3000);

pr_Query->SQL->Add(sql_Operator);

} else {

//

sql_Operator =

"Select * from DEP_" + AnsiString(dp_ComboBox->ItemIndex + 1);

sql_Label->Caption = sql_Operator;

Delay(3000);

pr_Query->SQL->Add(sql_Operator);

}

pr_Query->ExecSQL();

pr_Query->Open();

pr_Query->First();

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::speedfind_EditChange(TObject *Sender)

{

TLocateOptions SearchOptions;

pr_Query->Locate("FAM", speedfind_Edit->Text,

SearchOptions << loPartialKey << loCaseInsensitive);

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::pr_QueryCalcFields(TDataSet *DataSet)

{

pr_QueryAGE->Value = Year - pr_QueryYEAR_B->Value;

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::pr_QueryAfterScroll(TDataSet *DataSet)

{

if (PageControl->ActivePage == TabEdit) {

//

chdp_ComboBox -> ItemIndex =

chdp_ComboBox->Items->IndexOf(pr_QueryDEP->AsString);

chfam_Edit->Text = pr_QueryFAM->AsString;

chname_Edit->Text = pr_QueryNAM->AsString;

chgrand_Edit->Text = pr_QueryPAR->AsString;

chyear_CSpinEdit->Value = pr_QueryYEAR_B->AsInteger;

if (pr_QuerySEX->AsString == "") sex2_RadioGroup->ItemIndex = 0;

else sex2_RadioGroup->ItemIndex = 1;

}

pr_Label->Caption = pr_QueryNUM->AsString;

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::pr_QueryBeforePost(TDataSet *DataSet)

{

if (!CanPost) {

DataSet->Cancel();

Abort;

}

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::chadd_ButtonClick(TObject *Sender)

{ // PERS

insert_StoredProc->ParamByName("pDEP")->AsString = chdp_ComboBox->Text;

insert_StoredProc->ParamByName("pFAM")->AsString = chfam_Edit->Text;

insert_StoredProc->ParamByName("pNAM")->AsString = chname_Edit->Text;

insert_StoredProc->ParamByName("pPAR")->AsString = chgrand_Edit->Text;

insert_StoredProc->ParamByName("pYEAR_B")->AsInteger = chyear_CSpinEdit->Value;

insert_StoredProc->ParamByName("pSEX")->AsString =

sex2_RadioGroup->Items->Strings[sex2_RadioGroup->ItemIndex];

sql_Operator =

"Insert into PERS (DEP, FAM, NAM, PAR, YEAR_B, SEX)"

" VALUES (:pDEP, :pFAM, :pNAM, :pPAR, :pYEAR_B, :pSEX)";

sql_Label->Caption = sql_Operator;

insert_StoredProc->Prepare();

insert_StoredProc->ExecProc();

dp_ComboBoxChange(Sender);

ShowMessage (" INSERTdbP !");

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::chdelete_ButtonClick(TObject *Sender)

{ // PERS

if (Application->MessageBox(" ?",

"ϳ ",

MB_YESNO + MB_ICONEXCLAMATION) == IDYES) {

delete_StoredProc->ParamByName("pNUM")->AsInteger =

pr_QueryNUM->AsInteger;

sql_Operator = "Delete from PERS where NUM = :pNUM";

sql_Label->Caption = sql_Operator;

delete_StoredProc->Prepare();

delete_StoredProc->ExecProc();

dp_ComboBoxChange(Sender);

ShowMessage (" DELETEdbP !");

}

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::chpost_ButtonClick(TObject *Sender)

{

update_StoredProc->ParamByName("pDEP")->AsString = chdp_ComboBox->Text;

update_StoredProc->ParamByName("pFAM")->AsString = chfam_Edit->Text;

update_StoredProc->ParamByName("pNAM")->AsString = chname_Edit->Text;

update_StoredProc->ParamByName("pPAR")->AsString = chgrand_Edit->Text;

update_StoredProc->ParamByName("pYEAR_B")->AsInteger = chyear_CSpinEdit->Value;

update_StoredProc->ParamByName("pSEX")->AsString =

sex2_RadioGroup->Items->Strings[sex2_RadioGroup->ItemIndex];

sql_Operator =

"Update PERS Set DEP = :pDEP, YEAR_B = :pYEAR_B, SEX = :pSEX "

" Where (FAM = :pFAM) and (NAM = :pNAM) and (PAR = :pPAR)";

sql_Label->Caption = sql_Operator;

update_StoredProc->Prepare();

update_StoredProc->ExecProc();

dp_ComboBoxChange(Sender);

if (update_StoredProc->ParamByName("NUMBER")->AsInteger == 0)

ShowMessage ("* !");

else

ShowMessage (" . UPDATEdbP !");

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::PageControlChange(TObject *Sender)

{

if (PageControl->ActivePage == TabEdit)

pr_QueryAfterScroll(pr_Query);

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::minage_CSpinEditChange(TObject *Sender)

{

AnsiString s =

"(YEAR_B<=" + IntToStr(int(Year - minage_CSpinEdit->Value)) +

")and(YEAR_B>=" + IntToStr(int(Year - maxage_CSpinEdit->Value)) +

")and(SEX=";

if (!sex_RadioGroup->ItemIndex) s += "'')";

else s += "'')";

//

select_BitBtn->Kind = bkCancel;

select_BitBtn->Caption = "³ ";

pr_Query->Filter = s;

pr_Query->Filtered = true;

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::select_BitBtnClick(TObject *Sender)

{

if (pr_Query->Filtered) { //

pr_Query->Filtered = false;

select_BitBtn->Kind = bkYes;

select_BitBtn->Caption = " ";

} else { //

select_BitBtn->Kind = bkCancel;

select_BitBtn->Caption = "³ ";

minage_CSpinEditChange(Sender);

}

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::pr_DBGridCellClick(TColumn *Column)

{

if (PageControl->ActivePage == TabEdit) {

chdp_ComboBox -> ItemIndex =

chdp_ComboBox->Items->IndexOf(pr_QueryDEP->AsString);

chfam_Edit->Text = pr_QueryFAM->AsString;

chname_Edit->Text = pr_QueryNAM->AsString;

chgrand_Edit->Text = pr_QueryPAR->AsString;

chyear_CSpinEdit->Value = pr_QueryYEAR_B->AsInteger;

if (pr_QuerySEX->AsString == "") sex2_RadioGroup->ItemIndex = 0;

else sex2_RadioGroup->ItemIndex = 1;

}

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::Delay(unsigned long int mSeconds)

{ //

unsigned long int FirstTick;

FirstTick = GetTickCount();

do

Application->ProcessMessages();

while (GetTickCount() - FirstTick <= mSeconds);

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::prview_RadioGroupClick(TObject *Sender)

{

dp_ComboBoxChange (Sender);

}

//---------------------------------------------------------------------------

void __fastcall Tmain_Form::pr_DBGridKeyDown(TObject *Sender, WORD &Key,

TShiftState Shift)

{

pr_Label->Caption = pr_QueryNUM->AsString;

}

//---------------------------------------------------------------------------

- IBServer.EXE, "E:\Program Files\InterBase Corp\InterBase\Bin\" Interbase. ϳ - (.. 1.21) , Password: masterkey.:

1.21

. 1.22.

1.22


i :

1. RAD: TDataSource, TQuery, TDBMemo, TDBGrid, TDBImage, TDBText, TDBNavigator, TStoredProc.

2. Interbase ?

3. Interbase?

4. Interbase?

5. Interbase?

6. ?

7. Interbase?

8. Inter-base?

9. SQL SELECT, :

"Select * from DEP where DEP=:PDEP"?

10. / . TQuery?

11. , - .

12. .

SQL Interbase : ; ;

 

 

 

! , , , .
. , :