【正文】
1(0).SetFocus Exit Sub End If txSQL = select * from 學(xué)生信息表 txSQL, conn, adOpenStatic, adLockPessimistic (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) = Label3(8).Caption Then (8) = Else (8) = Trim(Text1(8)) End If MsgBox 學(xué)籍信息添加成功!, vbOKOnly, 提示 With MSFlexGrid1 .Rows = .Rows + 1 .TextMatrix(.Rows 1, 0) = Trim(Text1(0)) .TextMatrix(.Rows 1, 1) = Trim(Text1(1)) .TextMatrix(.Rows 1, 2) = Trim(Text1(2)) .TextMatrix(.Rows 1, 3) = Trim(Text1(3)) .TextMatrix(.Rows 1, 4) = Trim(Text1(4)) .TextMatrix(.Rows 1, 5) = Trim(Text1(5)) .TextMatrix(.Rows 1, 6) = Trim(Text1(6)) .TextMatrix(.Rows 1, 7) = Trim(Text1(7)) If Text1(8) Label3(8).Caption Then .TextMatrix(.Rows 1, 8) = Trim(Text1(8)) End If End With = 1 TextDcolorEnd SubPrivate Sub Command2_Click() Dim j As Integer If Text1(5) Label3(5).Caption Then If IsDate(Text1(5)) = False Then MsgBox 出生日期應(yīng)為日期格式(yyyymmdd)!, vbOKOnly, 警告 Text1(5).SetFocus Exit Sub Else Text1(5) = Format(Text1(5), yyyymmdd) End If End If txSQL = select * from 學(xué)生信息表 If Text1(0) Label3(0).Caption Then txSQL = txSQL amp。 where 學(xué)號(hào)=39。 amp。 Trim(Text1(0)) amp。 39。 End If If Text1(1) Label3(1).Caption Then If txSQL = select * from 學(xué)生信息表 Then txSQL = txSQL amp。 where 姓名=39。 amp。 Trim(Text1(1)) amp。 39。 Else txSQL = txSQL amp。 and 姓名=39。 amp。 Trim(Text1(1)) amp。 39。 End If End If If Text1(4) Label3(4).Caption Then If txSQL = select * from 學(xué)生信息表 Then txSQL = txSQL amp。 where 班級(jí)=39。 amp。 Trim(Text1(4)) amp。 39。 Else txtQL = txSQL amp。 and 班級(jí)=39。 amp。 Trim(Text1(4)) amp。 39。 End If End If Set mrcc = New = provider=。 amp。 data source= amp。 amp。 /Data/ txSQL, conn, adOpenStatic, adLockPessimistic j = 1 Do While Not j = j + 1 Loop = True = CInt(0) = CInt(j) txSQL, conn, adOpenStatic, adLockPessimistic = 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(5).Enabled = False Text1(6).Enabled = False Text1(7).Enabled = False Text1(8).Enabled = FalseEnd SubPrivate Sub Command3_Click() Dim j As Integer For i = 0 To 7 If i 4 Then If Text1(i) = Label3(i).Caption Then MsgBox 請(qǐng) amp。 Label3(i).Caption amp。 !, vbOKOnly, 提示 Text1(i).SetFocus Exit Sub End If Else If Text1(i) = Label3(i).Caption Then MsgBox 請(qǐng) amp。 Label3(i).Caption amp。 !, vbOKOnly, 提示 Exit Sub End If End If Next If IsDate(Text1(5)) = False Then MsgBox 出生日期應(yīng)為日期格式(yyyymmdd)!, vbOKOnly, 警告 Text1(3).SetFocus Exit Sub End If txSQL = delete from 學(xué)生信息表 where 學(xué)號(hào)=39。 amp。 Trim(Text1(0)) amp。 39。 Set mrcc = New = provider=。 amp。 data source= amp。 amp。 /Data/ txSQL, conn, adOpenStatic, adLockPessimistic txSQL = select * from 學(xué)生信息表 txSQL, conn, adOpenStatic, adLockPessimistic (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) = Label3(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) Label3(8).Caption Then (j, 8) = Trim(Text1(8)) End If End If = j j = 0 TextDcolorEnd SubPrivate Sub Command4_Click() Dim j As Integer txSQL = delete from 學(xué)生信息表 where 學(xué)號(hào)=39。 amp。 Trim(Text1(0)) amp。 39。 Set mrcc = New = provider=。 amp。 data source= amp。 amp。 /Data/ txSQL, conn, adOpenStatic, adLockPessimistic 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 Tex