对象'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 & "# "