sql = "update userinfo set lastlogtime=getdate() where userid="&idlastlogtime要取系统当前的时间,但是运行提示getdate是无效的标识符,那么它究竟该怎么设置啊?我知道asp.net里是system.datetime.now。

解决方案 »

  1.   

    在Access中用Now(),SQL Server中用Getdate()
      

  2.   

    sql = "update userinfo set lastlogtime="&getdate()&" where userid="&id
      

  3.   

    还是不行啊。   类型不匹配: 'getdate'
      

  4.   

    写一个方法吧
    public void updateTime(lastlogtime,id)
    {
       sql = "update userinfo set lastlogtime=@lastlogtime where userid="&id;  添加参数;
      执行Command对象;
       ……
    }调用的时候这样写就可以了:updateTime(System.DateTime.Now,id);
      

  5.   

    asp.net中我会,但是现在是asp中的问题
      

  6.   

    sql = "update userinfo set lastlogtime='" & Now &"' where userid="&id
      

  7.   

    oracle 的当前时间是sysdate,转化时间函数to_date