请高手明示Access中如何将窗体中输入的数据追加到原始数据表中?

急!多谢多谢!

第1个回答  2006-08-31
使用insert语句既可以实现的阿

比如是把表单提交过来的j_year等数据经过处理以后交给数据库里面的字段保存:

<%
set jconn=server.createobject("adodb.connection")
jconn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("jjhwjs.mdb")
jjh_year=request.Form("j_year")+"年"
jjh_month=request.Form("j_month")+"月"
jjh_day=request.Form("j_day")+"日"
jjh_num=request.Form("jjh_num")
jjh_nj=request.Form("j_nj")+"级"
jjh_bj=request.Form("jjh_bj")+"班"
jjh_effect=request.Form("j_effect")
jjh_note=request.Form("notetext")
bz=request.Form("bz")
jjh_techer=request.Form("techer")
wjsID=request.Form("wjs_radio")
exec="insert into jjh_stat1(jjh_year,jjh_month,jjh_day,jjh_num,jjh_nj,jjh_bj,jjh_effect,jjh_note,bz,jjh_techer,wjsID)values('"+jjh_year+"','"+jjh_month+"','"+jjh_day+"','"+jjh_num+"','"+jjh_nj+"','"+jjh_bj+"','"+jjh_effect+"','"+jjh_note+"','"+bz+"','"+jjh_techer+"','"+wjsID+"')"
jconn.execute exec
jconn.close
set jconn=nothing
response.Redirect("wjs_record.asp")
%>

注意insert语句后面的字段名字和变量值要一一对应
相似回答