以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  为什么同样的代码在不同的电脑上显示结果不同  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=50443)

--  作者:34772849
--  发布时间:2014/5/6 22:15:00
--  为什么同样的代码在不同的电脑上显示结果不同

我用的是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
为什么在大部分局域网电脑上都可以在登录后只加载等于登录的用户名的相关内容,而有些电脑却什么内容都不加载?


--  作者:有点甜
--  发布时间:2014/5/6 22:19:00
--  

 有些电脑什么都不加载?

 

 可能原因:电脑的时间不正确,你可以msgbox看一些生成的加载条件。