导线连接器是什么:vb查询问题

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 14:54:18
根据DTpicker里的日期查询怎么查.
If Text1.Text = "" And Text2.Text = "" And Combo1.Text = "" And DTpicker1.value <> "" Then
Adodc1.RecordSource = "select * from 维护表 where 申请日期 = " & DTPicker1.Value & ""
Adodc1.Refresh
上面的语句查出来是空的.怎么改

从DTpicker1.value <> "" 来看属字符类型,SQL中字符应用单引号标记,故代码改为:
If Text1.Text = "" And Text2.Text = "" And Combo1.Text = "" And DTpicker1.value <> "" Then
Adodc1.RecordSource = "select * from 维护表 where 申请日期 = '" & DTPicker1.Value & "'"
Adodc1.Refresh
END IF