首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

对象'Refresh'的方法'IADODO'失败,大侠们帮解决下解决方案

2012-03-07 
对象Refresh的方法IADODO失败,大侠们帮解决下IfCheck1(0).Value1AndCheck1(1).Value0ThenAdodc1.Rec

对象'Refresh'的方法'IADODO'失败,大侠们帮解决下
If   Check1(0).Value   =   1   And   Check1(1).Value   =   0   Then
    Adodc1.RecordSource   =   "select   *   from   销售信息表   where   销售信息表.日期   between   ' "   +   Str(DTPicker1.Value)   +   " 'AND   ' "   +   Str(DTPicker2.Value)   +   " ' "
    Adodc1.Refresh
    Adodc2.RecordSource   =   "select   count(*)as   lx,sum(数量)as   数量1,sum(金额)as   金额1   from   销售信息表   where   销售信息表.日期   between   ' "   +   Str(DTPicker1.Value)   +   " 'AND   ' "   +   Str(DTPicker2.Value)   +   " ' "
    Adodc2.Refresh
  End   If
运行后提示:标准表达式中数据类型不匹配
Adodc1.Refresh出错:
对象 'Refresh '的方法 'IADODO '失败


[解决办法]
数据库为ACCESS的话改成这样试试:
Adodc1.RecordSource = "select * from 销售信息表 where 销售信息表.日期 between # " & DTPicker1.Value & " # AND # " & DTPicker2.Value & "# "

热点排行