asp中使用update语句更新access数据库怎么做?

来源:百度知道 编辑:UC知道 时间:2024/05/11 00:22:20
<td class="forumRowHighlight">所属科室:</td>

<td class="forumRow">
<select name="subcateid" size="1">
<%
if isedit or cateid<>"" then
sql="select * from "&CategoryName&"_SubCate where cateid="&cateid
else
sql="select * from "&CategoryName&"_SubCate"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "没有小类"
else
do while not rs.eof
if subcateid=cstr(rs("subcateid")) then
sel="selected"
else
sel=""
end if
response.write "<option " & sel & " value='"&cstr(rs("subcateid"))&"'>"

spl="update "&CategoryName&"_SoftInfo set "&CategoryName&"_SoftInfo.SubcateName='"&trim(rs("SubCateName"))&"' where "&CategoryName&"_SoftInfo.SoftID="&request("SoftID")

你的字符串里面引号用很迷糊.多练练吧.有些是asp的东西.不应试跟sql混为一起

spl=\"update \"& CategoryName &\"_SoftInfo set \"& CategoryName &\"_SoftInfo.SubcateName=\"& trim(rs(\"SubCateName\")) &\" where \"&CategoryName&\"_SoftInfo.SoftID=\"& cstr(request(\"SoftID\"))

可以把你的sql取出来看看吗?

应该是sql写错了