我在 做條件查詢和全表查詢時,完成全表查詢后,(將條件設為空),再做條件查詢可以實作,接著在做一次全表查詢,(將條件設為空),結果沒有變化,還是條件查詢的 結果
這是什墨原因阿
uj5u.com熱心網友回復:
代碼呢?uj5u.com熱心網友回復:
代碼好多阿你 就設想是那里的原因拉
uj5u.com熱心網友回復:
string strl_bracket, strlisting,stroprater,strtar_date,strr_bracket,strconn,str_sqlconditioninteger in_row,i,j,ll_i,ll_j
string ls_coltype
in_row=dw_1.rowcount()
ll_j= upperbound(ist_dwColumn.s_columns)
for i=1 to in_row
strl_bracket=dw_1.GetItemstring(i,"l_brackets")
strlisting=dw_1.GetItemstring(i,"listing")
stroprater=dW_1.getitemstring(i, "oprate" )
strtar_date=dw_1.gettext( )
strr_bracket=dW_1.getitemstring(i,"r_brackets")
strconn=dW_1.getitemstring(i,"conn" )
if isnull(strl_bracket) or strl_bracket='' then
strl_bracket=""
end if
if isnull(strlisting) or strlisting='' then
strlisting=" "
end if
if isnull(stroprater) or stroprater='' then
stroprater=" "
end if
if isnull(strtar_date) or strtar_date='' then
strtar_date=" "
end if
if isnull(strr_bracket) or strr_bracket='' then
strr_bracket=" "
end if
if isnull(strconn) or strconn=' ' then
strconn=" "
end if
for ll_i=1 to ll_j
string strcolumn
integer ll_m,ll_n
ll_m = ls_ddlb[ll_i].rowcount
for ll_n=1 to ll_m
strcolumn=ls_ddlb[ll_i].datavalue[ll_n]
if strlisting= strcolumn then
ls_coltype=ist_dwcolumn.s_columntype[ll_i]
exit
end if
next
if strlisting= strcolumn then
exit
end if
next
choose case ls_coltype
case "date"
if isdate(strtar_date) then
strtar_date="date('"+strtar_date+"')"
else
messagebox('提示資訊','第'+string(ll_i)+'行的資料無法通過驗證,請重新輸入')
end if
case "char(10)"
if stroprater='like' or stroprater='not like' then
if pos(stroprater,'%')=0 then
strtar_date=" '%" +strtar_date+"%' "
else
stroprater=" '"+stroprater+"' "
end if
end if
if stroprater='=' then
strtar_date=" '"+strtar_date+"' "
end if
case "deci","numb","int","long","real","doub"
if strtar_date=' ' then
strtar_date='0'
end if
if not isnumber(strtar_date) then
messagebox('提示資訊','資料無法通過驗證')
return
end if
if stroprater='in' or stroprater='not in' then
strtar_date="("+strtar_date+")"
end if
END CHOOSE
str_sqlcondition=strl_bracket+strlisting+stroprater+strtar_date+strr_bracket+strconn
next
if isnull(str_sqlcondition) or str_sqlcondition=" " then
str_sqlcondition=" "
end if
dw_2.settransobject(sqlca)
if sqlca.sqlcode<> 0 then
rollback;
else
dw_2.retrieve()
dw_2.setfilter(str_sqlcondition)
dw_2.filter()
end if
uj5u.com熱心網友回復:
dw_2.setfilter(str_sqlcondition)全表時把dw_2.setfilter(str_sqlcondition)
改成:dw_2.setfilter()
,條件時再用dw_2.setfilter(str_sqlcondition)
試試
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/110639.html
標籤:腳本語言
上一篇:奇怪的問題:A SQLServer request resulted in a bad return code or status but no error massage was returned
