查询问题
string s2,d1,e2,e1,c,s1
s1=trim(sle_1.text)
s2=trim(sle_2.text)
d1=trim(ddlb_1.text)
e1 = trim(em_1.text)
e2 = trim(em_2.text)
if cbx_1.checked = false then
if s1 = '' and s2 = '' and d1 = '' then
messagebox('错误',"查询条件不能为空!")
return
else
if s1="" then s1 = '%'
if d1="" then d1 = '%'
if s2="" then s2 = '%'
dw_1.settransobject(sqlca)
c="select * from 商品信息 where 商品编号 like '"+s1+"' and 商品名称 like '"+s2+"' and 商品类型 like '"+d1+"'"
dw_1.setsqlselect(c)
dw_1.retrieve()
end if
else
if s1="" then s1 = '%'
if d1="" then d1 = '%'
if s2="" then s2 = '%'
dw_1.settransobject(sqlca)
c="select * from 商品信息 where 商品编号 like '"+s1+"' and 商品名称 like '"+s2+"' and 商品类型 like '"+d1+"' and 入库日期 > '"+e1+"' and 入库日期 < '"+e2+"'"
dw_1.setsqlselect(c)
dw_1.retrieve()
end if
integer al
al=dw_1.rowcount()
if al =0 then
messagebox('消息',"无符合条件的数据!")
else
st_9.text=string(al)
end if
dw_1.object.datawindow.readonly = "yes"
以上是我查询中的代码。保存时是没有任何问题的。但运行的时候提示:
select error:coiumn lists do not match
我看了一下,表里面的列是对得上的,我用的是ASA的数据库。大家帮忙看看是哪里的问题。先谢过了。