这是向数据库中提交信息的程序:
<!--#include file="opendb.asp"-->
<%
name=request.Form("name")
sex=request.Form("sex")
idnum=request.Form("idnum")
tel=request.Form("tel")
address=request.Form("address")
jxnum=session("hj")
jx=session("jx")
'response.Write name&" "&sex&" "&idnum&" "&tel&" "&address&" "&jxnum&" "&jx
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from kptj",conn,1,3
rs.addnew
rs("name")=name
rs("sex")=sex
rs("idnum")=idnum
rs("tel")=tel
rs("address")=address
rs("time")=now()
rs("jxnum")=jxnum
rs("jx")=jx
rs.update
rs.close
set rs=nothing
End If
response.write"<SCRIPT language=JavaScript>alert('添加成功!');"
response.write"this.location.href='index.asp';</SCRIPT>"
%>
opendb.asp是链接数据库语句,如下:
<%
dim conn
dim connstr
connstr="DBQ="+server.mappath("65.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
set rs=server.createobject("adodb.recordset")
%>
上面数据库名,个字段名都对,可是提交信息后出现
无法显示网页 | |
您要访问的网页有问题,无法显示。 |
怎么办?