产品使用及交流论坛

首页 » 产品使用交流区 » 安装及使用交流 » G6转SQL后导航栏的信息统计出错啦
gycsijhy - 2013/3/29 17:01:47
G6模板安装完了将Access转成了SQL,结果信息统计就出问题了:“/”应用程序中的服务器错误。'Now' 不是可以识别的 函数名。
如图:

3983
xiyou - 2013/3/29 17:03:26
修改文章表的自定义文件模型

把内容中的now()改为getdate()
gycsijhy - 2013/3/29 17:15:25
[b]回复 [url=http://bbs.pageadmin.net/showtopic-23941.aspx#77922]2楼[color=Olive]xiyou[/color]的帖子[/url][/b]

还是出错啊
3986
xiyou - 2013/3/29 17:18:09
把自定义文件模型贴出来。
gycsijhy - 2013/3/29 17:21:10
<html>
<head>
<style type="text/css">
div{font:12px/1.7em Verdana,Tahoma,Helvetica,Arial,sans-serif;}
div .hs{color:#ff0000}
</style>
</head>
<body bgColor="transparent">
<div>
○- 今日访问:<span class="hs"><%=Get_Data("co","select count(id) as co  from pa_count where datediff('d',thedate,getdate())=0")%></span><br>
○- 访问总数:<span class="hs"><%=Get_Data("co","select count(id) as co  from pa_count")%></span>
</div>
</body>
</html>
xiyou - 2013/3/29 17:44:57
<html>
<head>
<style type="text/css">
div{font:12px/1.7em Verdana,Tahoma,Helvetica,Arial,sans-serif;}
div .hs{colorff0000}
</style>
</head>
<body bgColor="transparent">
<div>
○- 今日访问:<span class="hs"><%=Get_Data("co","select count(id) as co  from pa_count where datediff(day,thedate,getdate())=0")%></span><br>
○- 访问总数:<span class="hs"><%=Get_Data("co","select count(id) as co  from pa_count")%></span>
</div>
</body>
</html>
改一下红色那里 'd' 改为day ,sql数据库的datediff函数的不识别d
gycsijhy - 2013/3/29 17:49:01
好了,多谢了
xiangyang - 2014/8/21 17:17:50
<% @ Page language="c#" Inherits="PageAdmin.custom_zdymodel"%>
<% @ Import NameSpace="System.Data"%>
<% @ Import NameSpace="System.Data.OleDb"%>
<%conn.Open();Read_Data(134);%><html>
<head>
<style type="text/css">
div{font:12px/1.7em Verdana,Tahoma,Helvetica,Arial,sans-serif;}
div .hs{color:#ff0000}
</style>
</head>
<body bgColor="transparent">
<div>
○- 文章总数:<span class="hs"><%=Get_Data("co","select count(id) as co from article")%></span><br>
○- 今日文章:<span class="hs"><%=Get_Data("co","select count(id) as co from article where datediff('day',thedate,getdate())=0")%></span><br>
○- 会员总数:<span class="hs"><%=Get_Data("co","select count(id) as co from pa_member")%></span><br>
○- 最新会员:<span class="hs"><%=Get_Data("username","select top 1 username from pa_member order by id desc")%></span><br>
○- 访问总数:<span class="hs"><%=Get_Data("co","select count(id) as co  from pa_count")%></span><br>
○- 本月访问:<span class="hs"><%=Get_Data("co","select count(id) as co  from pa_count where datediff('m',thedate,getdate())=0")%></span><br>
○- 今日访问:<span class="hs"><%=Get_Data("co","select count(id) as co  from pa_count where datediff('day',thedate,getdate())=0")%></span><br>
</div>
</body>
</html><%conn.Close();
if(PageCount>1)
{
string PageHtml="<div id=\"sublanmu_page\" class=\"sublanmu_page\">";
if(CurrentPage>1)
{
if(APage_LinkText[0]!=""){PageHtml+="<a href=\""+GoPage(1)+"\">"+APage_LinkText[0]+"</a>";} //首页
if(APage_LinkText[1]!=""){PageHtml+=" <a href=\""+GoPage(CurrentPage-1)+"\">"+APage_LinkText[1]+"</a>";} //上一页
}
int p=8; //表示开始时显示的页码总数
int M=4; //超过p页后左右两边显示页码数
int LastPage=1;
if(CurrentPage<p)
  {
    LastPage=p;
    if(LastPage>PageCount)
     {
       LastPage=PageCount;
     }
    for(int i=1;i<=LastPage;i++)
    {
     if(CurrentPage==i)
      {
        PageHtml+=" <span class=\"c\">"+i.ToString()+"</span>";
      }
    else
      {
       PageHtml+=" <a href=\""+GoPage(i)+"\">"+i.ToString()+"</a>";
      }
    }
  }
else
  {
    //PageHtml+=" <a href=\""+GoPage(CurrentPage-1)+"\">1...</a>";
    LastPage=CurrentPage+M;
    if(LastPage>PageCount)
     {
       LastPage=PageCount;
     }
    for(int i=(CurrentPage-M);i<=LastPage;i++)
    {
     if(CurrentPage==i)
      {
        PageHtml+=" <span class=\"c\">"+i.ToString()+"</span>";
      }
    else
      {
       PageHtml+=" <a href=\""+GoPage(i)+"\">"+i.ToString()+"</a>";
      }
    }

  }

if(CurrentPage<PageCount)
{
  if(LastPage<PageCount)
   {
     PageHtml+=" <a href=\""+GoPage(LastPage+1)+"\">...</a>";
   }
  if(APage_LinkText[2]!=""){PageHtml+=" <a href=\""+GoPage(CurrentPage+1)+"\">"+APage_LinkText[2]+"</a>";}  //下一页
  if(APage_LinkText[3]!=""){PageHtml+=" <a href=\""+GoPage(PageCount)+"\">"+APage_LinkText[3]+"</a>";}     //尾页
}
if(Page_LinkInfo!=""){PageHtml+=" <span>"+String.Format(Page_LinkInfo,CurrentPage,PageCount,RecordCount)+"</span>";} //记录页次
PageHtml+="</div>";
Response.Write(PageHtml);
}%>


帮我看看,按上面的要求改了,还是报错
1
查看完整版本: G6转SQL后导航栏的信息统计出错啦