对于其他的窗体来说,“正在值班教师”这个窗体就相对来说比较简单了,只需要把此窗体连接到OnWork表即可。
'添加表头 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