为什么查询数据库CPU都100%啊。
if chaxun = "chaxun" and isnull(chaxun)=false thenif nalilai ="yonghu" then
rs_zhaopin.open"select * from zixunhoutai where dianhua like '%"&dianhua&"%' or qitadianhua like '%"&dianhua&"%' "&pailiefangshi&"",conn_zhaopin,1,1
else
if dianhua ="" or isnull(dianhua)=true or len(dianhua)<11 then
rs_zhaopin.open"select * from zixunhoutai "&pailiefangshi&"",conn_zhaopin,1,1
else
rs_zhaopin.open"select * from zixunhoutai where dianhua like '%"&dianhua&"%' or qitadianhua like '%"&dianhua&"%' "&pailiefangshi&"",conn_zhaopin,1,1
end if
end if
else
rs_zhaopin.open "select * from zixunhoutai "&pailiefangshi&"",conn_zhaopin,1,1
end if
这样的代码,可以在access执行,升级为SQL,代码使CPU100%了,奇怪了。是查询的时候,执行
rs_zhaopin.open"select * from zixunhoutai where dianhua like '%"&dianhua&"%' or qitadianhua like '%"&dianhua&"%' "&pailiefangshi&"",conn_zhaopin,1,1
access正常的, sql数据库时就CPU100%
dianhua 为文本
qitadianhua 为备注
[ 本帖最后由 ysf0181 于 2012-8-23 10:49 编辑 ]