石家庄经济学院职业技术学院毕业设计(论文)
Set DataGrid1.DataSource = Adodc2 Text2.Text = \ Text2.SetFocus Else
MsgBox \对不起,没有你所要查询的信息!\信息提示!\ Text2.Text = \ Text2.SetFocus End If End Sub
Private Sub Image1_Click() End Sub
2.可以查询所有的系部的编号和名称。
如下是实现此窗体的源代码
Dim x As String
Private Sub Command2_Click()
If Adodc1.Recordset.RecordCount > 0 Then
x = MsgBox(\是否删除此记录?\信息提示!\ If x = 6 Then
Adodc1.Recordset.Delete Adodc1.Recordset.MovePrevious
MsgBox \删除成功,请返回!\提示!\ Else
- 31 -
石家庄经济学院职业技术学院毕业设计(论文)
MsgBox \对不起,没有信息可供删除!\警告\ End If End If End Sub
Private Sub Command3_Click() If Command3.Caption = \添 加\ Command3.Caption = \确认添加\ Text1.SetFocus
x = MsgBox(\确认要添加吗?\信息提示!\ If x = vbYes Then
Adodc1.Recordset.AddNew Else
Command3.Caption = \添 加\ End If Else
Command3.Caption = \确认添加\ Adodc1.Recordset.Update
MsgBox \添加成功\信息提示!\ Command3.Caption = \添 加\End If End Sub
3.可以对学生的成绩进行删除、刷新、修改、添加。
- 32 -
石家庄经济学院职业技术学院毕业设计(论文)
如下是实现此功能的源代码
Dim sj As String
Private Sub Command1_Click()
If Option1(0).Value = False And Option1(1).Value = False And Option1(2).Value = False And Option1(3).Value = False And Option1(4).Value = False And Option1(5).Value = False Then
MsgBox \请先选择查询条件!\信息提示!\ Option1(0).Value = True Text2.SetFocus Exit Sub Else
If Text2.Text <> \
If Option1(0).Value = True Then
sj = \ End If
If Option1(1).Value = True Then
sj = \ End If
If Option1(2).Value = True Then
sj = \ End If
If Option1(3).Value = True Then
sj = \ End If
If Option1(4).Value = True Then
sj = \ End If
If Option1(5).Value = True Then
sj = \ End If Else
- 33 -
石家庄经济学院职业技术学院毕业设计(论文)
MsgBox \请输入查询关键词!\信息提示!\ Text2.SetFocus Exit Sub End If End If
Adodc2.RecordSource = sj Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then Set DataGrid1.DataSource = Adodc2 Text2.Text = \ Text2.SetFocus Else
MsgBox \对不起,没有你所要查询的信息!\信息提示!\ Text2.Text = \ Text2.SetFocus End If End Sub
4.可以对课程信息的浏览和查询
如下是实现此窗体功能的源代码
Private Sub Command1_Click()
- 34 -
石家庄经济学院职业技术学院毕业设计(论文)
If Command1.Caption = \添 加\
If MsgBox(\添加新记录?\信息提示!\ Adodc1.Recordset.AddNew Command1.Caption = \确认添加\ Text1(0).SetFocus End If Else
Adodc1.Recordset.Update Adodc1.Recordset.MoveLast Adodc1.Recordset.Update
MsgBox \添加成功!\信息提示!\ Command1.Caption = \添 加\End If End Sub
Private Sub Command2_Click()
If MsgBox(\真的要删除吗?\警告\ Adodc1.Recordset.Delete
MsgBox \删除成功,请返回!\提示!\ Adodc1.Recordset.MoveNext If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveFirst End If End If End Sub
Private Sub Command3_Click() Adodc1.Refresh
Adodc1.Recordset.MoveFirst End Sub
- 35 -
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库学生信息管理系统论文 最终版 - 图文(7)在线全文阅读。
相关推荐: