“数据库管理软件的开发”教学课件1.ppt
文本预览下载声明
数据库软件管理的开发
Evaluation only.
Created with Aspose.Slides for .NET 3.5 Client Profile .
Copyright 2004-2011 Aspose Pty Ltd.
数据库
服务器
应用
界面
VB应用程序
SQL Server
数据库访问接口
VB数据库访问控件
数据库应用系统结构
Evaluation only.
Created with Aspose.Slides for .NET 3.5 Client Profile .
Copyright 2004-2011 Aspose Pty Ltd.
案例—教务管理系统的开发
实例目标
首先创建一个名为“教务”的数据库,然后使用Vb程序浏览和访问数据库。
技术要点
静态查询和SQL语言的使用;
使用ToolBar和ImageList控件制作工具栏。
Evaluation only.
Created with Aspose.Slides for .NET 3.5 Client Profile .
Copyright 2004-2011 Aspose Pty Ltd.
实现步骤
创建数据库
创建主窗体
添加工具栏按钮控件:ToolBar和ImageList控件
添加数据库连接控件
添加数据显示控件
编写代码
Evaluation only.
Created with Aspose.Slides for .NET 3.5 Client Profile .
Copyright 2004-2011 Aspose Pty Ltd.
建立教务数据库
Evaluation only.
Created with Aspose.Slides for .NET 3.5 Client Profile .
Copyright 2004-2011 Aspose Pty Ltd.
创建登陆模块
Private Sub Command1_Click()
Ad1.RecordSource = team: Ad1.Refresh
Ad1.Recordset.MoveFirst
Ad1.Recordset.find 姓名= + Text1.Text +
If Ad1.Recordset.EOF Then
x = MsgBox(没有该用户,重新输入吗?, vbYesNo, 错误!)
If x = vbYes Then Exit Sub Else End
End If
If Ad1.Recordset.Fields(1) = Text2.Text Then Unload Form1: Form2.Show: Exit Sub
x = MsgBox(密码错误,重新输入吗?, vbYesNo, 错误!)
If x = vbYes Then Exit Sub Else End
End Sub
Evaluation only.
Created with Aspose.Slides for .NET 3.5 Client Profile .
Copyright 2004-2011 Aspose Pty Ltd.
创建主窗体
Evaluation only.
Created with Aspose.Slides for .NET 3.5 Client Profile .
Copyright 2004-2011 Aspose Pty Ltd.
首先添加ToolBar和ImageList控件到工具箱;
步骤:
1.工程/部件?选“Microsoft Windows Common Control 6.0”
2. ToolBar控件包含用来创建工具栏的按钮对象集合;
ToolBar可以拥有文本和相关联的ImageList提供的图像;
创建工具栏
Evaluation only.
Created with Aspose.Slides for .NET 3.5 Client Profile .
Copyright 2004-2011 Aspose Pty Ltd.
3.ImageList控件的属性创中选择图像标签;
4.设置按钮属性:索引(1),标题(第一个),关键字(First),样式(0-tbrDefault),工具提示文本(单击此按钮查看第一个记录),图像(1)。
5.根据题意添加8个按钮
创建工具栏
Evaluation only.
Created with Aspose.Slides for .NET 3.5 Client Profile .
Copyright 2004-2011 Aspose Pty Ltd.
在ImageList控件中添加图象
ImageList控件不单独使用,专门为其它控件提供图像库。
索
显示全部