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

小弟我的代码错哪了

2011-12-31 
我的代码哪里错了?If Check1.Value 1 And Check2.Value 0 And Check3.Value 0 And Check4.Value 0

我的代码哪里错了?
If Check1.Value = 1 And Check2.Value = 0 And Check3.Value = 0 And Check4.Value = 0 Then
Adodc1.RecordSource = "select * from 项目信息 where 申报日期 between '" + Chr(35) + Str(DTPicker1.Value) + Chr(35) + "' and '" + Chr(35) + Str(DTPicker2.Value) + Chr(35) + "'"
Adodc1.Refresh
End If

这个代码老是出现说对象refresh方法的IACODC失败

[解决办法]
between Chr(35) + " + str(DTPicker1.Value) + "+ Chr(35) and Chr(35) +" + Str(DTPicker2.Value) + "+ Chr(35)"


where 申报日期>= # " & DTPicker1.Value & " # and 申报日期<= #" & DTPicker2.Value &"# "
&之间de 空格少了没有
[解决办法]
If Check1.Value = 1 And Check2.Value = 0 And Check3.Value = 0 And Check4.Value = 0 Then
Adodc1.RecordSource = "select * from 项目信息 where 申报日期>= # " & DTPicker1.Value & " # and 申报日期<= #" & DTPicker2.Value & "# "

热点排行