当前位置:首页
开发技术指南» 文章正文
    引言:

 ·请帮忙解决一个简单问题给分    »显示摘要«
    摘要: server error in /stores application. -------------------------------------------------------------------------------- control submit of type button must be placed inside a form tag with runat=serv......
    摘要: 我用的是outlook形式,shortcut里面的button标题怎么也改不了,也没法添加,这是怎么回事?高手支招。 ......


100分求高手解决ado+access的问题

兄弟做毕业设计~~马上要交了,求各位大哥帮忙,十分感谢,不能数据库里的日期用的是常规日期,就是yyyy-m-d   hh:mm:ss的那种   数据源microsoft   jet   4.0  
  procedure   TfrmQuery.BitBtn1Click(Sender:   TObject);  
  var  
        lowTime,highTime:string;  
        lowPeriod,highPeriod:string;  
        s:string;  
  begin  
        {处理"查询时间"}  
        d1.Date;  
        lowTime:=formatDateTime(YYYY-m-d,d1.date);  
        lowTime:=lowTime+   00:00:00;  
        highTime:=formatDateTime(YYYY-m-d,d2.Date);  
        highTime:=highTime+   23:59:59;  
        {处理"通话时长"}  
        if   edit1.Text<>   then  
              lowPeriod:=edit1.Text+:  
        else  
              lowPeriod:=00:;  
        if   edit2.Text<>   then  
              lowPeriod:=lowPeriod+edit2.Text+:  
        else  
              lowPeriod:=lowPeriod+00:;  
        lowPeriod:=lowPeriod+00;  
        if   edit3.Text<>   then  
              highPeriod:=edit3.Text+:  
        else  
              highPeriod:=23:;  
        if   edit4.Text<>   then  
              highPeriod:=highPeriod+edit4.Text+:  
        else  
              highPeriod:=highPeriod+59:;  
        highPeriod:=highPeriod+59;  
        {生成查询语句}                        
        s:=select   *   from   detail   ;  
        s:=s+where   开始时间>=+lowTime+   +  
              and   开始时间<=+highTime+   +  
              and   通话时长>=+lowPeriod+   +  
              and   通话时长<=+highPeriod+   ;  
        if   no.Text<>   then  
              s:=s+and   分机号=+no.Text+;  
        {执行查询}  
  showMessage(s);  
        with   query1   do  
        begin  
              close;  
              sql.Clear;  
            sql.Add(s);  
              try  
                    open;  
              except  
                    execsql;  
              end;  
        end;  
  end;  
  project   MDIApp.exe   raised   exception   class   EOleException   with   message标准表达式中数据类型不匹配

NO.1   作者: wlbfeihu

with   ADOQuery1   do  
          try  
              Close;  
              sql.text:=   select   *   from   detail   where   开始时间>=:P1   ;  
              SQL.Add(   and   开始时间<=:p2   and   通话时长>=:p3   and   通话时长<=:p4     )  
              parameters.ParamValues[p1]:=lowTime;  
              parameters.ParamValues[p2]:=highTime;  
              parameters.ParamValues[p3]:=lowPeriod;  
              parameters.ParamValues[p4]:=highPeriod;  
              if   no.Text<>   then  
              begin  
                  Sql.add(   and   分机号=:p5     );  
                  parameters.ParamValues[p5]:=no.Text;  
              end;  
          except  
              on   E:Exception   do   ShowMessage(数据库查询出错!+#13+E.message);  
          end;  
   
   
  可以简洁一些

NO.2   作者: hthunter

access数据库的日期应该用#号,而不是单引号  
  例如(birthday   是   t_user表的一个日期类型数据):  
  SELECT   *   FROM   t_user   where   birthday   >   #1977-01-01#     是正确的  
  而  
  SELECT   *   FROM   t_user   where   birthday   >   1977-01-01则会出现你所说的错误


 ·突然发现c好深奥啊    »显示摘要«
    摘要: struct super_block *(*read_super) (struct super_block *, void *, int); 上面这段声明小弟看不懂啊! 如果(*read_super) (struct super_block *, void *, int)是super_block类型的指针变量的话, 哪个是变量名啊?那些参数又是怎么回事啊? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE