asp教程 +access 數據保存插入代碼
if request.QueryString("ag") then
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("../skyj.mdb")
ag=request.form("ag")
amount=request.form("amount")
name2=request.form("name")
tel=request.form("tel")
email=request.form("email")
QQ=request.form("QQ")
bolg=request.form("bolg")
blank=request.form("blank")
exec="insert into 訂單(訂單,數量,人名,電話,Email,QQ,博客,銀行卡號)values('"+ag+"','"+amount+"','"+name2+"','"+tel+"','"+email+"','"+QQ+"','"+bolg+"','"+blank+"')"
conn.execute exec
conn.close
set conn=nothing
end if
%>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.3lian.net/1999/xhtml">
<html>
<head>
<title>asp +access 數據保存插入代碼</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="../05-17/example5.asp">
<table width="70%" border="0">
<tr>
<td>產品
<input type="text" name="ag" value=""> </td>
<td>數量 (斤)
<input type="text" name="amount" value=""></td>
<td>姓名
<input type="text" name="name" value=""></td>
<td>電話
<input type="text" name="tel" value=""></td>
<td>Email
<input type="text" name="email" value=""></td>
<td>QQ
<input type="text" name="QQ" value=""></td>
<td>博客<input type="text" name="bolg" value=""></td>
<td>銀行卡號<input type="text" name="blank" value=""></td>
</tr>
</table>
<br>
<br>
<br>
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</form>
<br>
</body>
</html>