【正文】
End If End IfIf Text1(5) Label2(5).Caption And Text1(6) Label2(6).Caption Then If txtSQL = select * from student_Form ThentxtSQL = txtSQL amp。 where Format(student_Esd,39。yyyymmdd39。) =39。 amp。 Trim(Text1(5)) amp。 39。and Format(student_Esd,39。yyyymmdd39。) =39。 amp。 Trim(Text1(6)) amp。 39。 ElsetxtSQL = txtSQL amp。 and Format(student_Esd,39。yyyymmdd39。) =39。 amp。 Trim(Text1(5)) amp。 39。and Format(student_Esd,39。yyyymmdd39。) =39。 amp。 Trim(Text1(6)) amp。 39。 End If End If Set mrc = ExecuteSQL(txtSQL, MsgText) j = 1 Do While Not j = j + 1 Loop = True = CInt(0) = CInt(j) Set mrc = ExecuteSQL(txtSQL, MsgText) = True With MSFlexGrid1 .Visible = False .Rows = 1 = .Rows Do While Not .Rows = .Rows + 1 For i = 0 To 1 Select Case (i).Type Case adDBDate.TextMatrix(.Rows 1, i) = Format((i) amp。 , yyyymmdd) Case Else .TextMatrix(.Rows 1, i) = (i) amp。 End Select Next i Loop .Visible = True End With = False TextDcolor Text1(4).Visible = True = False Text1(2).Enabled = False Text1(3).Enabled = False Text1(7).Enabled = False Text1(8).Enabled = FalseEnd SubPrivate Sub Command3_Click() Dim txtSQL As String Dim j As Integer For i = 0 To 7 If i 4 Then If Text1(i) = Label2(i).Caption Then MsgBox 請(qǐng) amp。 Label2(i).Caption amp。 !, vbOKOnly, 提示 Text1(i).SetFocus Exit Sub End If Else If Text1(i) = Label2(i).Caption Then MsgBox 請(qǐng) amp。 Label2(i).Caption amp。 !, vbOKOnly, 提示 Exit Sub End If End If Next If IsDate(Text1(3)) = False Then MsgBox 出生日期應(yīng)為日期格式(yyyymmdd)!, vbOKOnly, 警告 Text1(3).SetFocus Exit Sub End If If IsDate(Text1(6)) = False Then MsgBox 入學(xué)日期應(yīng)為日期格式(yyyymmdd)!, vbOKOnly, 警告 Text1(6).SetFocus Exit Sub End IftxtSQL = delete from student_Form where student_NO=39。 amp。 Trim(Text1(0)) amp。 39。 Set mrc = ExecuteSQL(txtSQL, MsgText) txtSQL = select * from student_Form Set mrc = ExecuteSQL(txtSQL, MsgText) (0) = Trim(Text1(0)) (1) = Trim(Text1(1)) (2) = Trim(Text1(2)) (3) = Trim(Text1(3)) (4) = Trim(Text1(4)) (5) = Trim(Text1(5)) (6) = Trim(Text1(6)) (7) = Trim(Text1(7)) If Text1(8) = Label2(8).Caption Then (8) = Else (8) = Trim(Text1(8)) End If MsgBox 學(xué)籍信息修改成功!, vbOKOnly, 提示 j = 0 For i = 1 To 1 If (i, 0) = Text1(0) Then j = i End If Next If j 0 Then (j, 0) = Trim(Text1(0)) (j, 1) = Trim(Text1(1)) (j, 2) = Trim(Text1(2)) (j, 3) = Trim(Text1(3)) (j, 4) = Trim(Text1(4)) (j, 5) = Trim(Text1(5)) (j, 6) = Trim(Text1(6)) (j, 7) = Trim(Text1(7)) If Text1(8) Label2(8).Caption Then (j, 8) = Trim(Text1(8)) End If End If = j j = 0 TextDcolorEnd SubPrivate Sub Command4_Click() Dim txtSQL As String Dim j As Integer txtSQL = delete from student_Form where student_NO=39。 amp。 Trim(Text1(0)) amp。 39。 Set mrc = ExecuteSQL(txtSQL, MsgText) MsgBox 學(xué)籍信息已經(jīng)刪除!, vbOKOnly, 提示 j = 0 For i = 1 To 1 If (i, 0) = Text1(0) Then j = i End If Next If j 0 Then (j, 0) = 已刪除 (j, 1) = 已刪除 (j, 2) = 已刪除 (j, 3) = 已刪除 (j, 4) = 已刪除 (j, 5) = 已刪除 (j, 6) = 已刪除 (j, 7) = 已刪除 (j, 8) = 已刪除 End If j = 0 TextDcolor Text1(1).Enabled = False Text1(2).Enabled = False Text1(3).Enabled = False = False Text1(4).Enabled = False Text1(5).Enabled = False Text1(6).Enabled = False Text1(7).Enabled = False Text1(8).Enabled = FalseEnd SubPrivate Sub Command5_Click() TextDcolor If Label1(1).BackColor = amp。HFFFFFF Then ShowTitle Text1(4).Visible = True = False Text1(2).Enabled = False Text1(3).Enabled = False Text1(7).Enabled = False Text1(8).Enabled = False End If If Label1(3).BackColor = amp。HFFFFFF Then Text1(1).Enabled = False Text1(2).Enabled = False Text1(3).Enabled = False = False Text1(4).Enabled = False Text1(5).Enabled = False Text1(6).Enabled = False Text1(7).Enabled = False Text1(8).Enabled = False End IfEnd SubPrivate Sub Form_Load() :Dim mrc As Dim MsgText As StringPrivate Sub Combo1_Click() List1TextEnd SubPrivate Sub Command1_Click() Dim txtSQL As String If Text1(0) = Then MsgBox 課程名稱不能為空!, vbOKOnly, 提示 Text1(0).SetFocus Exit Sub End IftxtSQL = select * from course_Form where course_Name=39。 amp。 Trim(Text1(0)) amp。 39。 Set mrc = ExecuteSQL(txtSQL, MsgText) If = False Then MsgBox 此課程名稱已經(jīng)存在!, vbOKOnly, 警告 Text1(0).SetFocus Exit Sub End If txtSQL = select * from course_Form Set mrc = ExecuteSQL(txtSQL, MsgText) (0) = Trim(Text1(0)) (1) = Trim(Text1(1)) Text1(0) = Text1(1) = MsgBox 課程信息添加成功!, vbOKOnly, 提示 List2TextEnd SubPrivate Sub Command2_Click() Dim txtSQL As String If Then txtSQL = delete from course_Form where course_Name=39。 amp。 Trim() amp。 39。 Set mrc = ExecuteSQL(txtSQL, MsgText