VB+SQL server学生信息管理系统毕业论文附源代码 第23页
mrc.Delete
txtSQL = "select * from class_Info where class_No = '" & Trim(txtClassno.Text) & "'"
Set mrcc = ExecuteSQL(txtSQL, MsgText)
If mrcc.EOF = False Then
MsgBox "班号重复,请重新输入!", vbOKOnly + vbExclamation, "警告"
mrcc.Close
txtClassno.SetFocus
Else
mrcc.Close
mrc.AddNew
mrc.Fields(0) = Trim(txtClassno.Text)
mrc.Fields(1) = Trim(comboGrade.Text)
mrc.Fields(2) = Trim(txtDirector.Text)
mrc.Fields(3) = Trim(txtClassroom.Text)
mrc.Update
MsgBox "修改班级信息成功!", vbOKOnly + vbExclamation, "警告"
mrc.Bookmark = myBookmark
Call viewData
Frame2.Enabled = True
firstCommand.Enabled = True
previousCommand.Enabled = True
nextCommand.Enabled = True
lastCommand.Enabled = True
txtClassno.Enabled = False
comboGrade.Enabled = False
txtDirector.Enabled = False
txtClassroom.Enabled = False
mcclean = True
End If
End Sub
.........................................................................................................
......................... frmModifycourseinfo 修改课程信息窗口代码 ...............................
Dim mrc As ADODB.Recordset
Dim myBookmark As Variant
Dim mcclean As Boolean
Private Sub cancelCommand_Click()
If Not mcclean Then
Frame2.Enabled = True
firstCommand.Enabled = True
previousCommand.Enabled = True
nextCommand.Enabled = True
lastCommand.Enabled = True
txtCourseno.Enabled = False
txtCoursename.Enabled = False
comboCoursetype.Enabled = False
txtCoursedes.Enabled = False
mrc.Bookmark = myBookmark
Call viewData
Else
MsgBox "什么都没有修改,有什么好取消的!", vbOKOnly + vbExclamation, "警告"
End If
End Sub
Private Sub deleteCommand_Click()
myBookmark = mrc.Bookmark
str2$ = MsgBox("是否删除当前记录?", vbOKCancel, "删除当前记录")
If str2$ = vbOK Then
mrc.MoveNext
If mrc.EOF Then
mrc.MoveFirst
myBookmark = mrc.Bookmark
mrc.MoveLast
mrc.Delete
mrc.Bookmark = myBookmark
Call viewData
Else
myBookmark = mrc.Bookmark
mrc.MovePrevious
mrc.Delete
mrc.Bookmark = myBookmark
Call viewData
End If
Else
mrc.Bookmark = myBookmark
Call viewData
End If
End Sub
Private Sub editCommand_Click()
mcclean = False
Frame2.Enabled = False
firstCommand.Enabled = False
previousCommand.Enabled = False
nextCommand.Enabled = False
lastCommand.Enabled = False
txtCourseno.Enabled = True
txtCoursename.Enabled = True
comboCoursetype.Enabled = True
txtCoursedes.Enabled = True
comboCoursetype.AddItem "必修"
comboCoursetype.AddItem "考查"
myBookmark = mrc.Bookmark
End Sub
Private Sub firstCommand_Click()
mrc.MoveFirst
Call viewData
End Sub
Private Sub Form_Load()
Dim txtSQL As String
Dim MsgText As String
txtCourseno.Enabled = False
txtCoursename.Enabled = False
comboCoursetype.Enabled = False
txtCoursedes.Enabled = False
txtSQL = "select * from course_Info "
Set mrc = ExecuteSQL(txtSQL, MsgText)
mrc.MoveFirst
Call viewData
myBookmark = mrc.Bookmark
mcclean = True
End Sub
<< 上一页 [21] [22] [23] [24] [25] [26] [27] [28] [29] 下一页