请问一个关于ASP,SQL,ACCESS 之间的问题

merryhyde merryhyde 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我有一个产品发布系统,我是用ASP+SQL做的。。系统运行正常。由于我租用的空间不支持SQL 所以现在我要把SQL换成ACCESS 现在我已经把SQL转化为ACCESS了。。可是系统不能用了,。。有但是有一部分还是可以用的。。这之间应该有哪些语法上的区别或是要做怎么样的修改。。

部分代码如下:<%@language="VBscript"%>
<%Response.Expires=0%>
<!--#include file="../include/checkuser.asp"-->
<!--#include file="../include/db_conn.asp"-->
<%
sort_action=Request.Form("sort_action")
boardname=replace(Request.Form("boardname"),"'","''") '取得新目录名
current_ver=Request.QueryString("version")

if sort_action="add_new" then '当添加时

'当添加二级分类时
set rs=conn.execute("select typename from t_product_type where typename='" & boardname & "' and mever='" & current_ver &"' ")
if rs.eof then
conn.execute("insert into t_product_type(typename,mever) values('" & boardname & "','" & current_ver & "')")
Response.Redirect "product_catalog.asp?version=" & current_ver
else
showError chr(34) & boardname & chr(34) & "目录已经存在!"
end if

elseif sort_action="edit" then '当修改时

type_id=Request.Form("type_id")
level_name=Request.Form("level_name")

if level_name="root" then
sqlstr="select catalogname from t_product_catalog where catalogname='" & boardname & "' and mever='" & current_ver & "'"
sqlstr1="UPDATE t_product_catalog SET catalogname='" & boardname & "' where catalogID=" & type_id

elseif level_name="child" then
sqlstr="select typename from t_product_type where typename='" & boardname & "' and mever='" & current_ver & "'"
sqlstr1="UPDATE t_product_type SET typename='" & boardname & "' where ID=" & type_id

else
Response.Redirect "product_catalog.asp?version=" & current_ver
end if

set rs=conn.execute(sqlstr)
if rs.eof then
conn.execute sqlstr1
Response.Redirect "product_catalog.asp?version=" & current_ver
else
showError chr(34) & boardname & chr(34) & "目录已经存在!"
end if

elseif sort_action="del" then '当删除时

type_id=Request.Form("id")
conn.execute "DELETE FROM t_product_type WHERE ID=" & type_id

Response.Redirect "product_catalog.asp?version=" & current_ver

end if
%>
<%sub showError(msg)%>
<script language="javascript">
alert('<%=msg%>');
location.href="product_catalog.asp?version=<%=current_ver%>";
</script>
<%end sub%>


这部代码开始运行正常,换了ACCESS 数据库之后只有前边的添加部不行。。。

谢谢急。。。
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
merryhyde
疑难问题 22,298 成员 121,727 内容