读书人

PB查询窗口数据库有关问题

发布时间: 2012-02-29 16:44:11 作者: rapoo

PB查询窗口数据库问题
我用SQL语言做了个查询窗口,但点查询的时候出现







我的代码如下:


string cxarea,cxtime,sql

cxarea = trim(sle_area.text);
cxtime = trim(sle_time.text);

if cxarea="" and cxtime="" then
MessageBox("提示","查询条件不能为空");
return;
end if

if cxarea="" then
sql="select * from WeiShengArrangement where start_date= "+"’"+cxtime+"'"
elseif cxtime="" then
sql="select * from WeiShengArrangement where area="+"'"+cxarea+"'"
else
sql="select * from WeiShengArrangement where area="+"'"+ cxarea + "'"+"and start_date=" +"'"+cxtime+"'"
end if

dw_table.setsqlselect(sql)
dw_table.retrieve()


谁知道什么原因啊?求解释

[解决办法]
你用的是你本地电脑的地址:file:///C:/Documents%20and%20Settings/Administrator/桌面/QQ截图未命名.png。所以只有你自己看得到
先上传到相册,再复制地址到这里
[解决办法]
没见到图,不过数据窗口更换sql语句尽量不要用"select * ...",select后面的列一定要与原数据窗口实际列的数量、数据类型完全一致!否则一定会出错!
[解决办法]

探讨
没见到图,不过数据窗口更换sql语句尽量不要用"select * ...",select后面的列一定要与原数据窗口实际列的数量、数据类型完全一致!否则一定会出错!

读书人网 >PB

热点推荐