回复 2楼 zznice
我编的代码是这样的:麻烦你给诊断一下:小弟不胜感激!
<%
name=request("text1")
num=request("sel1")
renshu=request("text3")
caozy=request("text6")
shijian=Now
Conn1 = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("基础资料/商品信息.mdb")
set rs2=server.createobject("adodb.recordset")
sql2="select * from 房间信息表 where 包间号='"&num&"'"
rs2.Open sql2,conn1,1,2
dj=rs2("价格")
fwy=rs2("服务员")
rs2.close
Conn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("kaitai.mdb")
set rs=server.createobject("adodb.recordset")
set rs1=server.createobject("adodb.recordset")
sql="select * from kaitai where 姓名 ='"&name&"'"
rs.Open sql,conn,1,1
if rs.EOF then
rs1.Open "kaitai",conn,1,2
rs1.addnew array("姓名","包间号","人数","单价","服务员","操作员","开台时间"),_
array(name,num,renshu,dj,fwy,caozy,shijian)
%>
<script language="vbscript">
alert ("添加成功!")
window.location.href = "KTxinxi.asp"
</script>
<%
rs1.close
set rs1=nothing
else
%>
<script language="vbscript">
alert ("已经添加!")
history.back
</script>
<%
end if
rs.Close
set rs=nothing
%>