当前位置:编程学习 > C#/ASP.NET >>

ASP内存溢出,这是以前别人写的。*这个通配符怎么都看不懂。

<table width="96%" border="0" cellpadding="0" cellspacing="5" class="txt">
        <%
bid=CInt(request.querystring("bid"))
pid=cint(request.querystring("pid"))
aid=cint(request.querystring("aid"))
key=request("key")
str="select * from prod where id>0"
if key<>"" then
str=str &" and [names] like '%"&key&"%' or body like '%"&key&"%'"
else
if pid<>"" and pid<>0 then str=str&" and pid="&pid
if aid<>"" and aid<>0 then str=str&" and aid="&aid
If bid<>"" And bid<>0 Then str=str&" and bid="&bid 
end if
str=str&" order by pxid desc,times desc,id asc"
set rs=server.createobject("adodb.recordset")
rs.open str,db,1,1
 if rs.recordcount<1 then response.Write("<tr><td class=txt align=left>暂无产品</td></tr>")
错误提示:
Microsoft JET Database Engine 错误 '80040e14' 
内存溢出 

/japanese/products.asp,行 60 
--------------------编程问答-------------------- 你看看是那句话报错呢,是不是创建("adodb.recordset")失败 --------------------编程问答--------------------
引用 1 楼 bdmh 的回复:
你看看是那句话报错呢,是不是创建("adodb.recordset")失败

rs.open str,db,1,1
这句报错。不能调用 str
一个注释都没有
一大堆通配符
伤脑筋 --------------------编程问答--------------------
引用 1 楼 bdmh 的回复:
你看看是那句话报错呢,是不是创建("adodb.recordset")失败

大大
给个调试方案
网络上说是日文片假名惹得祸。
我更换数据库。英文跟中文都没有问题。 --------------------编程问答--------------------
引用 楼主 flyfishi 的回复:
<table width="96%" border="0" cellpadding="0" cellspacing="5" class="txt">
        <%
bid=CInt(request.querystring("bid"))
pid=cint(request.querystring("pid"))
aid=cint(request.querystring("aid"))
key=request("key")
str="select * from prod where id>0"
if key<>"" then
str=str &" and [names] like '%"&key&"%' or body like '%"&key&"%'"
else
if pid<>"" and pid<>0 then str=str&" and pid="&pid
if aid<>"" and aid<>0 then str=str&" and aid="&aid
If bid<>"" And bid<>0 Then str=str&" and bid="&bid 
end if
str=str&" order by pxid desc,times desc,id asc"
set rs=server.createobject("adodb.recordset")
rs.open str,db,1,1
 if rs.recordcount<1 then response.Write("<tr><td class=txt align=left>暂无产品</td></tr>")
错误提示:
Microsoft JET Database Engine 错误 '80040e14' 
内存溢出 

/japanese/products.asp,行 60 

检查下数据库连接文件con,要么找到对应的文件,仔细检查下!是否有注入代码! --------------------编程问答--------------------
引用 3 楼 flyfishi 的回复:
Quote: 引用 1 楼 bdmh 的回复:

你看看是那句话报错呢,是不是创建("adodb.recordset")失败

大大
给个调试方案
网络上说是日文片假名惹得祸。
我更换数据库。英文跟中文都没有问题。


如果是因为这样的话你可以试试改用存储过程传参可以解决 --------------------编程问答-------------------- 什么叫做“一大堆通配符”呢?

如果你连sql语句的like关键字都看不懂,你要求别人给你写“注释”,其实也没有什么用处! --------------------编程问答-------------------- “*这个通配符怎么都看不懂”是个关键的判断指标,我建议你不要勉强去看懂这些。
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,