数据库查询问题
<%
DBPath = Server.MapPath("data/iknow.mdb")
set rs=Server.CreateObject("ADODB.Recordset")
connstr="provider=microsoft.jet.oledb.4.0;data source="&DBPath
%>
<%
dim cid,title,content,cost,sql
'以下为取上页传来的值
cid=Request.Form("cid")
title=Request.Form("title")
content=Request.Form("content")
cost=Request.Form("cost1")
sql="insert into askList(title,content,reward,userName,class) values('"&title&"','"&content&"',"&cost&",'提问人从session读出','"&cid&"')"
rs.Open sql,connstr,1,1
%>
<%
rs.close
set rs=nothing
%>
DBPath = Server.MapPath("data/iknow.mdb")
set rs=Server.CreateObject("ADODB.Recordset")
connstr="provider=microsoft.jet.oledb.4.0;data source="&DBPath
%>
<%
dim cid,title,content,cost,sql
'以下为取上页传来的值
cid=Request.Form("cid")
title=Request.Form("title")
content=Request.Form("content")
cost=Request.Form("cost1")
sql="insert into askList(title,content,reward,userName,class) values('"&title&"','"&content&"',"&cost&",'提问人从session读出','"&cid&"')"
rs.Open sql,connstr,1,1
%>
<%
rs.close
set rs=nothing
%>
这样的话可以写入数据库,但是会显示
技术信息(用于支持人员)
错误类型:
ADODB.Recordset (0x800A0E78)
对象关闭时,不允许操作。
/iask/askValidate.asp, 第 13 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
网页:
POST 122 ??? /iask/askValidate.asp
POST Data:
title=liuxoia&content=hgfgdfgfdg&cid=%B2%BB%D1%A1&firstClass1=1&secondClass2=&cost=0&cost1=0&send=%CC%E1%BD%BB%CE%CA%CC%E2