毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

期末考试日程管理系统 第8页

更新时间:2009-8-4:  来源:毕业论文
期末考试日程管理系统 第8页
If Grid1.Cell(i, 1).Text = Grid1.Cell(j, 1).Text And Grid1.Cell(i, 2).Text = Grid1.Cell(j, 2).Text And Grid1.Cell(i, 3).Text = Grid1.Cell(j, 3).Text Then
  MsgBox "第" & i & "行与" & j & "行的数据出现重复,请修改!", vbInformation, "重复错误"
  m = i
  n = j
  gcolor1 = Grid1.Cell(m, 1).BackColor
  gcolor2 = Grid1.Cell(n, 1).BackColor
  Grid1.Range(i, 1, i, 4).BackColor = RGB(90, 158, 214)
  Grid1.Range(j, 1, j, 4).BackColor = RGB(90, 158, 214)
  Exit Sub
  End If
  End If
 Next
Next
For i = 1 To Grid1.Rows - 1
 For j = 1 To Grid1.Cols - 1
 If Grid1.Cell(i, 1).Text <> "" Then
   If Grid1.Cell(i, j).Text = "" Then
   MsgBox "第" & i & "行的数据请填完整!", vbInformation, "错误提示"
   Grid1.Cell(i, j).SetFocus
   Exit Sub
   End If
 Else
 Exit For
 End If
 Next
Next
For i = 1 To Grid1.Rows - 1
If Grid1.Cell(i, 1).Text <> "" Then
Set ks1 = cnn.Execute("select * from 课程 where 系名='" & Grid1.Cell(i, 1).Text & "' and 年级='" & Grid1.Cell(i, 2).Text & "' and 课程名='" & Grid1.Cell(i, 3).Text & "'")
If ks1.EOF = True Then
Set ks2 = cnn.Execute("insert into 课程 values('" & Grid1.Cell(i, 1).Text & "','" & Grid1.Cell(i, 2).Text & "','" & Grid1.Cell(i, 3).Text & "','" & Grid1.Cell(i, 4).Text & "')")
Else
MsgBox "第" & i & "行的数据已经存在,系统自动跳过!", vbInformation, "提示"
End If
End If
Next
MsgBox "资料已保存!", vbInformation, "完成"
Call callmain
Exit Sub
finish:
MsgBox Err.Description
End Sub

End If
If hang = 0 Then
Exit Sub
End If
If Grid1.Cell(hang, 1).Text = "" Then
Exit Sub
End If
Set ks1 = cnn.Execute("delete from " & kstable & " where " & ks1.Fields(0).Name & "='" & Grid1.Cell(hang, 1).Text & "' and " & ks1.Fields(1).Name & "='" & Grid1.Cell(hang, 2).Text & "' and " & ks1.Fields(2).Name & "='" & Grid1.Cell(hang, 3).Text & "'")
MsgBox "目标己删除,请刷新数据!", vbInformation, "删除成功"
Call callmain
Exit Sub
finish:
MsgBox Err.Description
End Sub

Private Sub XPButton5_Click()
Unload Me
End Sub
Dim i As Integer
Private Declare Function GetKeyState Lib "user32" _
   (ByVal nVirtKey As Long) As Integer
Dim gcolor1, gcolor2 As String
Dim m, n As Integer

Private Sub Form_Load()
Grid1.SetRegisterInformation "CNwinndy", "W]vyY-nonvk-u\nty-Zbl_e-`hms^" '进行注册
With Grid1
    .AllowUserResizing = True
    .DisplayFocusRect = False
    .ExtendLastCol = True
    .Appearance = Flat
    .FixedRowColStyle = Flat
    .ScrollBarStyle = Flat
   
    .DefaultFont.Name = "Tahoma"
    .DefaultFont.SIZE = 8
 BackColor1 = RGB(231, 235, 247)
    .BackColor2 = RGB(239, 243, 255)
    .GridColor = RGB(148, 190, 231)
    .Column(0).Width = 0
    .Column(1).Width = 100
    .Column(2).Width = 60
    .Column(3).Width = 60
    .Column(4).Width = 60
End With
Me.BackColor = RGB(84, 201, 134)
kstable = "教室"
Call callmain
End Sub
Private Sub callmain()
kssave = False
ksedit = True
ksdel = True
Set ks1 = cnn.Execute("select * from " & kstable)
Grid1.Rows = 1 '清除所有记录
i = 4
Grid1.Cols = i + 1 '必须+1,因为实际上为4行,但第一行是隐藏的
For i = 0 To i - 1  '显示数据的字段名
Grid1.Cell(0, i + 1).Text = ks1.Fields(i).Name  '读取表中的各字段名
Next
n = i
i = 1
Do While Not ks1.EOF
 Grid1.Rows = Grid1.Rows + 1
 For j = 1 To n '设定读取列
 If ks1.Fields(j - 1) = Null Then '空值的处理
 Grid1.Cell(i, j).Text = ""
 Else
 Grid1.Cell(i, j).Text = ks1.Fields(j - 1)
 End If
 Next
  i = i + 1
 ks1.MoveNext '读取下一记录
Loop
Grid1.Column(1).Locked = True
End Sub
Private Sub XPButton3_Click()
If ksedit = False Then
MsgBox "当前修改操作不被允许!", vbInformation, "非使用对象"
Exit Sub
End If
Next
MsgBox "已完成修改!", vbInformation, "操作完成"
End Sub

Private Sub XPButton4_Click()
If ksdel = False Then
MsgBox "当前删除操作不被允许!", vbInformation, "非使用对象"
Exit Sub
End If
If hang = 0 Then
Exit Sub
End If
www.751com.cn
Unload Me
End Sub
Dim i As Integer
Private Declare Function GetKeyState Lib "user32" _
   (ByVal nVirtKey As Long) As Integer
Dim gcolor1, gcolor2 As String
Dim m, n As Integer

Private Sub Form_Load()
Grid1.SetRegisterInformation "CNwinndy", "W]vyY-nonvk-u\nty-Zbl_e-`hms^" '进行注册
With Grid1
    .AllowUserResizing = True
    .DisplayFocusRect = False
    .ExtendLastCol = True
    .Appearance = Flat
    .FixedRowColStyle = Flat
    .ScrollBarStyle = Flat
    .BackColor1 = RGB(231, 235, 247)

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页

期末考试日程管理系统 第8页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。