《Delphi7程序设计与开发技术大全》
Delphi 教程 系列书籍 (064) 《Delphi7程序设计与开发技术大全》 网友(邦)整理 EMail: shuaihj@163.com
下载地址:
- 作者: 求是科技
- 丛书名: 软件工程师开发技术大全
- 出版社:人民邮电出版社
- ISBN:7115117209
- 上架时间:2006-9-29
- 出版日期:2006 年3月
- 开本:16开
- 页码:784
- 版次:1-3
内容简介
本书详细介绍了利用delphi 7开发应用程序的各项知识和诸多技巧。内容由浅入深、重点突出、实例丰富,既适于初/中级读者按部就班地学习,也可作为中/高级读者的良好参考书籍。全书共包括25章,分门别类的介绍了delphi 7的知识,全面深入地讲解了delphi 7的各项功能,每章先介绍基础原理,再分析各种具体的技术手段,最后是工程实践应用。既能让读者系统的学习各方面内容,又可以直接应用于项目开发。由于篇幅有限,书中没有列出所有程序的源代码,详细的源代码请查阅光盘。
目录
第1 章 Delphi 概述··················································································································· 1
1.1 Delphi 介绍··················································································································· 1
1.2 Delphi 7 的主要特性····································································································· 2
1.2.1 熟悉语言特性···································································································· 2
1.2.2 丰富的组件······································································································· 2
1.2.3 功能强大的数据库访问技术············································································· 3
1.2.4 便捷的Internet 编程技术·················································································· 3
1.3 Delphi 7 的安装与卸载································································································· 3
1.3.1 Delphi 7 的安装································································································· 3
1.3.2 Delphi 7 的卸载································································································· 6
第2 章 Delphi 7 的集成开发环境····························································································· 8
2.1 集成开发环境中的窗口元素························································································ 8
2.1.1 对象编辑器······································································································· 8
2.1.2 工程管理器······································································································· 8
2.1.3 代码编辑器······································································································· 9
2.1.4 对象浏览器····································································································· 11
2.1.5 调试器············································································································· 11
2.2 集成开发环境中的操作界面······················································································ 13
2.2.1 主菜单············································································································· 13
2.2.2 工具栏············································································································· 18
2.2.3 组件面板········································································································· 19
2.3 定制集成开发环境····································································································· 19
2.3.1 定制编程环境·································································································· 19
2.3.2 定制代码编辑器······························································································ 20
2.3.3 定制工具栏····································································································· 20
2.3.4 定制组件面板·································································································· 21
2.3.5 定制窗口位置·································································································· 22
2.3.6 保存当前定制·································································································· 22
2.4 附属工具···················································································································· 23
2.4.1 Database Desktop····························································································· 23
2.4.2 数据库引擎(BDE Administrator) ································································ 29
2.4.3 SQL Explorer ··································································································· 30
2.4.4 Data Pump ······································································································· 31
2.4.5 Image Editor ···································································································· 32
2.5 使用帮助系统············································································································· 34
第3 章 应用程序框架············································································································· 35
3.1 创建一个简单的Delphi 程序····················································································· 35
3.2 构成Delphi 工程的文件····························································································· 38
3.2.1 工程文件(.dpr)···························································································· 38
3.2.2 单元文件(.pas)···························································································· 38
3.2.3 窗体文件(.dfm)··························································································· 40
3.2.4 资源文件(.res) ···························································································· 41
3.2.5 工程选项及桌面配置文件(.dof)································································· 42
3.2.6 中间编译单元(.dcu)···················································································· 42
3.2.7 备份文件(.~ pas)······················································································ 42
3.2.8 包文件(.dpk)······························································································· 42
3.3 Delphi 项目的框架类·································································································· 42
3.3.1 TForm 类········································································································· 43
3.3.2 TApplication 类································································································ 45
3.3.3 TScreen 类······································································································· 48
3.4 Delphi 的公共体系结构······························································································ 48
3.4.1 Delphi 固有的体系结构··················································································· 48
3.4.2 多文档应用程序······························································································ 49
3.4.3 数据库模块窗体······························································································ 50
3.4.4 网络模块窗体·································································································· 51
3.5 Delphi 工程的常见管理方法······················································································ 51
3.5.1 工程的目录结构······························································································ 51
3.5.2 专用单元存放公共代码·················································································· 52
3.5.3 管理多个工程·································································································· 52
第4 章 Object Pascal 语言······································································································· 53
4.1 语言基础···················································································································· 53
4.1.1 Object Pascal 语言编写环境············································································ 53
4.1.2 注释语句········································································································· 54
4.1.3 标识符············································································································· 54
4.1.4 保留字和指令字······························································································ 55
4.1.5 数据类型与定义变量······················································································ 56
4.1.6 Object Pascal 的运算符··················································································· 64
4.1.7 语句················································································································· 65
4.1.8 过程与函数····································································································· 69
4.1.9 规范化命名····································································································· 74
4.2 面向对象的特性········································································································· 75
4.2.1 类和对象········································································································· 75
4.2.2 类的定义········································································································· 75
4.2.3 类的封装········································································································· 76
4.2.4 类的继承········································································································· 76
4.2.5 构造与析构····································································································· 77
4.2.6 方法················································································································· 80
4.2.7 多态性············································································································· 82
4.2.8 类运算符········································································································· 85
4.2.9 类方法和类引用······························································································ 87
4.3 结构化异常处理········································································································· 89
4.3.1 Try...Except 语句和Try...Finally 语句····························································· 89
4.3.2 Raise 语句······································································································· 91
4.3.3 异常类············································································································· 92
4.4 方法与技巧················································································································· 92
4.4.1 设置代码模板·································································································· 92
4.4.2 设置提示信息·································································································· 93
第5 章 使用VCL 组件编程···································································································· 94
5.1 可视化类库(VCL) ································································································· 94
5.1.1 VCL 类库结构································································································· 94
5.1.2 组件运行机制·································································································· 95
5.2 VCL 常用基类············································································································ 99
5.2.1 TPersistent 类··································································································· 99
5.2.2 TComponent 类································································································ 99
5.2.3 TControl 类···································································································· 100
5.2.4 TWinControl 类····························································································· 100
5.2.5 TGraphicControl 类······················································································· 101
5.2.6 TCustomControl 类························································································ 101
5.3 Delphi 组件··············································································································· 102
5.3.1 Delphi 组件的优势························································································ 102
5.3.2 组件的分类··································································································· 102
5.3.3 组件的属性、事件和方法············································································· 103
5.3.4 组件的基本操作···························································································· 106
5.4 使用Delphi 组件编程······························································································· 107
5.4.1 示例功能······································································································· 108
5.4.2 设置窗体······································································································· 108
5.4.3 编写代码······································································································· 110
第6 章 常用VCL 组件的使用······························································································ 112
6.1 简单组件·················································································································· 112
6.1.1 标签组件(TLabel)····················································································· 112
6.1.2 按钮组件(TButton)··················································································· 115
6.1.3 复选框组件(TCheckBox) ········································································· 116
6.1.4 单选框组件(TRadioButton)······································································ 117
6.1.5 下拉列表组件(TComboBox) ···································································· 117
6.1.6 窗格组件(TPanel)····················································································· 120
6.1.7 滚动条组件(TScrollBar)··········································································· 121
6.1.8 单选分组框组件(TRadioGroup) ······························································· 123
6.1.9 简单组件编程示例························································································ 124
6.2 文本编辑组件··········································································································· 126
6.2.1 单行编辑框组件(TEdit)············································································ 127
6.2.2 多行编辑框组件(TMemo)········································································ 129
6.2.3 RTF 编辑组件(TRichEdit) ········································································ 130
6.2.4 格式输入组件(TMaskEdit)······································································· 131
6.2.5 文本编辑组件编程示例················································································ 133
6.3 分组组件·················································································································· 139
6.3.1 Tab 组件(TTabControl) ············································································· 139
6.3.2 多页组件(TPageControl) ·········································································· 141
6.3.3 Tab 表组件(TTabSheet) ············································································ 143
6.3.4 分组组件编程示例························································································ 145
6.4 图形显示组件··········································································································· 149
6.4.1 图像组件(TImage)···················································································· 149
6.4.2 位图组件(TBitMap)·················································································· 150
6.4.3 图形显示组件编程示例················································································ 152
6.5 对话框组件··············································································································· 153
6.5.1 打开对话框组件(TOpenDialog) ······························································· 153
6.5.2 另存为对话框组件(TSaveDialog) ···························································· 156
6.5.3 打开图像对话框组件(TOpenPictureDialog)············································· 156
6.5.4 图像另存为对话框(TSavePictureDialog)·················································· 157
6.5.5 字体对话框(TFontDialog) ········································································ 157
6.5.6 颜色对话框(TColorDialog) ······································································ 158
6.5.7 打印对话框(TPrintDialog)········································································ 159
6.5.8 打印设置对话框(TPrinterSetupDialog)····················································· 160
6.5.9 查找对话框(TFindDialog) ········································································ 160
6.5.10 替换对话框(TReplaceDialog)································································· 161
6.5.11 对话框组件编程示例·················································································· 162
第7 章 高级VCL 组件········································································································· 167
7.1 窗体组件·················································································································· 167
7.1.1 表头组件(THeaderControl)······································································· 167
7.1.2 状态栏组件(TStatusBar)··········································································· 169
7.1.3 工具栏组件(TToolBar) ············································································· 171
7.1.4 酷栏组件(TCoolBar) ················································································ 174
7.1.5 窗体组件编程实例························································································ 175
7.2 菜单组件·················································································································· 178
7.2.1 主菜单组件(TMainMenu)········································································· 178
7.2.2 弹出菜单组件(TPopMenu)······································································· 180
7.2.3 菜单组件编程示例························································································ 182
7.3 表格组件·················································································································· 186
7.3.1 自绘栅格组件(TDrawGrid) ······································································ 186
7.3.2 字符串栅格组件(TStringGrid)·································································· 189
7.3.3 表格显示组件编程示例················································································ 189
7.4 列表组件·················································································································· 193
7.4.1 列表框组件(TListBox) ············································································· 193
7.4.2 动作列表组件(TActionList)······································································ 196
7.4.3 图像列表组件(TImageList) ······································································ 198
7.4.4 树型视图组件(TTreeView)······································································· 203
7.4.5 列表视图组件(TListView)········································································ 207
7.4.6 列表组件编程示例························································································ 212
7.5 打印相关·················································································································· 215
7.5.1 Quick Report 打印组件·················································································· 215
7.5.2 Rave Report 打印组件··················································································· 217
第8 章 窗体编程··················································································································· 218
8.1 窗体的分类··············································································································· 218
8.1.1 SDI 窗体········································································································ 218
8.1.2 MDI 窗体······································································································ 219
8.1.3 MPI 窗体······································································································· 222
8.2 窗体的基本属性、方法和事件················································································ 222
8.2.1 窗体的基本属性···························································································· 223
8.2.2 窗体的基本方法···························································································· 226
8.2.3 窗体的基本事件···························································································· 227
8.3 模式窗体与非模式窗体···························································································· 230
8.3.1 模式窗体······································································································· 230
8.3.2 非模式窗体··································································································· 231
8.4 窗体示例·················································································································· 231
第9 章 事件处理··················································································································· 234
9.1 事件的定义及作用··································································································· 234
9.2 常用事件·················································································································· 234
9.2.1 键盘事件······································································································· 234
9.2.2 鼠标事件······································································································· 235
9.3 拖曳事件·················································································································· 235
9.4 事件编程示例··········································································································· 237
9.4.1 检测是否按下Shift、Alt 或Ctrl 键······························································ 237
9.4.2 模拟按下键盘上的某个键············································································· 238
9.4.3 限制鼠标移动的范围···················································································· 247
9.4.4 自定义鼠标··································································································· 248
9.4.5 设置光标闪烁的速度···················································································· 249
9.4.6 不同程序间的拖曳操作················································································ 251
第10 章 文件和路径处理····································································································· 253
10.1 文件管理常用函数和过程······················································································ 253
10.1.1 文件操作常用函数和过程··········································································· 253
10.1.2 目录操作函数和过程·················································································· 256
10.1.3 驱动器操作常用函数·················································································· 259
10.2 各种文件类型的输入输出······················································································ 259
10.2.1 文本文件····································································································· 260
10.2.2 类型文件····································································································· 261
10.2.3 无类型文件·································································································· 263
10.3 映像内存的操作····································································································· 264
10.3.1 映像内存函数······························································································ 265
10.3.2 内存映像的步骤·························································································· 266
10.3.3 内存映像示例······························································································ 267
10.4 目录和驱动器········································································································· 272
10.4.1 获取System 目录························································································ 272
10.4.2 获取Windows 目录····················································································· 273
10.4.3 获取当前目录······························································································ 273
10.4.4 获取可用驱动器信息·················································································· 274
第11 章 GDI 和图像编程····································································································· 276
11.1 Delphi 的绘图类····································································································· 276
11.1.1 画布类(TCanvas) ···················································································· 276
11.1.2 画笔类(TPen)·························································································· 282
11.1.3 画刷类(TBrush) ······················································································ 285
11.1.4 颜色类(TColor)······················································································· 286
11.2 画图程序················································································································· 287
11.2.1 界面设计····································································································· 287
11.2.2 代码设计····································································································· 290
11.2.3 菜单设计····································································································· 294
11.3 坐标系统和映射模式······························································································ 297
11.3.1 设备坐标系·································································································· 298
11.3.2 逻辑坐标系·································································································· 298
11.3.3 屏幕坐标系·································································································· 298
11.3.4 窗体坐标系·································································································· 298
11.3.5 坐标映射····································································································· 299
11.3.6 设置映射模式······························································································ 300
11.3.7 设置窗口范围······························································································ 300
11.3.8 映射模式示例······························································································ 301
11.4 图像格式处理········································································································· 303
11.5 GDI 字体················································································································· 305
11.5.1 Win32 字体类型·························································································· 305
11.5.2 基本字体元素······························································································ 305
11.5.3 GDI 字体分类······························································································ 306
11.5.4 显示不同字体······························································································ 307
11.5.5 实际创建一种字体······················································································ 307
第12 章 多媒体技术············································································································· 310
12.1 多媒体技术概述····································································································· 310
12.1.1 MPC 标准···································································································· 310
12.1.2 多媒体技术应用领域·················································································· 310
12.1.3 开发多媒体应用程序的工具······································································· 311
12.2 特殊显示效果········································································································· 312
12.2.1 基本原理····································································································· 313
12.2.2 使用CopyRect 实现特效············································································· 313
12.2.3 使用BitBlt 实现特效·················································································· 314
12.3 动画························································································································ 319
12.3.1 文字动画····································································································· 319
12.3.2 图像动画····································································································· 320
12.4 音频与视频············································································································· 322
12.4.1 WAV 与MIDI 文件简介·············································································· 322
12.4.2 AVI 文件格式······························································································ 324
12.4.3 TMediaPlayer 组件的使用··········································································· 325
12.5 MessageBeep( )函数································································································ 328
12.6 PlaySound( )函数···································································································· 329
12.7 mciSendString( )函数······························································································ 330
第13 章 消息处理技术········································································································· 333
13.1 Windows 消息········································································································· 333
13.1.1 了解消息····································································································· 333
13.1.2 消息结构····································································································· 333
13.1.3 消息类型····································································································· 334
13.1.4 消息处理····································································································· 335
13.1.5 应用程序的消息循环·················································································· 338
13.2 Delphi 消息处理机制······························································································ 339
13.2.1 消息处理函数······························································································ 339
13.2.2 应用程序消息······························································································ 340
13.3 发送消息················································································································· 341
13.3.1 Perform()函数······························································································ 341
13.3.2 SendMessage( )和PostMessage( )函数························································ 341
13.4 消息和事件············································································································· 341
13.4.1 消息和事件的工作原理··············································································· 341
13.4.2 消息与事件的对应关系··············································································· 343
13.4.3 使用Windows 消息处理Delphi 没有的事件·············································· 343
13.5 消息处理编程示例································································································· 346
第14 章 多线程编程············································································································· 348
14.1 线程的基础知识····································································································· 348
14.1.1 进程与线程关系·························································································· 348
14.1.2 多线程应用条件·························································································· 349
14.2 VCL 线程对象········································································································ 351
14.2.1 TThread 类··································································································· 351
14.2.2 线程函数····································································································· 354
14.2.3 线程的挂起与继续······················································································ 355
14.2.4 线程的终止与异常处理··············································································· 356
14.3 管理多线程············································································································· 357
14.3.1 线程同步技术······························································································ 357
14.3.2 线程优先级·································································································· 358
14.4 多线程示例············································································································· 365
第15 章 动态链接库和组件包······························································································ 374
15.1 动态链接库概述····································································································· 374
15.1.1 动态链接库的概念······················································································ 374
15.1.2 Windows 系统的动态链接库······································································· 374
15.1.3 动态链接与静态链接·················································································· 375
15.1.4 DLL 和系统变量························································································· 376
15.1.5 DLL 的入口点函数····················································································· 376
15.1.6 DLL 和内存管理························································································· 377
15.1.7 DLL 中的数据····························································································· 377
15.1.8 DLL 中的异常和运行时错误······································································ 377
15.2 创建和调用DLL ···································································································· 378
15.2.1 创建DLL 的基本步骤················································································· 378
15.2.2 调用DLL····································································································· 381
15.3 在DLL 中封装窗体································································································ 384
15.4 使用DLL 共享数据································································································ 386
15.4.1 内存映射文件的概念·················································································· 386
15.4.2 与内存映射文件相关的函数······································································· 387
15.4.3 使用内存映射文件在DLL 中共享数据······················································ 389
15.5 钩子函数················································································································· 392
15.5.1 钩子链········································································································· 392
15.5.2 钩子函数····································································································· 392
15.5.3 钩子类型····································································································· 392
15.5.4 与使用钩子相关的函数··············································································· 394
15.5.5 使用钩子函数监测所有鼠标动作的实例···················································· 395
15.6 包和DLL················································································································ 398
15.6.1 为什么使用包······························································································ 399
15.6.2 与包有关的文件类型·················································································· 399
15.6.3 运行时包····································································································· 399
15.6.4 设计时包····································································································· 401
15.6.5 创建和编辑包······························································································ 403
15.6.6 配置包········································································································· 407
15.6.7 包集合文件·································································································· 408
15.6.8 使用包和DLL····························································································· 409
第16 章 开发新的VCL 组件································································································ 411
16.1 开发组件简介········································································································· 411
16.1.1 什么是组件·································································································· 411
16.1.2 为什么使用组件·························································································· 411
16.1.3 Delphi 的组件库基础·················································································· 412
16.1.4 组件和类····································································································· 417
16.1.5 开发组件的要求·························································································· 417
16.1.6 如何选择新组件的基类··············································································· 419
16.1.7 开发新组件的基本步骤··············································································· 420
16.1.8 测试未安装的组件······················································································ 423
16.1.9 测试已安装的组件······················································································ 424
16.2 组件开发过程中的面向对象编程··········································································· 424
16.2.1 定义新类····································································································· 424
16.2.2 祖先、后代及类层次·················································································· 425
16.2.3 访问控制····································································································· 425
16.2.4 分派方式····································································································· 426
16.2.5 抽象类成员·································································································· 427
16.2.6 类和指针····································································································· 428
16.3 创建属性················································································································· 428
16.3.1 属性的类型·································································································· 428
16.3.2 发布继承的属性·························································································· 428
16.3.3 定义属性····································································································· 428
16.3.4 存储和装载属性·························································································· 432
16.4 创建事件················································································································· 434
16.4.1 事件定义····································································································· 434
16.4.2 怎样实现标准事件······················································································ 436
16.4.3 定义新事件·································································································· 437
16.5 创建方法················································································································· 439
16.5.1 避免互相依赖······························································································ 439
16.5.2 命名方法的惯例·························································································· 439
16.5.3 保护方法····································································································· 440
16.5.4 使方法变为虚方法······················································································ 440
16.5.5 声明方法····································································································· 440
16.6 在组件中使用图形································································································· 440
16.6.1 VCL 的图形接口························································································· 441
16.6.2 使用Canvas································································································· 441
16.6.3 使用图形工作······························································································ 441
16.6.4 脱屏位图(Off-Screen Bitmap)································································· 443
16.6.5 对变化作出反应·························································································· 443
16.7 处理消息和系统通知······························································································ 444
16.7.1 理解消息处理系统······················································································ 444
16.7.2 改变消息处理方法······················································································ 445
16.7.3 创建新的消息处理方法··············································································· 446
16.8 使组件在设计阶段可用·························································································· 448
16.8.1 注册组件····································································································· 448
16.8.2 安装组件到组件面板·················································································· 450
16.8.3 使组件的资源文件可用··············································································· 452
16.8.4 为组件设置位图·························································································· 453
16.8.5 为组件提供帮助·························································································· 454
16.8.6 增加属性编辑器·························································································· 454
16.8.7 加入组件编辑器·························································································· 457
16.9 修改现存的组件:制作非自动换行的Memo 组件··············································· 460
16.9.1 创建并注册组件·························································································· 460
16.9.2 修改组件类·································································································· 461
16.10 开发图形组件:制作Shape 图形组件································································· 462
16.10.1 创建和注册组件························································································ 462
16.10.2 发布继承的属性························································································ 462
16.10.3 增加图形能力···························································································· 463
16.11 开发窗口控件:制作Calendar 组件····································································· 468
16.11.1 创建并注册组件························································································ 468
16.11.2 发布继承属性···························································································· 469
16.11.3 改变初始值································································································ 470
16.11.4 重定义单元格大小···················································································· 470
16.11.5 填充单元格································································································ 471
16.11.6 跟踪日期···································································································· 472
16.11.7 导航月和年································································································ 476
16.11.8 导航日期···································································································· 476
16.12 开发数据感知控件:制作数据感知的Calender 组件·········································· 478
16.12.1 制作一个数据浏览控件············································································· 478
16.12.2 制作一个数据编辑控件············································································· 482
16.13 开发非可视组件:制作Dialog 组件···································································· 486
16.13.1 定义组件接口···························································································· 486
16.13.2 创建和注册组件························································································ 487
16.13.3 创建组件接口···························································································· 487
16.13.4 测试对话框组件························································································ 488
第17 章 Delphi 两层数据库开发·························································································· 489
17.1 数据库基础知识····································································································· 489
17.1.1 数据库的出现和发展·················································································· 489
17.1.2 数据库的组成······························································································ 491
17.1.3 数据库系统模型·························································································· 492
17.1.4 数据库的常用概念······················································································ 494
17.1.5 目前流行的数据库介绍··············································································· 495
17.1.6 数据库开发的一般方法··············································································· 498
17.2 Delphi 的数据库体系结构······················································································ 500
17.2.1 Delphi 数据库访问原理··············································································· 500
17.2.2 Delphi 与其他数据库开发工具的比较························································ 502
17.2.3 Delphi 的数据库开发优势··········································································· 503
17.3 Delphi 支持的数据引擎·························································································· 503
17.3.1 BDE 数据库引擎························································································· 504
17.3.2 ADO 数据库引擎························································································ 504
17.3.3 dbExpress 数据库引擎················································································· 505
17.3.4 Interbase 数据库引擎··················································································· 506
17.4 数据访问组件········································································································· 506
17.4.1 数据库组件·································································································· 507
17.4.2 数据库连接组件·························································································· 512
17.4.3 数据集组件·································································································· 513
17.4.4 数据源组件·································································································· 535
17.5 数据感知组件········································································································· 537
17.5.1 单行字符字段编辑框组件(TDBText)····················································· 538
17.5.2 单行字段编辑框组件(TDBEdit)····························································· 542
17.5.3 多行字段编辑框组件(TDBMemo) ························································· 545
17.5.4 图像字段组件(TDBImage) ····································································· 550
17.5.5 字段列表框组件(TDBListBox) ······························································ 551
17.5.6 字段下拉列表框组件(TDBComboBox)·················································· 554
17.5.7 参照字段列表框组件(TDBLookupListBox) ··········································· 555
17.5.8 参照字段下拉列表框组件(TDBLookupComboBox) ······························ 557
17.5.9 记录导航组件(TDBNavigator) ······························································· 559
17.5.10 表格组件(TDBGrid) ············································································· 563
17.6 Delphi 的其他支持································································································· 569
17.6.1 DataPump ···································································································· 569
17.6.2 DataDesktop································································································· 572
17.6.3 BDE 配置工具····························································································· 581
17.6.4 SQL Explorer 实用工具··············································································· 582
17.7 如何连接数据库····································································································· 584
17.7.1 BDE 方式连接Access ················································································· 584
17.7.2 ODBC 方式连接Access ·············································································· 584
17.7.3 ADO 方式连接Access ················································································ 588
17.7.4 连接文本文件······························································································ 590
17.8 一些常用工具和数据字典的用法··········································································· 591
17.8.1 SQL 监视器································································································· 591
17.8.2 数据字典····································································································· 591
第18 章 客户/服务器编程···································································································· 593
18.1 从桌面数据库到客户/服务器结构········································································· 593
18.1.1 为什么要采用客户/服务器结构·································································· 593
18.1.2 客户/服务器体系结构················································································· 594
18.2 服务器端的设计开发······························································································ 596
18.2.1 数据库对象·································································································· 596
18.2.2 定义数据库表······························································································ 596
18.2.3 使用域········································································································· 598
18.2.4 定义视图、存储过程和触发器··································································· 598
18.2.5 业务规则····································································································· 603
18.2.6 数据库对象的访问权限··············································································· 604
18.3 客户端使用SQL 服务器························································································ 605
18.3.1 连接SQL 服务器························································································ 605
18.3.2 获得SQL 数据库信息················································································· 608
18.3.3 查询数据库·································································································· 608
18.3.4 数据库更新·································································································· 613
18.3.5 执行存储过程······························································································ 614
第19 章 多层数据库应用程序的开发·················································································· 619
19.1 多层体系结构和技术概述······················································································ 619
19.1.1 多层体系结构概述······················································································ 619
19.1.2 多层体系结构的优点·················································································· 620
19.1.3 多层体系结构技术概述··············································································· 622
19.2 客户端程序开发····································································································· 628
19.2.1 客户端应用程序的结构··············································································· 628
19.2.2 创建客户端应用程序的步骤······································································· 628
19.2.3 连接应用服务器·························································································· 629
19.2.4 管理应用服务器连接·················································································· 631
19.2.5 处理约束和客户端的差错控制··································································· 632
19.2.6 数据更新····································································································· 632
19.3 服务器程序开发····································································································· 634
19.3.1 创建应用服务器的步骤··············································································· 634
19.3.2 创建及配置远程数据模块··········································································· 636
19.3.3 建立IProvider 接口····················································································· 638
19.4 InternetExpress 扩展······························································································· 640
19.4.1 XML Broker 组件························································································ 640
19.4.2 TinetXPageProducer 组件············································································ 644
19.5 支持CORBA 和MTS····························································································· 645
19.5.1 CORBA ······································································································· 645
19.5.2 MTS············································································································· 646
19.6 Briefcase(公文包)程序······················································································· 648
第20 章 报表、图表和决策的支持······················································································ 651
20.1 使用QuickReport 组件创建报表············································································ 651
20.1.1 安装QReport 组件面板··············································································· 651
20.1.2 QuickReport 组件介绍················································································· 652
20.1.3 报表向导····································································································· 660
20.2 使用Rave 组件创建报表························································································ 662
20.2.1 开发环境介绍······························································································ 663
20.2.2 Rave 组件介绍····························································································· 664
20.2.3 创建视图····································································································· 666
20.2.4 创建报表····································································································· 669
20.2.5 应用实例····································································································· 672
20.3 TeeChart 图表组件·································································································· 676
20.3.1 TeeChart 组件介绍······················································································ 676
20.3.2 TeeChart 组件常用属性和方法··································································· 676
20.3.3 TeeChart 组件的使用··················································································· 677
20.3.4 Series 对象介绍··························································································· 679
20.3.5 创建数据库图表·························································································· 680
20.3.6 创建QuickReport 图表················································································ 682
20.3.7 使用TeeChart 向导创建图表······································································ 682
20.3.8 图表的预览,打印和导出··········································································· 684
20.4 Decision Cube 决策组件························································································· 685
20.4.1 Decision Cube 组件····················································································· 685
20.4.2 Decision Query 组件···················································································· 688
20.4.3 Decision Grid 组件······················································································· 689
20.4.4 Decision Graph 组件···················································································· 692
20.4.5 Decision Pivot 组件····················································································· 694
20.4.6 DecisionSource 组件···················································································· 697
第21 章 从数据建模到系统开发·························································································· 698
21.1 软件工程介绍········································································································· 698
21.1.1 生命周期法·································································································· 698
21.1.2 快速原型法·································································································· 700
21.2 数据库的建立········································································································· 702
21.2.1 需求分析····································································································· 702
21.2.2 数据建模····································································································· 703
21.2.3 设计规范化·································································································· 704
21.2.4 自动化设计工具·························································································· 704
21.3 设计用户端界面····································································································· 705
21.3.1 用户界面设计的基本原则··········································································· 705
21.3.2 Delphi 中用户界面设计··············································································· 706
21.4 基于ADO 两层结构的实现··················································································· 707
21.5 使用多层结构的实现······························································································ 708
21.5.1 基于DataSnap 技术的多层数据库应用程序··············································· 708
21.5.2 使用Bussiness Broker Server 的多层数据库应用程序································ 709
21.5.3 逻辑三层结构的数据库应用程序······························································· 709
21.6 发布到Web············································································································· 710
21.7 “图书管理系统”示例·························································································· 711
21.7.1 程序功能及总体结构设计··········································································· 711
21.7.2 数据库设计·································································································· 713
21.7.3 数据模块设计······························································································ 713
21.7.4 用户登录模块的实现·················································································· 714
21.7.5 图书馆管理系统功能的实现······································································· 717
21.7.6 修改图书记录模块的实现··········································································· 718
21.7.7 修改学生记录模块的实现··········································································· 721
21.7.8 修改密码设置模块的实现··········································································· 724
21.7.9 生成预约图书的报表·················································································· 726
21.7.10 生成催还图书的报表················································································ 728
21.7.11 图书馆服务系统功能的实现····································································· 731
21.7.12 查询、借阅及预约图书············································································· 733
21.7.13 查询个人借阅情况及归还图书································································· 741
21.7.14 小结··········································································································· 746
第22 章 Internet 编程和Indy 组件······················································································· 747
22.1 WinSock 基础········································································································· 747
22.1.1 TCP、UDP 和IP ························································································· 747
22.1.2 套接字(Socket) ······················································································· 748
22.1.3 客户/服务器模式························································································· 749
22.1.4 面向连接的协议套接字的调用··································································· 750
22.1.5 面向无连接协议的套接字的调用······························································· 750
22.2 利用Winsock API 实现Socket 编程······································································· 751
22.2.1 常用WinSockAPI 函数··············································································· 751
22.2.2 利用WinSockAPI 实现Socket 编程··························································· 754
22.3 利用组件实现Socket 编程····················································································· 762
22.3.1 TClientSocket 组件······················································································ 762
22.3.2 TServerSocket 组件····················································································· 763
22.3.3 Indy 组件介绍····························································································· 764
22.4 编程示例················································································································· 772
22.4.1 远程抓屏示例······························································································ 772
22.4.2 局域网聊天程序·························································································· 780