| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 479 人关注过本帖
标题:探讨 ASP 数据库数据更新问题
只看楼主 加入收藏
xjdszlm777
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2014-4-20
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
探讨 ASP 数据库数据更新问题
1、 rst("time")=date()
显示数据每天进行更新
2、rst("time")=date("15:00:00")
需要显示数据每天15:00:00更新,但是为什么第一句可以实现,第二句却实现不了,如何实现?

搜索更多相关主题的帖子: 数据库数据 如何 
2014-04-20 21:22
ysf0181
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:55
帖 子:914
专家分:2385
注 册:2006-10-4
收藏
得分:20 
rst("time")=date("15:00:00")

输入结果
response.write rst("time")

asp有个特点,两个变量比较,很可能变为不相等,必须转换为固定类型比较。
<%
aa = "11"
bb = "22"
if aa = bb then '这种写法是错误的。如何写呢,一个必须检查各个是否为空,然后都不为空的时,在用其他来比较
   response.write "dsfd"
end if


'下面是一个asp比较终极写法,你只要知道怎么调用就可以了。涉及知识有vb的。
'if  LiGeBiJiao_config1(22,"22",0) then
'if  LiGeBiJiao_config1(rs("ceshi_datetime"),"2012-5-1 10:10:10",0) then
'if  LiGeBiJiao_config1(rs("ceshi_datetime"),"2012-5-1 10:10:10",1) then '判断是否为空 空为true
'if  LiGeBiJiao_config1(rs("ceshi_datetime"),2012-5-1 10:10:10,0) then '错误写法
'if  LiGeBiJiao_config1(cstr(),22,0) then '错误写法
'if  LiGeBiJiao_config1(clng(),"22",0) then '错误写法
'if  LiGeBiJiao_config1(int(),"22",0) then '错误写法

Function LiGeBiJiao_config1(byval diyige,byval dierge,byval kongpan) 'byval byref kongpan 只能 0 或者 1
   'on error resume next
   'response.write cstr(diyige)&"<br>"
   'response.write dierge
   'response.end
   dim kong11,kong22,tmpkong,tmpType,tmpzhi
   'if kongpan = "" or not isnumeric(kongpan) then
  '    response.write "LiGeBiJiao_config1 调用错误"
    '  response.end
  ' end if
   '//////
   kong11 = 0 : kong22 = 0 : LiGeBiJiao_config1 = false
   '''''
   tmpkong = diyige
   
   Select Case VarType(tmpkong)
   Case 0, 1
     kong11 = 1
   Case 8
     If Len(tmpkong) = 0 Then
        kong11 = 1
     End If
     
   Case 9
     tmpType = TypeName(tmpkong)
     If (tmpType = "Nothing") Or (tmpType = "Empty") Then
         kong11 = 1
     End If
   Case 8192, 8204, 8209
     If UBound(tmpkong) = -1 Then
        kong11 = 1
     End If
   End Select
   
   if int(kongpan) = 1 then
      if int(kong11) = 1 then
         LiGeBiJiao_config1 = true
      end if
      exit function
   end if
   'response.write kong11
   'response.end
   
   '''''''//////
   tmpkong = dierge
   Select Case VarType(tmpkong)
   Case 0, 1
     kong22 = 1
   Case 8
     If Len(tmpkong) = 0 Then
        kong22 = 1
     End If
   Case 9
     tmpType = TypeName(tmpkong)
     If (tmpType = "Nothing") Or (tmpType = "Empty") Then
         kong22 = 1
     End If
   Case 8192, 8204, 8209
     If UBound(tmpkong) = -1 Then
        kong22 = 1
     End If
   End Select
  
   '''''''//////
   if int(kong11)=1 and int(kong22)=1 then
      LiGeBiJiao_config1 = true
      exit Function
   end if
   if int(kong11)=0 and int(kong22)=0 then
      'response.write dierge
      'response.end
      'if diyige = dierge then '错误写法
      if cstr(diyige) = cstr(dierge) then
         
         LiGeBiJiao_config1 = true
      end if
   end if
   
  ' response.write LiGeBiJiao_config1
  'response.end
End Function

ASP讨论QQ群:251346273
2014-04-22 09:33
快速回复:探讨 ASP 数据库数据更新问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016472 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved