Teacher on duty for the first computer room charging system

For other forms, the form "Teacher on Duty" is relatively simple, just connect this form to the OnWork table.

'添加表头
    With MSHFlexGrid1
        .CellAlignment = 4 '表格居中对齐
        .TextMatrix(0, 0) = "记录号"
        .TextMatrix(0, 1) = "教师"
        .TextMatrix(0, 2) = "级别"
        .TextMatrix(0, 3) = "登录日期"
        .TextMatrix(0, 4) = "登录时间"
        .TextMatrix(0, 5) = "机器名"
    End With
    
    Dim txtSQL As String
    Dim mrc As ADODB.Recordset
    Dim Msgtext As String
    
    txtSQL = "select * from OnWork_info" '连接onwork表
    Set mrc = ExecuteSQL(txtSQL, Msgtext)
    
    With MSHFlexGrid1
        .Rows = .Rows + 1
        .CellAlignment = 4 '表格居中对齐
        .TextMatrix(.Rows - 2, 1) = Trim(mrc.Fields(0))
        .TextMatrix(.Rows - 2, 2) = Trim(mrc.Fields(1))
        .TextMatrix(.Rows - 2, 3) = Trim(mrc.Fields(2))
        .TextMatrix(.Rows - 2, 4) = Trim(mrc.Fields(3))
        .TextMatrix(.Rows - 2, 5) = Trim(mrc.Fields(4))
    End With
    mrc.Close

 

Guess you like

Origin blog.csdn.net/weixin_45309155/article/details/106295582