我是这样写的:
<!--#include file="conn.asp"-->
<!--#include file="article.inc"-->
<%
dim sql
dim rs
dim disid,id
'dim typename
dim distitle
dim discuss
dim pen_name
dim ip
distitle=htmlencode2(request.form("txtdistitle"))
discuss=htmlencode2(request.form("txtdiscuss"))
' typename=htmlencode2(request.form("typename"))
pen_name=htmlencode2(request.form("txtpen_name"))
set rs=server.createobject("adodb.recordset")
sql="select distinct news.id ,discus.disid ,DISCUS.disdatetm ,discus.distitle,discus.pen_name, discus.discuss, discus.ip from news, discus where discus.disid=news.id"
response.Write sql
rs.open sql,conn,1,3
rs.addnew
rs("disdatetm")=now()
rs("distitle")=distitle
rs("discuss")=discuss
rs("pen_name")=pen_name
rs("id")=request("disid")
rs("ip")=request.ServerVariables("REMOTE_ADDR")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
执行有错误
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] 参数不足,期待是 1。
/feishui/inpg/discuss.asp, 第 21 行
21行是rs.open sql,conn,1,3