我用的是SQL数据库,然后在自定义登陆窗口的确定按钮下编写了如下代码
Dim y As Integer = Date.Today.Year
Dim m As Integer = Date.Today.Month
Dim d As Integer = Date.Today.Day
If d < 26
Dim dt1 As New Date(y, m-1, 26)
Dim dt2 As New Date(y, m, 25)
Select Case _UserGroup
Case "站领导"
DataTables("sheet1").LoadFilter = "zld like '%" & _UserName & "%' And jcrq >= '" & dt1 & "' And jcrq <= '" & dt2 & "'"
DataTables("sheet1").Load
Case "机关管理干部"
DataTables("sheet1").LoadFilter = "jcr like '%" & _UserName & "%' And jcrq >= '" & dt1 & "' And jcrq <= '" & dt2 & "'"
DataTables("sheet1").Load
Case "包保干部"
DataTables("sheet1").LoadFilter = "bbgb like '%" & _UserName & "%' And jcrq >= '" & dt1 & "' And jcrq <= '" & dt2 & "'"
DataTables("sheet1").Load
Case "车站车间"
DataTables("sheet1").LoadFilter = "jcdd = '" & _UserName & "' And jcrq >= '" & dt1 & "' And jcrq <= '" & dt2 & "'"
DataTables("sheet1").Load()
DataTables("sheet2").LoadFilter = "czcj = '" & _UserName & "' And jcrq >= '" & dt1 & "' And jcrq <= '" & dt2 & "'"
DataTables("sheet2").Load()
End Select
Else
Dim dt1 As New Date(y, m, 26)
Dim dt2 As New Date(y, m+1, 25)
Select Case _UserGroup
Case "站领导"
DataTables("sheet1").LoadFilter = "zld like '%" & _UserName & "%' And jcrq >= '" & dt1 & "' And jcrq <= '" & dt2 & "'"
DataTables("sheet1").Load
Case "机关管理干部"
DataTables("sheet1").LoadFilter = "jcr like '%" & _UserName & "%' And jcrq >= '" & dt1 & "' And jcrq <= '" & dt2 & "'"
DataTables("sheet1").Load
Case "包保干部"
DataTables("sheet1").LoadFilter = "bbgb like '%" & _UserName & "%' And jcrq >= '" & dt1 & "' And jcrq <= '" & dt2 & "'"
DataTables("sheet1").Load
Case "车站车间"
DataTables("sheet1").LoadFilter = "jcdd = '" & _UserName & "' And jcrq >= '" & dt1 & "' And jcrq <= '" & dt2 & "'"
DataTables("sheet1").Load()
DataTables("sheet2").LoadFilter = "czcj = '" & _UserName & "' And jcrq >= '" & dt1 & "' And jcrq <= '" & dt2 & "'"
DataTables("sheet2").Load()
End Select
End If
为什么在大部分局域网电脑上都可以在登录后只加载等于登录的用户名的相关内容,而有些电脑却什么内容都不加载?