Автор работы: Пользователь скрыл имя, 21 Февраля 2013 в 19:57, курсовая работа
Часто ли пользователю нужен полный доступ к базе? В большинстве случаев запрашивается только та информация, которая напрямую относится к его сфере деятельности. Лучшим решением может являться перенос части базы ближе к пользователям. При решении этой задачи подобным способом получается территориально распределенная (удаленная) база данных.
Организация удаленных баз данных дает ряд преимуществ: снижается время отклика системы, повышается надежность хранения данных, уменьшается стоимость аппаратной части за счет снижения объемов данных, хранящихся на одном сервере.
Введение
Глава1 Основные подходы к проектированию удаленных баз данных
1.1 Основные понятия теории реляционных баз данных
1.2 Сервер базы данных
1.2.1 Технология и модели "клиент-сервер"
Глава 2 Технологии, исползуемые в работе
Глава 3 Реализация модели учета доходов Магазина и продаваемого товара»
3 Постановка задачи
3.1 Общие технические характеристики технологии InterBase
ЗАКЛЮЧЕНИЕ
Список используемой литературы
ПРИЛОЖЕНИЯ
Схема данных
Экранные формы
Листинги программы
Font.Color = clGreen
Font.Height = -24
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
end
object Oplata: TSpeedButton
Left = 0
Top = 336
Width = 185
Height = 33
Caption = #1054#1055#1051#1040#1063#
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
OnClick = OplataClick
end
object GroupBox1: TGroupBox
Left = 0
Top = 0
Width = 531
Height = 119
Align = alTop
Caption = #1055#1056#1054#1044#1040#
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
TabOrder = 0
DesignSize = (
531
119)
object Label8: TLabel
Left = 1
Top = 23
Width = 108
Height = 24
Caption = #1042#1080#1076' '#1090#1086#1074#1072#1088#
end
object Label3: TLabel
Left = 149
Top = 24
Width = 60
Height = 24
Caption = #1058#1086#1074#1072#1088':'
end
object Label7: TLabel
Left = 7
Top = 84
Width = 66
Height = 24
Caption = #1050#1086#1083'-'#1074#1086':
end
object prodan: TSpeedButton
Left = 150
Top = 80
Width = 123
Height = 33
Caption = #1044#1054#1041#1040#1042#
Flat = True
OnClick = prodanClick
end
object Label1: TLabel
Left = 352
Top = 38
Width = 99
Height = 29
Caption = #1048#1058#1054#1043#1054':'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -24
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
end
object DBSumma: TDBText
Left = 360
Top = 71
Width = 123
Height = 29
AutoSize = True
DataField = 'Itog'
DataSource = srcSumma
Font.Charset = DEFAULT_CHARSET
Font.Color = clGreen
Font.Height = -24
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
end
object psvid: TComboBox
Left = 2
Top = 45
Width = 145
Height = 32
ItemHeight = 24
TabOrder = 0
OnEnter = psvidEnter
OnSelect = psvidSelect
end
object pstype: TComboBox
Left = 152
Top = 45
Width = 193
Height = 32
Enabled = False
ItemHeight = 24
TabOrder = 1
OnSelect = pstypeSelect
end
object kol: TEdit
Left = 84
Top = 82
Width = 41
Height = 32
Anchors = []
BevelInner = bvSpace
BevelKind = bkSoft
TabOrder = 2
Text = '1'
end
end
object GroupBox2: TGroupBox
Left = 0
Top = 119
Width = 531
Height = 145
Align = alTop
Caption = #1057#1055#1048#1057#1054#
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
TabOrder = 1
object DBGrid1: TDBGrid
Left = 2
Top = 26
Width = 527
Height = 117
Align = alClient
DataSource = srcProd
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'MS Sans Serif'
Font.Style = []
Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit]
ParentFont = False
TabOrder = 0
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -13
TitleFont.Name = 'MS Sans Serif'
TitleFont.Style = []
OnDblClick = DBGrid1DblClick
Columns = <
item
Alignment = taCenter
Expanded = False
FieldName = 'DATA'
Title.Alignment = taCenter
Title.Caption = #1044#1072#1090#1072
Visible = True
end
item
Alignment = taCenter
Expanded = False
FieldName = 'VREMA'
Title.Alignment = taCenter
Title.Caption = #1042#1088#1077#1084#1103
Visible = True
end
item
Expanded = False
FieldName = #1058#1054#1042#1040#1056
Title.Alignment = taCenter
Width = 199
Visible = True
end
item
Alignment = taCenter
Expanded = False
FieldName = 'KOL_VO'
Title.Alignment = taCenter
Width = 60
Visible = True
end
item
Alignment = taCenter
Expanded = False
FieldName = 'SUMMA'
Title.Alignment = taRightJustify
Title.Caption = #1057#1090#1086#1080#1084#
Width = 96
Visible = True
end>
end
end
object prin: TEdit
Left = 0
Top = 296
Width = 185
Height = 37
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -24
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 2
OnKeyPress = prinKeyPress
end
object tblTp: TIBQuery
Database = frmMain.Baza
Transaction = frmMain.Tranz
BufferChunks = 1000
CachedUpdates = False
SQL.Strings = (
'select '
' types.naim "'#1058#1048#1055'",'
' marks.naim "'#1052#1040#1056#1050#1040'",
' vid_tovara.naim "'#1042#1048#1044'",'
' tovar.id_tovar,'
' tovar.naim,'
' tovar.model,'
' tovar.xarakter,'
' tovar.stoimost'
'from marks'
' inner join tovar on (marks.id_marka = tovar.marka)'
' inner join vid_tovara on (tovar.vid = vid_tovara.id_vid)'
' inner join types on (tovar.type_t = types.id_type)'
'where '
' ('
' (vid_tovara.naim = :a)'
' )')
Left = 216
Top = 18
ParamData = <
item
DataType = ftUnknown
Name = 'a'
ParamType = ptUnknown
end>
object tblTpIBDSDesigner: TIBStringField
FieldName = #1058#1048#1055
Origin = 'TYPES.NAIM'
Required = True
Size = 50
end
object tblTpIBDSDesigner2: TIBStringField
FieldName = #1052#1040#1056#1050#1040
Origin = 'MARKS.NAIM'
Required = True
Size = 50
end
object tblTpIBDSDesigner3: TIBStringField
FieldName = #1042#1048#1044
Origin = 'VID_TOVARA.NAIM'
Required = True
Size = 50
end
object tblTpID_TOVAR: TIntegerField
FieldName = 'ID_TOVAR'
Origin = 'TOVAR.ID_TOVAR'
Required = True
end
object tblTpNAIM: TIBStringField
FieldName = 'NAIM'
Origin = 'TOVAR.NAIM'
Required = True
Size = 150
end
object tblTpMODEL: TIBStringField
FieldName = 'MODEL'
Origin = 'TOVAR.MODEL'
end
object tblTpXARAKTER: TIBStringField
FieldName = 'XARAKTER'
Origin = 'TOVAR.XARAKTER'
Size = 50
end
object tblTpSTOIMOST: TFloatField
FieldName = 'STOIMOST'
Origin = 'TOVAR.STOIMOST'
Required = True
end
end
object tblProd: TIBQuery
Database = frmMain.Baza
Transaction = frmMain.Tranz
AfterDelete = tblProdAfterDelete
OnCalcFields = tblProdCalcFields
OnPostError = tblProdPostError
BufferChunks = 1000
CachedUpdates = False
SQL.Strings = (
'select * from PRODAJA')
UpdateObject = updProd
GeneratorField.Field = 'ID_PRODAJA'
GeneratorField.Generator = 'GEN_PRODAJA_ID'
GeneratorField.ApplyEvent = gamOnPost
Left = 144
Top = 200
object tblProdID_PRODAJA: TIntegerField
FieldName = 'ID_PRODAJA'
Origin = 'PRODAJA.ID_PRODAJA'
Required = True
end
object tblProdDATA: TDateField
FieldName = 'DATA'
Origin = 'PRODAJA.DATA'
Required = True
end
object tblProdVREMA: TTimeField
FieldName = 'VREMA'
Origin = 'PRODAJA.VREMA'
Required = True
end
object tblProdTOVAR: TIntegerField
FieldName = 'TOVAR'
Origin = 'PRODAJA.TOVAR'
Required = True
end
object tblProdKOL_VO: TFloatField
FieldName = 'KOL_VO'
Origin = 'PRODAJA.KOL_VO'
Required = True
end
object tblProdSUMMA: TFloatField
FieldName = 'SUMMA'
Origin = 'PRODAJA.SUMMA'
Required = True
currency = True
end
object tblProdITOGO: TCurrencyField
FieldKind = fkCalculated
FieldName = 'ITOGO'
Calculated = True
end
object tblProdField: TStringField
FieldKind = fkLookup
FieldName = #1058#1054#1042#1040#1056
LookupDataSet = frmTovar.tbltov
LookupKeyFields = 'ID_TOVAR'
LookupResultField = 'NAIM'
KeyFields = 'TOVAR'
Lookup = True
end
end
object updProd: TIBUpdateSQL
RefreshSQL.Strings = (
'Select '
' ID_PRODAJA,'
' DATA,'
' VREMA,'
' TOVAR,'
' KOL_VO,'
' SUMMA'
'from PRODAJA '
'where'
' ID_PRODAJA = :ID_PRODAJA')
ModifySQL.Strings = (
'update PRODAJA'
'set'
' ID_PRODAJA = :ID_PRODAJA,'
' DATA = :DATA,'
' VREMA = :VREMA,'
' TOVAR = :TOVAR,'
' KOL_VO = :KOL_VO,'
' SUMMA = :SUMMA'
'where'
' ID_PRODAJA = :OLD_ID_PRODAJA')
InsertSQL.Strings = (
'insert into PRODAJA'
' (ID_PRODAJA, DATA, VREMA, TOVAR, KOL_VO, SUMMA)'
'values'
' (:ID_PRODAJA, :DATA, :VREMA, :TOVAR, :KOL_VO, :SUMMA)')
DeleteSQL.Strings = (
'delete from PRODAJA'
'where'
' ID_PRODAJA = :OLD_ID_PRODAJA')
Left = 176
Top = 200
end
object zapSumma: TIBQuery
Database = frmMain.Baza
Transaction = frmMain.Tranz
BufferChunks = 1000
CachedUpdates = False
SQL.Strings = (
'select sum(summa) as itog from prodaja')
Left = 488
Top = 32
object zapSummaItog: TCurrencyField
FieldName = 'Itog'
end
end
object srcSumma: TDataSource
DataSet = zapSumma
Left = 488
Top = 73
end
object srcProd: TDataSource
DataSet = tblProd
Left = 112
Top = 199
end
object tblKassa: TIBQuery
Database = frmMain.Baza
Transaction = frmMain.Tranz
BufferChunks = 1000
CachedUpdates = False
SQL.Strings = (
'select * from KASSA')
UpdateObject = UpdKass
GeneratorField.Field = 'ID_KASSA'
GeneratorField.Generator = 'GEN_KASSA_ID'
GeneratorField.ApplyEvent = gamOnPost
Left = 192
Top = 296
object tblKassaID_KASSA: TIntegerField
FieldName = 'ID_KASSA'
Origin = 'KASSA.ID_KASSA'
Required = True
end
object tblKassaDATA: TDateField
FieldName = 'DATA'
Origin = 'KASSA.DATA'
Required = True
end
object tblKassaVREMA: TTimeField
FieldName = 'VREMA'
Origin = 'KASSA.VREMA'
Required = True
end
object tblKassaPRINATO: TFloatField
FieldName = 'PRINATO'
Origin = 'KASSA.PRINATO'
Required = True
currency = True
end
object tblKassaSDACHA: TFloatField