Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: '=' 附近有语法错误。
原码是:
<%
sub Modify()
dim UserID
UserID=Request("ID")
sql="Select * from T_ZDB where ID=" & UserID
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open sql,conn,1,3
%>
<form method="post" action="dictionary.asp" name="form1" onSubmit="javascript:return CheckModify();">
<table width="660" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
<tr class="topbg">
<td height="22" colspan="2" align="center" background="../images/index_24.gif">修 改 字 典</td>
</tr>
<tr>
<td align="right" class="tdbg">字 典 名:</td>
<td class="tdbg"><input name="C_ZDM" type="text" style="border-width:1px; border-color:rgb(192,147,100); border-style:dashed;width:200; font-size:12px; background-color:transparent" onFocus="this.select(); " value="<%=rs("C_zdm")%>"></td>
</tr>
<tr>
<td width="40%" align="right" class="tdbg">项目:</td>
<td width="65%" class="tdbg"><input name="C_XM" type="text" style="border-width:1px; border-color:rgb(192,147,100); border-style:dashed;width:200; font-size:12px; background-color:transparent" onFocus="this.select(); " value="<%=rs("C_xm")%>"></td>
</tr>
<tr>
<td width="40%" align="right" class="tdbg">内容:</td>
<td width="65%" class="tdbg"><textarea name="C_nr" rows="4" style="border-width:1px; border-color:rgb(192,147,100); border-style:dashed;width:200; font-size:12px; background-color:transparent" onFocus="this.select(); "><%=rs("C_nr")%></textarea></td>
</tr>
<tr>
<td colspan="2" align="center" class="tdbg"><input name="Action" type="hidden" id="Action" value="SaveModify">
<input type="submit" name="Submit" value="保存修改结果" style="cursor:hand;">
<input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='dictionary.asp'" style="cursor:hand;"></td>
</tr>
</table>
</form>
<%
rs.close
set rs=nothing
end sub
%>
下面是更新数据库的原码:
<%
sub SaveModify()
dim UserID, C_zdm,C_xm,C_nr
UserID=Request("ID")
C_zdm=Request("C_zdm")
C_xm=request("C_xm")
set rs=server.createobject("adodb.recordset")
sql="Select * from T_ZDB where ID=" & UserID
rs.open sql,conn,1,3
rs("C_zdm")=C_zdm
rs("C_xm")=C_xm
rs("C_nr")=C_nr
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<script language='javascript'>" & chr(13)
response.write "alert('提交成功!');" & Chr(13)
response.write "window.document.location.href='dictionary.asp';"&Chr(13)
response.write "</script>" & Chr(13)
Response.End
end sub
%>
这是怎么回事呢?
说是更新数据库的代码出错了.
set rs=server.createobject("adodb.recordset")
sql="Select * from T_ZDB where ID=" & UserID
rs.open sql,conn,1,3
各位朋友,你们知道是怎么个错法,告诉我一下.