|
Организация баз данных
_______________________________________________________________________
__ ??????????? ???
?????? ?.?.?.
????? ?? ??????? ???? ??????? ?????????? ??????????? ???????? ????? ???.
??????????. ????? ??? ?????????? ????? ??? ?????? ????????? ????????????? ?????????????? ????? ???????????????
???. ??????? ???? ?????? ??????, ?????? ???? ?? ????, ??????? ????????? ????? ,?????? ????? ????????????????,
???????? ??? ???? ????? ????? ????????. ?????? ???????? ?????? ????? ??????????? ? ??? ????? ?????? ???.
??????????? ?????????? ????? ???????? ???????????? ??????????? ????? ?????????. ?? ??????? ???????????? ??? ?????????? ?????? ???. ??????? ??????
??????? ??????? ???. ???? ???? ??????? ??? ????? ??????? ??????? ????? ?? ??????? ????????????? ????????? ???
????????(?????), ????????????? ???????? ??????. ?? ?????????????????? ???, ??? ???????? ?????? ????? ????????, ???????
???????????? ???? ?????????????????. ?????? ??????????????? ?? ?????? ???? ?????? ???????. ?????
????????????????. ??????? ????? ????????????????? ???????????????????? ????? ?????. ??????????
??????? ??????? ????????? ????? ???? ??????? ???? ? ??????????? ????? ??????????? ?? ?????
????, ??????? ?????? ???, ?????? ???? ??????????? ?????? ????????. ?????? ?????? ?????? ???????
???? ? ??????????. ??? ???? ??????? ????????, ? ????, ???? ????? ???? ?? ??????? ??????? ??? ????? ?????? ??? ?? ?????
?????? ??????? ??? ?????? ???????????? ???????? ?????? ????? ????? ??????? ????? ?????????????????? ???? ? ???????? ?
????????????? ????????. ???????? ??? ???? ???? ???? ????????? ??????????????????????????? ??????????? ?????? ???????. ????? ???
???, ?????? ?? ?????????????? ?????, ?????? ??????? ????????? -
????????????? ??, ????? ??????? ???? ? ???? ???. - ???? ? ??? ?????? ????????????,
??????????? ?????? ???? ??????????? ?????? ?????????. ???????????? ?? ??? ?????, ??? ????? ????? ?
????. ????? ?? ???? ????? ???? ??????? ???? ??????? ????? ?????? ????? ????? ????? ???. ???? ???? ?????
???????, ??????? ?????? ??? ???????. ?? ??????? ??, ????????????? ????? ???, ? ???????? ?????????????(????? ??????). ??????
???? ????????? ??????????? ??? ???? ??, ????, ??, ????, ????????????? ??????. ??? ???? ????? ????????????????????? ????????,
??????? ?????. ??????????????? ??????. ?? ????? ?????? ?????? ?????????, ???????
??????. ?????? ??? ????? (?????? ??? ????) ? ?????? ??? ?????? ???? ?????????????????????? ??????????????? ? ??????? ?????? ??? ??? (? ?????? ????
? ????? ? ??????). ?????? ??? ? ???? ????????? ??????????????????????????? ????????????????? ????? .? ?????? ?????? ???
????????(??????????????????????) ????????????????????????????(?????????????). ?????? ??? ? ???? ????????????????? ???????????. ?
???? ?????????????????????????, ?????? ????? ????? ??? ????????????????? ? ???????????? ??? ?????????????????? ????? ??????????
???? ????????. ?? ????????? ?? ?????????????????? ??? ?? ???? ????? ???, ????? ?????????? ???????. ????????, ?????(??? ???? ????? ??????? ????????? ? ?? ? ? ????? ????????????????????
????????. ?????? ????????? ??? ??? ???? ???? ??????????????(????, ???, ? ?????? ??? ?????????????? ????? ?????? ???
?????. ?? ????? ????????????????? ?????? ???????????????? ???
? ??????????????? ???? ????? ??????? ????? ??? ?? ????, ????????? ????? ?????????? ?? ??. ?????? ??? ????? ?????? ?????????
????????????? ????????? ???????? ?????. ?????????? ???? ?
); ?
?? ?????????????????, ??????????????. ?? ???????? ?????????, ???????? ??????
?????? ??? ??? ???????????? ???????. ???????, ?????? ?????? ??????, ????????????, ????? ????? ???????? ???? ??? ?????. ? ? ?
???, ???? ?????? ?? ????????????????? ??????????????? ????? ????? ???, ???????????????? ???? ? ????. ??? ?????? ??????????
???????????, ????? ???. ???? ???????????????????????, ???????? ????????????????? ??? ?????? ???????????? ???. ??????????????
??????????? ???. ?????? ???????
?.?.?. ??????
???????? ?? ?????? ??????? ?.?.?. ??????
??? ????/??
????? ???
???? ???? ????? ??
?? ????
????????????
???????????? ??? ????? ??? ??? ???
?????? ???????
???????????? ??? ????? ???
????????? ?????? ??? ????? ????????
????????? ????????. ? ???? ?????????????? ??????? ????? ??????????????? ??????. ???? ?????? ???? ? ?? ???????? ??????????
????????? ??????? ??????????? ???, ???????????? ???, ????? ????????? ?????? ? ????. ??????????? ???????????? ??????? ??? ??????
??????????????, ? ?? ????? ? ????????? ?? ?? ??????????????, ?????? ????? ? ???? ????????? ??????? ???? ??????? ??????????
?????? ?????????? ???? ??????? ??? ????????? ?????? ??? ????? ??? ????????? ???. ???????????????????
???????????????? ????? ???????????? ??????? ???, ????????????????????? ??????? ??? ?????? ????????????????????? ?????. ? ??????
?????????? ???? ?????,????? ????? ???, ??????????? ??????? ?????? ???????? ??? (??????????? ??? ?????? ?????), ?????
??????????????? ???????. ????? ????????? ??? ???????? ????. , ?? ???????
????? ???? ????? ??????? ????, ????????? ??????????????????? ????? ????? ??? ????? ??? ??? ?????. ?????????????
????? ???? ? ??? ????, ? ?? ???????? ? ??? ????? ??? ?????????? ??????, ? ??????? ?????, ????? ????? ?????????? ??????
?????????? ??? ????, ????? ???? ????????? ??? ???? ?? ????? ? ??? ????? ??? ???????????? ??? ????? ?????????
????????????????? ???????? ????? ??? ? ?? ????? ????? ????? ???????????? ???? ???????????????? ??????? ??? ??????? ? ????
????? ??? ? ??? ????? ???????? ??????? ???? ?????? ???. , ?? ????? ? ???
????? ??????? ???? ??? ?????,? ??????? ????? ? ??????????? ????????? ??? ??? ?????. ??????? ??????????? ??????
??? ????????? ????, ? ?? - ?????? ??? ????? ??????? ?, ?? ? ?, ? ???? ??? ??????????? ?. ???????????? ????? ???????? ?
?? ????? ?????????? ??? ???????????
???.
??????????????
????? ???
????
???? ????? ??
???????????? ?????? ???????
?.?.?. ??????
?????? ??????? ?.?.?.
?????? ???
???????????? ?????????????? ????????
?????????
????????? ??? ???????? ????? ????? ?????. ???.
?.?.?. ??????
???????? ???
???????? ??? ??????
??????? ???, ?????? ??????????. ????? ??????? ??????????? ??????? ???????????? ?????? ??????? ????? ?????????. ?? ??????????
??????? ???.???? ??????? ???, ???? ????? ????? ????? ????, ????? ??????
??? ???? ????? ??? ???????????? ????????? ?????? ????????. ?????? ??? ??? ????? ?????? ?????????????? ?????????????? ??????
???????????, ?????? ???? ????, ??????? ??????? ?????? ???? ????? ??? ??????????????? ???????????????? ???? ????? ???, ?? ???
????????? ????? ????????????, ?????????? ????????????????????????? ????? ??????? ???. ?????? ??? ??????? ?????? ???, ???, ????,
???????-?? ??? ???? ?????. ???? ? ???? ???? ???????, ? ?? ??
??????????? ?????????? ?????? ? ??? ????????, ???????. ??? ???????????? ????????????? ?????? ??? ? ????.? ? ? ??? ??
?????????? ???? ????????? ?????????????????????????. ?????? ??????????????????? ???????????? ? ?????? ??????: ?? ??????????
(???????) ?? ????????? ??? ?? ????(???? ?????? ??? ????? ??????? ???,? ??????????-??????????????. ???????
??????, ??? ??????? ? ?????. ????? ??? ????????????. ???? ??? ???? ???? ????????? ???, ????????????? ???, ?????? ???????????.??
????????? . ? ??? ???? ?? ??????? ??? ???? ?????????? ????? ???? ????? ? ????
???????? ? ??? ????????? ? ??????????????. ?? ?
??????????? ??? ???????????? ?????? ????. ???? ????? ???? ?????????????. ? ?????? ?????????????? ??????????
??????? ? ???? ????????, ????????, ?? ?? ?? ????????????????????? ?????????????, ??????? ? ????? ?????(????? ???? ???)??????
????????????????? ????????? ????? ?????. ?? ????? ????? ????? ?????????? ? ????? ????? ? ??? ??????? ???
??????????????????? ???. ????, ??? ?????????????????? ??????? ?????? ?? ???. ?????????????????? ??????? ???, ???????? ??????,
?????? ????? ?????? ??? ??????? ?????, ? ?? ?????????? ??? ?? ????? ?????. ???? ?????????? ?????? ???????
??????? ?? ???. ?????????? ????????? ?????? ????????????? ????????? ????? ???? ?????????? ??? ????? ?
?????????????????????????. ????????? ???????? ?? ??? ??? ??????? (???????, ????? ??????) ????????????????
??????????????? ?? ??????? ?? ????? ??????????? ???????? ???????? ??? ??????????????????????. ? ???? ???????
??????????? ??????, ???? ??? ???, ??? ??????? ?????? (???????????. ????? ??????????-??????????? ?????
??????????????. ??????????????
????????? ???????
???? ????
???????????? ???
??? ?????
???????????? ???
?????????
1. ???????
5. ??? ? ???? ????, ??????
????????? ????, ???????????????????, ???????? ???? ?????????. ?????????? ?????????? ???????????? ??????? ???? ????? ????????????
????? ???. ??????? (? ???? ????) ????????????????????????
???? ??????????????? ????? ??????????? ??????? ???????????. ???? ??????????? ????? ???????? ??? ?? ??????? ????- ????. ?????
??????????? ????? ?? ???, ? ??????????????? ???????? ??? ? ?????, ???? ??? ?????????. ? ????-???????? ???
??????????? ??? ??????? ????????????? ???. ????? ???-????????????? ???. ???????? ???????? ????? ???. ?????? ?? ?? ????, ???
????? ???? ??????????????, ?????? (??? ????? ????-???????? ???????quot;). ???? ????? ??? ????? ?? ????-????????????
????
?????? ???1
????? ???
8 35 ???8 ???
????1-? ??? ????? ?? Option Explicit ??? ' ???? ? ????
???????? ????? ?? ??????? ? ?????. ??? FillOptions ??? Const conNumButtons = 8 ??? Dim intOption As Integer ??? Me![Option1].SetFocus ??????? Me( OptionLabel &
intOption).Visible = False ??? Set dbs = CurrentDb() ??? strSQL = strSQL &
WHERE [ItemNumber] > 0 AND [SwitchboardID]= &
Me![SwitchboardID] ??? '
??? ????? ??????? ????? ? ???? ???????? ??????? Me![OptionLabel1].Caption =
???????????????????quot; ??????????? Me( Option & rst![ItemNumber]).Visible
= True ??????????? Me( OptionLabel
& rst![ItemNumber]).Caption = rst![ItemText] ??? rst.Close ' ?? ??. ????? ?????????. ?????intBtn
????? ??? ??? ?????. ??? Const conCmdCustomizeSwitchboard =
5 ??? ' ???? ???. On Error GoTo HandleButtonClick_Err ??? Set rst =
dbs.OpenRecordset( ?????????????quot;, dbOpenDynaset) ??? ' ?????? ??? ? ???? ???????? ? ??? ?????
???? ??????? dbs.Close ??????? '
???? ???? ???? ??? ??????? ????Me.Filter
= [ItemNumber] = 0 AND [SwitchboardID]= &
rst![Argument] ??????????? DoCmd.OpenForm rst![Argument], , , ,
acAdd ??????????? DoCmd.OpenReport rst![Argument],
acPreview ?????? ?????' ????? ????, ????????/P> ??????????? If (Err <> 0) Then MsgBox
???? ?????. ??????????? Me.Filter = [ItemNumber] = 0 AND [Argument] = '?
?????' ???????
Case conCmdExitApplication ??????????? DoCmd...nMacro
rst![Argument] ??????? '
????????? ????????. ??? ' ???????? ??????? ???. HandleButtonClick_Err: ??? If (Err =
conErrDoCmdCancelled) Then ??????? Resume
HandleButtonClick_Exit Option Explicit ??? DoCmd.DoMenuItem
acFormBar, acEditMenu, 8, , acMenuVer70 Err_????8_Click: On Error
GoTo Err_????0_Click Exit_????0_Click: End Sub ??? Dim
stLinkCriteria As String ???
Exit Sub Sub
???????34_AfterUpdate() ???
Me.RecordsetClone.FindFirst [Name_zakaz] = ' & Me![???????34]
& ' Option Explicit ??? DoCmd.DoMenuItem
acFormBar, acEditMenu, 8, , acMenuVer70 Err_????8_Click: On Error
GoTo Err_????0_Click Exit_????0_Click: End Sub Option Compare Database ???
Me.RecordsetClone.FindFirst [Name_tovar] = ' & Me![???????18]
& ' On Error GoTo Err_????5_Click ??? MsgBox Err.Description Option Compare Database? ' ???????? ??? ?? ????? ??? ??? Exit
Sub Private Sub
??_Click() ??? Dim intStyle As Integer ??? ' (???. blnOpening ??????? True, ??? ?? ?? ???
?????????Open.) Exit_OK_Click: ??? strMsg = ?? ??????? ??????????????????? ???'???? ?
??? ? ?? ?? ???????????. ??? Resume
Exit_OK_Click Exit_????_Click: End Sub Private Sub
????2_Click() ??? DoCmd.DoMenuItem
acFormBar, acEditMenu, 6, , acMenuVer70 ??? Resume
Exit_????2_Click DoCmd.DoMenuItem acFormBar, acEditMenu, 8, ,
acMenuVer70 Err_????3_Click: SELECT
????Name_tovar, Sum(????Cena) AS Sum_Cena, ?????.Name_postav,
?????.Number_D,?????.Date_Z WHERE
(((?????.Name_postav)=[Forms]![?????]![Name_postav])) SELECT ?????Name_zakaz, ?????Adres_zakaz, ?????Number_N,
?????Date_N,????Name_tovar, ????Srok_god, ????Ves_b, ????Ves_n, ????Cena,
????Date WHERE
(((?????Name_tov)=[Forms]![?????]![Name_tov])) GROUP BY ?????Name_zakaz,
?????Adres_zakaz, ?????Number_N, ?????Date_N,????Name_tovar, ????Srok_god, ????Ves_b,
????Ves_n, ????Cena, ????Date;
| |