⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 系统维护.frm

📁 学生教材管理系统:对学校书库进销存进行管理的系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            TabIndex        =   21
            Top             =   3360
            Width           =   540
         End
      End
   End
End
Attribute VB_Name = "系统维护"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
    'On Error Resume Next
    Dim i
    Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=学生教材管理系统.mdb;Persist Security Info=False"
    If Check8.Value = 1 Then
        Adodc2.RecordSource = "select * from 学生选修课教材情况表"
        Set Text2.DataSource = Adodc2
        Text2.DataField = "xh"
        Adodc2.Refresh
        Adodc2.Recordset.MoveFirst
        Do While Not Adodc2.Recordset.EOF
            For i = 4 To 8
               Adodc2.Recordset.Fields(i) = ""
            Next
            Adodc2.Recordset.Fields(9) = 0
            Adodc2.Recordset.Fields(10) = "否"
            Adodc2.Recordset.Fields(11) = ""
            Adodc2.Recordset.Update
            Adodc2.Recordset.MoveNext
        Loop
    End If
    If Check7.Value = 1 Then
        Adodc2.RecordSource = "select * from 学生专业课教材情况表"
        Set Text2.DataSource = Adodc2
        Text2.DataField = "xh"
        Adodc2.Refresh
        Adodc2.Recordset.MoveFirst
        Do While Not Adodc2.Recordset.EOF
            For i = 4 To 13
               Adodc2.Recordset.Fields(i) = ""
            Next
            Adodc2.Recordset.Fields(14) = 0
            Adodc2.Recordset.Fields(15) = "是"
            Adodc2.Recordset.Fields(16) = ""
            Adodc2.Recordset.Update
            Adodc2.Recordset.MoveNext
        Loop
    End If
    
End Sub

Private Sub Command2_Click()
'Dim aa As Integer
'On Error Resume Next
    
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    Dim cnn As ADODB.Connection
    Set cnn = New ADODB.Connection
    cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=学生教材管理系统.mdb;Persist Security Info=False"
    Dim sql As String
    Dim i
    Dim jb
    sql = "select * from 学生基本情况表"
    Set rs = cnn.Execute(sql)
If Check9 = 2 And Check10 = 2 Or Check9 = 0 And Check10 = 0 Then
    Label1.Caption = "数据正在导入..."
    If Check1.Value = 1 Then
        rs.MoveFirst
        Adodc1.RecordSource = "select * from 学生专业课教材情况表"
        Set Text1.DataSource = Adodc1
        Text1.DataField = "xm"
        Adodc1.Refresh
        If Adodc1.Recordset.RecordCount = 0 Then
        Do While Not rs.EOF
            Adodc1.Recordset.AddNew
            Adodc1.Recordset.Fields("xm") = rs.Fields("xm")
            Adodc1.Recordset.Fields("xh") = rs.Fields("xh")
            Adodc1.Recordset.Fields("xi") = rs.Fields("xi")
            Adodc1.Recordset.Fields("bj") = rs.Fields("bj")
            Adodc1.Recordset.Update
            'Adodc1.Refresh
            rs.MoveNext
        Loop
        Else
             MsgBox "学生专业课教材情况表中已有数据!请选添加新生记录!", vbOKOnly + vbInformation
        End If
    End If
    If Check2.Value = 1 Then
        rs.MoveFirst
        Adodc1.RecordSource = "select * from 学生专业课教材费支出情况表"
        Set Text1.DataSource = Adodc1
        Text1.DataField = "xm"
        Adodc1.Refresh
        If Adodc1.Recordset.RecordCount = 0 Then
        Do While Not rs.EOF
            Adodc1.Recordset.AddNew
            Adodc1.Recordset.Fields("xm") = rs.Fields("xm")
            Adodc1.Recordset.Fields("xh") = rs.Fields("xh")
            Adodc1.Recordset.Fields("xi") = rs.Fields("xi")
            Adodc1.Recordset.Fields("bj") = rs.Fields("bj")
            Adodc1.Recordset.Update
            rs.MoveNext
        Loop
        Else
             MsgBox "学生专业课教材费支出情况表中已有数据!请选添加新生记录!", vbOKOnly + vbInformation
        End If
    End If
    If Check3.Value = 1 Then
        rs.MoveFirst
        Adodc1.RecordSource = "select * from 学生选修课教材情况表"
        Set Text1.DataSource = Adodc1
        Text1.DataField = "xm"
        Adodc1.Refresh
        If Adodc1.Recordset.RecordCount = 0 Then
        Do While Not rs.EOF
            Adodc1.Recordset.AddNew
            Adodc1.Recordset.Fields("xm") = rs.Fields("xm")
            Adodc1.Recordset.Fields("xh") = rs.Fields("xh")
            Adodc1.Recordset.Fields("xi") = rs.Fields("xi")
            Adodc1.Recordset.Fields("bj") = rs.Fields("bj")
            Adodc1.Recordset.Update
            rs.MoveNext
        Loop
        Else
             MsgBox "学生选修课教材情况表中已有数据!请选添加新生记录!", vbOKOnly + vbInformation
        End If
    End If
    If Check4.Value = 1 Then
        rs.MoveFirst
        Adodc1.RecordSource = "select * from 学生选修课教材费支出情况表"
        Set Text1.DataSource = Adodc1
        Text1.DataField = "xm"
        Adodc1.Refresh
        If Adodc1.Recordset.RecordCount = 0 Then
        Do While Not rs.EOF
            Adodc1.Recordset.AddNew
            Adodc1.Recordset.Fields("xm") = rs.Fields("xm")
            Adodc1.Recordset.Fields("xh") = rs.Fields("xh")
            Adodc1.Recordset.Fields("xi") = rs.Fields("xi")
            Adodc1.Recordset.Fields("bj") = rs.Fields("bj")
            Adodc1.Recordset.Update
            rs.MoveNext
        Loop
        Else
             MsgBox "学生选修课教材费支出情况表中已有数据!请选添加新生记录!", vbOKOnly + vbInformation
        End If
    End If
   If Check5.Value = 1 Then
        rs.MoveFirst
        Adodc1.RecordSource = "select * from 学生收费表"
        Set Text1.DataSource = Adodc1
        Text1.DataField = "xm"
        Adodc1.Refresh
        If Adodc1.Recordset.RecordCount = 0 Then
        Do While Not rs.EOF
            Adodc1.Recordset.AddNew
            Adodc1.Recordset.Fields("xm") = rs.Fields("xm")
            Adodc1.Recordset.Fields("xh") = rs.Fields("xh")
            Adodc1.Recordset.Fields("xi") = rs.Fields("xi")
            Adodc1.Recordset.Fields("bj") = rs.Fields("bj")
            Adodc1.Recordset.Update
            rs.MoveNext
        Loop
        Else
            MsgBox "学生收费表中已有数据!请选添加新生记录!", vbOKOnly + vbInformation
        End If
    End If
    If Check6.Value = 1 Then
        rs.MoveFirst
        Adodc1.RecordSource = "select * from 学生教材费支出总表"
        Set Text1.DataSource = Adodc1
        Text1.DataField = "xm"
        Adodc1.Refresh
        If Adodc1.Recordset.RecordCount = 0 Then
        Do While Not rs.EOF
            Adodc1.Recordset.AddNew
            Adodc1.Recordset.Fields("xm") = rs.Fields("xm")
            Adodc1.Recordset.Fields("xh") = rs.Fields("xh")
            Adodc1.Recordset.Fields("xi") = rs.Fields("xi")
            Adodc1.Recordset.Fields("bj") = rs.Fields("bj")
            Adodc1.Recordset.Update
            rs.MoveNext
        Loop
        Else
             MsgBox "学生教材费支出总表中已有数据!请选添加新生记录!", vbOKOnly + vbInformation
        End If
    End If
    Check9.Value = 0
    Check10.Value = 0
    Label1.Caption = "导入完毕!"
End If
If Check10 = 1 Then
    Label1.Caption = "数据正在导入..."
    jb = Mid$(Year(Date), 3, 2)
    Adodc3.RecordSource = "select * from 学生基本情况表 where xh like '" & jb & "%'"
    Adodc3.Refresh
    If Adodc3.Recordset.RecordCount = 0 Then
        Label1.Caption = "学生表中无新生记录!"
    Else
    Adodc1.RecordSource = "select * from 学生专业课教材情况表"
    Adodc1.Refresh
    Adodc1.Recordset.Find "xh like '" & jb & "%'"
    If Not Adodc1.Recordset.EOF Then
        Label1.Caption = "以上表中已添加新生记录!"
    Else
    If Check1.Value = 1 Then
        Adodc3.Recordset.MoveFirst
        Adodc1.RecordSource = "select * from 学生专业课教材情况表"
        Adodc1.Refresh
        Do While Not Adodc3.Recordset.EOF
            Adodc1.Recordset.AddNew
            Adodc1.Recordset.Fields("xm") = Adodc3.Recordset.Fields("xm")
            Adodc1.Recordset.Fields("xh") = Adodc3.Recordset.Fields("xh")
            Adodc1.Recordset.Fields("xi") = Adodc3.Recordset.Fields("xi")
            Adodc1.Recordset.Fields("bj") = Adodc3.Recordset.Fields("bj")
            Adodc1.Recordset.Update
            Adodc3.Recordset.MoveNext
        Loop
    End If
    If Check2.Value = 1 Then
        Adodc3.Recordset.MoveFirst
        Adodc1.RecordSource = "select * from 学生专业课教材费支出情况表"
        Adodc1.Refresh
        Do While Not Adodc3.Recordset.EOF
            Adodc1.Recordset.AddNew
            Adodc1.Recordset.Fields("xm") = Adodc3.Recordset.Fields("xm")
            Adodc1.Recordset.Fields("xh") = Adodc3.Recordset.Fields("xh")
            Adodc1.Recordset.Fields("xi") = Adodc3.Recordset.Fields("xi")
            Adodc1.Recordset.Fields("bj") = Adodc3.Recordset.Fields("bj")
            Adodc1.Recordset.Update
            Adodc3.Recordset.MoveNext
        Loop
    End If
    If Check3.Value = 1 Then
        Adodc3.Recordset.MoveFirst
        Adodc1.RecordSource = "select * from 学生选修课教材情况表"
        Adodc1.Refresh
        Do While Not Adodc3.Recordset.EOF
            Adodc1.Recordset.AddNew
            Adodc1.Recordset.Fields("xm") = Adodc3.Recordset.Fields("xm")
            Adodc1.Recordset.Fields("xh") = Adodc3.Recordset.Fields("xh")
            Adodc1.Recordset.Fields("xi") = Adodc3.Recordset.Fields("xi")
            Adodc1.Recordset.Fields("bj") = Adodc3.Recordset.Fields("bj")
            Adodc1.Recordset.Update
            Adodc3.Recordset.MoveNext
        Loop
    End If
    If Check4.Value = 1 Then
        Adodc3.Recordset.MoveFirst
        Adodc1.RecordSource = "select * from 学生选修课教材费支出情况表"
        Adodc1.Refresh
        Do While Not Adodc3.Recordset.EOF
            Adodc1.Recordset.AddNew
            Adodc1.Recordset.Fields("xm") = Adodc3.Recordset.Fields("xm")
            Adodc1.Recordset.Fields("xh") = Adodc3.Recordset.Fields("xh")
            Adodc1.Recordset.Fields("xi") = Adodc3.Recordset.Fields("xi")
            Adodc1.Recordset.Fields("bj") = Adodc3.Recordset.Fields("bj")
            Adodc1.Recordset.Update
            Adodc3.Recordset.MoveNext
        Loop
    End If
    If Check5.Value = 1 Then
        Adodc3.Recordset.MoveFirst
        Adodc1.RecordSource = "select * from 学生收费表"
        Adodc1.Refresh
        Do While Not Adodc3.Recordset.EOF
            Adodc1.Recordset.AddNew
            Adodc1.Recordset.Fields("xm") = Adodc3.Recordset.Fields("xm")
            Adodc1.Recordset.Fields("xh") = Adodc3.Recordset.Fields("xh")
            Adodc1.Recordset.Fields("xi") = Adodc3.Recordset.Fields("xi")
            Adodc1.Recordset.Fields("bj") = Adodc3.Recordset.Fields("bj")
            Adodc1.Recordset.Update
            Adodc3.Recordset.MoveNext
        Loop
    End If
    If Check6.Value = 1 Then
        Adodc3.Recordset.MoveFirst
        Adodc1.RecordSource = "select * from 学生教材费支出总表"
        Adodc1.Refresh
        Do While Not Adodc3.Recordset.EOF
            Adodc1.Recordset.AddNew
            Adodc1.Recordset.Fields("xm") = Adodc3.Recordset.Fields("xm")
            Adodc1.Recordset.Fields("xh") = Adodc3.Recordset.Fields("xh")
            Adodc1.Recordset.Fields("xi") = Adodc3.Recordset.Fields("xi")
            Adodc1.Recordset.Fields("bj") = Adodc3.Recordset.Fields("bj")
            Adodc1.Recordset.Update
            Adodc3.Recordset.MoveNext
        Loop
    End If
    Label1.Caption = "导入完毕!"
    End If
    End If
End If
If Check9 = 1 Then
    Label1.Caption = "数据正在删除..."
    jb = Mid(Year(Date) - 4, 3, 2)
    

    If Check1.Value = 1 Then
        sql = "delete from 学生专业课教材情况表 where xh like '" & jb & "%' "
        Set rs = cnn.Execute(sql)
    End If
    If Check2.Value = 1 Then
        sql = "delete from 学生专业课教材费支出情况表 where xh like '" & jb & "%' "
        Set rs = cnn.Execute(sql)
    End If
    If Check3.Value = 1 Then
        sql = "delete from 学生选修课教材情况表 where xh like '" & jb & "%' "
        Set rs = cnn.Execute(sql)
    End If
    If Check4.Value = 1 Then
        sql = "delete from 学生选修课教材费支出情况表 where xh like '" & jb & "%' "
        Set rs = cnn.Execute(sql)
    End If
    If Check5.Value = 1 Then
        sql = "delete from 学生收费表 where xh like '" & jb & "%' "
        Set rs = cnn.Execute(sql)
    End If
    If Check6.Value = 1 Then
        sql = "delete from 学生教材费支出总表 where xh like '" & jb & "%' "
        Set rs = cnn.Execute(sql)
    End If
    cnn.Close
    Label1.Caption = "删除完毕!"
End If
End Sub

Private Sub Command3_Click()
    Unload Me
End Sub

Private Sub Command4_Click()
    Unload Me
End Sub

Private Sub Form_Activate()
    Adodc1.RecordSource = "select * from 学生专业课教材情况表"
    Set Text1.DataSource = Adodc1
    Text1.DataField = "xm"
    Adodc1.Refresh
    If Adodc1.Recordset.RecordCount = 0 Then
        Label1.Caption = "请点‘确定’导入数据"
        Check9.Value = 2
        Check10.Value = 2
    Else
        Label1.Caption = "请添加新生记录或删除老生记录!"
        
    End If
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -