addok.asp
代码:
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("data.mdb")
if request("text1")="" then
response.write "<script language=JavaScript>" & chr(13) & "alert('请输入用户名!');" & "history.back()" & "</script>"
Response.End
end if
name=request("name")
sex=request("sex")
officephone=request("officehpone")
faxphone=request("faxphone")
homephone=request("homephone")
cellphone=request("cellphone")
city=request("city")
country=request("country")
address=request("address")
zipcode=request("zipcode")
msn=request("msn")
qq=request("qq")
email=request("email")
url=request("url")
info=request("info")
sql="insert into book(name,sex,officephone,faxphone,homephone,cellphone,city,country,address,zipcode,msn,qq,email,url,info) values('"&name&"','"&sex&"','"&officephone&"''"&faxphone&"','"&homephone&"','"&cellphone&"','"&city&"','"&country&"','"&address&"','"&zipcode&"','"&msn&"','"&qq&"','"&email&"','"&url&"','"&info&"')"
conn.Execute(sql)
response.write "<script language=JavaScript>" & chr(13) & "alert('信息添加成功!');"&"window.location.href = 'index.asp'"&" </script>"
conn.Close
set conn=nothing
%>
data.mdb数据库 表book
利用表单提交,但总是出错,不知道错在哪.请指教