<%
'读取各字段的数据
Name = Request("Name")
Email = Request("Email")
Subject = Request("Subject")
Memo = Request("Memo")
'检查各字段是否输入了数据
If Name = "" Or Email = "" Or Subject = "" Or Memo = "" Then
Response.Write ("字段空白不接受!")
Response.End '不再处理以下的程序
End If
'插入到数据库
set conn = Server.CreateObject("ADODB.Connection")
conn.Open("driver={Microsoft Access Driver (*.mdb)};dbq=" &_
Server.MapPath("lyb.mdb"))
SQL = "INSERT INTO lyb(姓名,email,主题,内容) VALUES('" &_
Name & "','" &Email & "','" & Subject & "','" & Memo & "')"
'Response.Write(SQL)
conn.Execute(SQL)
conn.close()
Response.Redirect("display.asp")
%>