asp中从表单往数据库里提交数据
<%db="db/com02.mdb"onerrorresumenextconnstr="DBQ="+server.mappath(""&db&"")+";Default...
<%
db="db/com02.mdb"
on error resume next
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
if err then
err.clear
else
conn.open connstr
end if
set rs=server.createobject("adodb.recordset")
sql="select * from shfw "
rs.open sql,conn,1,3
rs.AddNew
a=Trim(Request.form("username"))
b=Trim(Request.form("dianhua"))
rs("username")=a
rs("dianhua")=b
rs.Update
rs.close
set rs=nothing
%>
不成功,请问哪边错了 展开
db="db/com02.mdb"
on error resume next
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
if err then
err.clear
else
conn.open connstr
end if
set rs=server.createobject("adodb.recordset")
sql="select * from shfw "
rs.open sql,conn,1,3
rs.AddNew
a=Trim(Request.form("username"))
b=Trim(Request.form("dianhua"))
rs("username")=a
rs("dianhua")=b
rs.Update
rs.close
set rs=nothing
%>
不成功,请问哪边错了 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询