请问一个关于ASP,SQL,ACCESS 之间的问题
我有一个产品发布系统,我是用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 数据库之后只有前边的添加部不行。。。
谢谢急。。。
部分代码如下:<%@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 数据库之后只有前边的添加部不行。。。
谢谢急。。。
...全文
相关推荐
access与SQL数据库之间的转换[文].pdf
总结:这篇文档主要介绍了Access数据库与SQL Server之间的转换,Access在ASP环境中的应用,以及Access数据库的管理、安全性和优化方法。
asp+access中介信息网站
安全性:由于ASP和Access都是微软的产品,它们之间的集成通常较为紧密,但也需要注意安全问题,如SQL注入、跨站脚本攻击等,开发者需采取措施进行防护。7.
ACCESS数据库转SQL2000工具
Access是一种关系型数据库管理系统,常用于小型项目,而SQL Server 2000是更强大的企业级数据库系统,适合大型或复杂的应用。这个工具简化了两个数据库系统之间的数据迁移过程。
asp excel导入access
结合VBScript或JScript等脚本语言,ASP可以实现与多种数据库的交互,包括Access。接下来,我们探讨Excel与Access之间的数据迁移。
asp连接access样例2
在ASP中连接Access数据库,可以实现网页与数据库之间的交互,如数据的读取、写入、更新和删除等操作。在"asp连接access样例2"中,我们可以预期以下几个关键知识点:1.


疑难问题
