回 帖 发 新 帖 刷新版面

主题:[求助]提取系统时间入库的问题

我作的考勤登录系统,需提取登录年、月、日、时,但我入库的时间:年一栏为1905-6-29,月一栏为:1900-1-11,时一栏为:1900-1-17。只有时间一栏是正确的。我改了N遍了,总是不正确,又怀疑是我的系统时间错误,反复检查也没错,特请教各位前辈高手。指出我错哪儿了?我的代码如下:
<%
if Request.Form("action")="true" then
  username=trim(Request.Form("username"))      '登录用户名
  password=trim(Request.Form("password"))      '登录密码
  otherpwd = Trim(Request.form("otherpwd"))    '附加码
  reotherpwd = Trim(Request.form("reotherpwd"))'生成的附加码
  
  legalTag=checkenter()

  If legalTag=TRUE then '如果没有非法输入,则进行用户验证
    if otherpwd = reotherpwd then  '附加码比较
      legalUserTag=checksysUser()  '系统用户验证 
      if legalUserTag=true then
         If Session("level")=1 and Session("admin")="True"  Then
            Response.Redirect("manage.asp")
            Response.End
         End If        
        If Session("level")=2  Then
        Response.Redirect("main.asp")
        Response.End
        End If
        If Session("level")=3  Then 
         set rs=server.createobject("adodb.recordset")
         insertsql="select * from kaoqing_table"
         rs.open insertsql,db,1,3
         rs.addnew
         rs("user")=username
         rs("recordYear")=Year(Now)
         rs("recordMonth")=Month(Now)
         rs("recordDay")=Day(Now)
         rs("recordTime")=Time
         rs("note")=note 
  
         rs.update
    
         rs.close
        set rs=nothing
       Response.Redirect("normal.asp")
         Response.End
         End If

         else
        errmsg="<font color=#FF0000><b>用户名或者用户密码错误,请重新输入!</b></font>"
      end if
    else
      errmsg="<font color=#FF0000><b>附加码输入错误,请重新输入!</b></font>"
    end if
  else
    errmsg="<font color=#FF0000><b>用户名输入有误,请重新输入!</b></font>"
  end if
end if 
%>

回复列表 (共2个回复)

沙发

你的recordYear,recordMonth,recordDay字段是不是设了日期型??照你的描述应该设为int型才对。

板凳


谢谢!果然如你所说。一语惊醒梦中人。太感谢了。

我来回复

您尚未登录,请登录后再回复。点此登录或注册