內容簡介
Access2007中文版是MicrosoftOffice2007中文版辦公軟體的重要組件,是一種小型
關係型資料庫系統。它具有快速開發應用程式、面向對象和客戶/伺服器、網上發布與網上查詢等強大功能,是目前使用較廣、功能較強的資料庫產品之一。本書以Access2007中文版為開發平台,在內容編排上強調實際操作,每章節均配備大量實例進行講解演示,使初學者迅速上手,掌握容易。本書內容包括
關係型資料庫的基本理論;資料庫及數據表的創建與維護;結構化查詢語言(SQL)基礎;查詢、窗體、報表的創建與維護;資料庫對象發布為Web設計;宏及VBA模組設計;套用系統設計與項目開發以及實驗實習項目等內容。同時,每章均設計了一套課後練習題,以供讀者鞏固所學知識,提高實際操作能力之用。
本書既可作為職業院校的資料庫基礎教材,也可以作為培訓學校資料庫教材,同樣適用於廣大計算機愛好者自學使用。
圖書目錄
前言
第1章 資料庫系統概述································1
1.1 資料庫的基本概念·····································1
1.1.1 數據與信息··········································1
1.1.2 資料庫··················································2
1.1.3 資料庫管理系統··································2
1.1.4 資料庫系統··········································3
1.2 數據模型·····················································3
1.3 關係資料庫·················································5
1.3.1 關係模型概述······································5
1.3.2 關係運算··············································7
1.3.3 數據完整性··········································7
本章小結······························································8
習題 ····································································8
第2章 Access 2007資料庫概述···············10
2.1 初識Access 2007 ·······································10
2.1.1 Access 2007 的發展歷史與特點·········10
2.1.2 Access 2007 的運行環境與安裝·········11
2.1.3 Access 2007 的啟動與退出·················12
2.2
Access 2007 的基本功能···························13
2.3
Access 2007 的工作界面···························15
2.4
Access 2007 的基本對象和
設計視圖視窗·············································19
2.4.1 Access 2007 的基本對象·····················19
2.4.2 Access 2007 的設計視圖視窗·············20
2.5 Access 2007 的幫助功能···························22
本章小結······························································24
習題 ····································································24
第3章 創建與維護資料庫····························26
3.1 資料庫的基本概念·····································26
3.1.1 什麼是資料庫······································26
3.1.2 什麼是數據表······································27
3.1.3 資料庫的設計原則與設計步驟··········27
錄
3.2
創建Access 2007 資料庫··························29
3.2.1 創建資料庫··········································29
3.2.2 打開資料庫··········································33
3.2.3 關閉資料庫··········································34
3.3
使用Access 2007 資料庫對象··················34
3.3.1 打開資料庫對象··································35
3.3.2 複製資料庫對象··································35
3.3.3 刪除資料庫對象··································37
3.3.4 導入資料庫對象··································38
3.3.5 導出資料庫對象··································39
3.4
管理資料庫·················································42
3.4.1 設定資料庫密碼··································42
3.4.2 備份和恢複數據庫······························44
3.4.3 壓縮和修複數據庫······························45
本章小結······························································47
習題 ····································································47
第4 章 創建與維護表·····································49
4.1
創建表·························································49
4.1.1 創建新表··············································49
4.1.2 表的欄位名及其說明··························57
4.1.3 表的欄位類型······································57
4.1.4 欄位屬性··············································59
4.1.5 主鍵和索引··········································64
4.1.6 建立表之間的關係······························65
4.2
維護表·························································67
4.2.1 打開與關閉表······································67
4.2.2 修改表的結構······································68
4.2.3 編輯表中的記錄··································70
4.3
調整表·························································72
4.3.1 改變表中欄位的顯示次序··················72
4.3.2 調整表的行高與列寬··························73
4.3.3 隱藏和顯示錶中的列··························74
4.3.4 凍結表中的列······································74
#12;
目錄
4.3.5
設定數據表的格式······························75
4.3.6
設定表的顯示字型······························75
4.4 使用表························································75
4.4.1
查找數據··············································75
4.4.2
替換數據··············································76
4.4.3
數據排序··············································77
4.4.4 篩選記錄··············································78
本章小結·····························································81
習題 ···································································82
第5章 結構化查詢語言································85
5.1 SQL 概述···················································85
5.1.1
SQL 的特點·········································85
5.1.2
在Access 中使用SQL························86
5.2 SQL 查詢功能···········································87
5.2.1
SELECT 子句······································87
5.2.2
簡單查詢··············································88
5.2.3
幾種特殊運算符··································89
5.2.4
排序······················································90
5.2.5
簡單的計算查詢··································90
5.2.6
分組與計算查詢··································91
5.3 SQL 操作功能···········································91
5.3.1
記錄追加··············································92
5.3.2
記錄更新··············································93
5.3.3 記錄刪除··············································93
本章小結·····························································94
習題 ···································································94
第6 章 創建與維護查詢································96
6.1 查詢的概念和類型····································96
6.1.1
查詢的概念··········································96
6.1.2
查詢的類型··········································97
6.2 創建基本查詢············································97
6.2.1
創建不帶條件的查詢··························97
6.2.2
創建帶有條件的查詢··························101
6.2.3
執行查詢中的計算······························105
6.3 創建特殊用途查詢····································107
6.3.1
交叉表查詢··········································108
6.3.2
參數查詢··············································110
6.4 動作查詢····················································111
6.4.1
生成表查詢··········································112
6.4.2
更新查詢··············································113
6.4.3
追加查詢··············································114
6.4.4
刪除查詢··············································115
6.5 利用SQL 創建查詢···································116
本章小結·····························································116
習題 ···································································117
第7 章 創建與維護窗體································119
7.1 初識窗體····················································119
7.1.1
窗體的功能··········································119
7.1.2
創建窗體的方法··································120
7.1.3
窗體設計工具······································120
7.1.4
窗體的類型··········································124
7.2 窗體中控制項的使用與編輯························126
7.2.1
在窗體中添加控制項······························126
7.2.2
控制項的編輯··········································132
7.3 使用嚮導創建窗體····································134
7.3.1
使用“窗體”嚮導創建窗體··············134
7.3.2
使用“窗體嚮導”創建窗體··············134
7.3.3
使用“數據表”窗體嚮導
創建窗體··············································135
7.4 利用設計視圖創建窗體····························136
7.4.1
使用設計視圖創建具
有編輯功能的窗體······························136
7.4.2
創建和使用主/子窗體·························138
7.4.3
生成
數據透視表窗體··························142
7.4.4
創建圖表窗體······································143
7.5 使用窗體處理數據····································145
7.5.1
瀏覽記錄··············································145
7.5.2
編輯記錄··············································145
7.5.3
查找與替換數據··································145
7.5.4
排序記錄··············································146
7.5.5 篩選記錄··············································146
本章小結·····························································147
習題 ···································································147
第8 章 創建與維護報表································
V
150150
150
8.1 初識報表····················································
8.1.1 報表的功能··········································
#12;
8.1.2
報表的視圖方式··································150
8.1.3
創建報表的方法··································151
8.1.4
報表設計工具······································152
8.1.5
報表的類型··········································156
8.1.6
報表與窗體的區別······························157
8.2 創建報表·····················································157
8.2.1
自動創建報表······································157
8.2.2
使用嚮導創建報表······························157
8.2.3
創建空報表··········································159
8.2.4
創建標籤報表······································160
8.2.5
使用設計視圖創建報表······················161
8.3 有關報表的其他處理·································164
8.3.1
排序和分組··········································164
8.3.2
子報表··················································167
8.3.3
創建圖表報表······································167
8.4 修改與美化報表·········································169
8.4.1
報表自動套用格式······························170
8.4.2
設計報表背景圖案······························170
8.4.3
添加頁碼··············································171
8.4.4
添加日期和時間··································172
8.5 計算報表中的數值·····································172
8.5.1
統計報表記錄的平均值、
最大值和最小值··································172
8.5.2
統計報表中的記錄個數······················173
8.5.3
建立報表中的計算欄位······················173
8.6 列印報表·····················································174
本章小結······························································175
習題 ····································································175
第9章 Web發布、OLE套用·························177
9.1 Web 發布····················································177
9.1.1
創建超級連結······································177
9.1.2
將窗體導出為HTML··························179
9.2 OLE 套用····················································181
9.2.1
OLE 基礎知識·····································181
9.2.2
使用OLE 對象····································181
9.3 Access 對象發布為PDF 或XPS···············183
9.3.1
PDF 與XPS 基礎知識·························183
安裝Publish·········································183
VI
9.3.2
9.3.3 將檔案導出PDF 或XPS 格式········ 183
本章小結······························································185
習題 ····································································185
第10 章 創建與維護宏···································186
10.1
宏·······························································186
10.1.1 認識宏和宏組····································186
10.1.2 宏設計基礎知識································187
10.1.3 宏中的常用操作································189
10.2
創建與編輯宏···········································190
10.2.1 創建簡單的宏····································190
10.2.2 創建事件宏········································191
10.2.3 創建條件宏········································194
10.2.4 創建其他特殊的宏····························197
10.3
宏的運行與調試·······································198
10.3.1 運行宏················································198
10.3.2 調試宏················································202
本章小結······························································202
習題 ····································································203
第11 章 資料庫開發工具VBA······················205
11.1
VBA 基礎知識·········································205
11.1.1 VBA 基本概念···································205
11.1.2 編寫VBA 語句··································209
11.1.3 VBA 語法結構···································210
11.1.4 VBA 編程環境···································215
11.1.5 VBA 的工作界面·······························216
11.2
過程和模組···············································218
11.2.1 過程····················································218
11.2.2 模組····················································220
11.3
在窗體中套用VBA 編程························222
11.4
VBA 程式調試與出錯處理·····················223
11.4.1 VBA 程式調試相關知識···················223
11.4.2 VBA 程式調試工具···························224
本章小結······························································226
習題 ····································································226
第12 章 套用系統的設計與開發················228
12.1
套用系統開發流程···································228
12.2
使用切換面板創建套用系統···················229
#12;
目錄
12.2.1
啟動切換面板管理器························229
12.2.2
創建與編輯切換面板頁····················230
12.2.3
設定默認的切換面板頁····················231
12.2.4
建立打開切換面板頁的
切換面板項········································231
12.2.5
測試與修改切換面板························233
12.2.6
在切換面板上打開窗體及項目········234
12.2.7
設定套用系統啟動屬性····················234
12.3 創建個性化的套用系統選單··················235
12.4 Access 2007 打包與數據簽名·················236
12.4.1
創建簽名的包····································236
12.4.2
提取和使用數字簽名包····················238
12.5 信用中心··················································239
12.5.1
使用信任位置中的
Access 2007 資料庫··························239
12.5.2
查找或創建受信任位置、
將資料庫添加到該位置····················239
12.5.3 打開資料庫時啟用禁用項目············240
本章小結·····························································240
習題 ···································································240
第13
章
Access 2007 資料庫管理系統
綜合設計············································242
13.1 綜合設計的目的······································242
13.2 系統功能介紹··········································242
13.3 創建資料庫及其數據表··························243
13.3.1
創建數據表········································243
13.3.2
創建表間關係····································244
13.4 創建系統功能模組··································245
13.4.1
系統登錄窗體設計····························245
13.4.2
系統主窗體設計································247
13.4.3
密碼維護············································250
13.4.4
檔案編輯窗體設計····························250
13.5 系統使用··················································253
本章小結·····························································255
習題 ···································································255
第14
章
Access 2007實驗項目·················256
14.1 實驗1 創建資料庫·······························256
14.2 實驗2 創建數據表·······························256
14.3 實驗3 創建查詢···································258
14.4 實驗4 創建窗體···································258
14.5 實驗5 創建子窗體·······························258
14.6 實驗6 創建報表···································259
14.7 實驗7 創建子報表·······························259
14.8 實驗8 宏···············································260
14.9 實驗9 Web 發布與OLE 套用·············260
14.10
實驗10 資料庫的維護·······················260
14.11
實驗11 VBA 編程······························261
14.12
實驗12 綜合套用設計·······················261
本章小結·····························································262
參考文獻·································································263
VII