输入数据后执行通过,但打开数据库里空空如也……
泪奔……
问题已解决。解决方案请见我新开的帖
http://bbs.bc-cn.net/viewthread.php?tid=121548
[此贴子已经被作者于2007-2-26 21:29:18编辑过]
输入数据后执行通过,但打开数据库里空空如也……
泪奔……
问题已解决。解决方案请见我新开的帖
http://bbs.bc-cn.net/viewthread.php?tid=121548
[此贴子已经被作者于2007-2-26 21:29:18编辑过]
全文如下:
<!--#include file="dbpath.asp"-->
<html>
<%
if request.form("shui")<>"" then
shui="水 "
end if
if request.form("dian")<>"" then
dian="电 "
end if
if request.form("qi")<>"" then
qi="气 "
end if
if request.form("guangqian")<>"" then
guangqian="光纤 "
end if
if request.form("qiyuan")<>"" then
qiyuan="气源"
end if
fwss=shui&dian&qi&guangqian&qiyuan
bhz=trim(request.form("bhz"))
lrrq=trim(request.form("lrrq"))
jzmj=trim(request.form("jzmj"))
fwtx=trim(request.form("s"))&"室"&trim(request.form("t"))&"厅"&trim(request.form("w"))&"卫"
fwwz=trim(request.form("fwwz"))
lsqjl=trim(request.form("lsqjl"))
csqy=trim(request.form("csqy"))
fwzh=trim(request.form("fwzh"))
fwxz=trim(request.form("fwxz"))
lc=trim(request.form("lc"))
zlc=trim(request.form("zlc"))
jznd=trim(request.form("jznd"))
if trim(request.form("sfxyjzzl"))<>"" then
sfxyjzzl="是"
else
sfxyjzzl="否"
end if
fwtkrq=trim(request.form("fwtkn"))&"/"&trim(request.form("fwtky"))&"/"&trim(request.form("fwtkr"))
cqxz=trim(request.form("cqxz"))
qzh=trim(request.form("qzh"))
sgjbr=request.form("sgjbr")
sgqy=trim(request.form("sgqy"))
sgbm=trim(request.form("sgbm"))
sgbmfzr=trim(request.form("sgbmfzr"))
sgrq=trim(request.form("sgn"))&"/"&trim(request.form("sgy"))&"/"&trim(request.form("sgr"))
xxtgz=trim(request.form("xxtgz"))
fwsgj=trim(request.form("fwsgj"))
fwsgdj=trim(request.form("fwsgdj"))
sghtbah=trim(request.form("sghtbah"))
gzf=trim(request.form("gzf"))
xxf=trim(request.form("xxf"))
qtfy=trim(request.form("qtfy"))
gjdqdj=trim(request.form("gjdqdj"))
yjxsrq=trim(request.form("yjxsn"))&"/"&trim(request.form("yjxsy"))&"/"&trim(request.form("yjxsr"))
yjxsj=trim(request.form("yjxsj"))
yjlr=trim(request.form("yjlr"))
if request.form("sfygz")<>"" then
sfygz="是"
else
sfygz="否"
end if
if request.form("sfschg")<>"" then
sfschg="是"
else
sfschg="否"
end if
fkfs=trim(request.form("fkfs"))
sgyy=request.form("sgyy")
bz=request.form("bz")
set rs=server.createobject("adodb.recordset")
sql="select bh from date1"
rs.open sql,conn,1,1
bhmax=0
do while not rs.eof
if left(rs("bh"),1)=bhz and mid(rs("bh"),2,4)=CStr(year(now)) then
if right(rs("bh"),4)>bhmax then
bhmax=right(rs("bh"),4)
end if
end if
rs.movenext
loop
bhmax=bhmax+1
bh=bhz&year(now)&right("0000"&bhmax,4)
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
sql="select * from date1"
rs.open sql,conn,1,3
rs.addnew
rs("设施")=fwss
rs("bh")=bh
rs("房屋信息录入日期")=lrrq
rs("建筑面积")=jzmj
rs("房屋套型")=fwtx
rs("房屋位置")=fwwz
rs("离市区距离")=lsqjl
rs("城市区域")=csqy
rs("房屋装潢")=fwzh
rs("房屋性质")=fwxz
rs("楼层")=lc
rs("总楼层")=zlc
rs("建造年代")=jznd
rs("是否需要简装整理")=sfxyjzzl
rs("房屋腾空日期")=fwtkrq
rs("产权性质")=cqxz
rs("权证号")=qzh
rs("收购经办人")=sgjbr
rs("收购区域")=sgqy
rs("收购部门")=sgbm
rs("收购部门负责人")=sgbmfzr
rs("收购日期")=sgrq
rs("信息提供者")=xxtgz
rs("房屋收购价")=fwsgj
rs("房屋收购单价")=fwsgdj
rs("收购合同备案号")=sghtbah
rs("公证费")=gzf
rs("信息费")=xxf
rs("其他费用")=qtfy
rs("估计当前单价")=gjdqdj
rs("预计销售日期")=yjxsrq
rs("预计销售价")=yjxsj
rs("预计利润")=yjlr
rs("是否已公证")=sfygz
rs("是否已审查合格")=sfyschg
rs("付款方式")=fkfs
rs("收购原因")=sgyy
rs("备注")=bz
rs.update
rs.close
set rs=nothing
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Refresh" content="500; URL=main.asp?user=<%=user%>">
<title><%=bh%></title>
</head>
<body>
<p align="center"><font color="#FF0000">提交成功!</font></p>
<p align="center">5 秒后自动<a href="main.asp?user=<%=user%>">返回</a>···
</body>
</html>
[此贴子已经被作者于2007-2-24 13:33:44编辑过]
应该就是这个ASP文件的问题,前一个页面FORM里的数据是成功提交了的。因为页面中如果加上
response.write 变量
可以正确显示。
后来我把COMMAND该成了RS.ADD格式,还是不行
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.mappath("AG7P4E.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
set rs=server.createobject("adodb.recordset")
sql="select * from date1"
rs.open sql,conn,1,3
rs.addnew
rs("设施")=fwss
rs("bh")=bh
rs("房屋信息录入日期")=lrrq
rs("建筑面积")=jzmj
rs("房屋套型")=fwtx
rs("房屋位置")=fwwz
rs("离市区距离")=lsqjl
rs.update
rs.close
set rs=nothing
[此贴子已经被作者于2007-2-24 13:32:30编辑过]
[此贴子已经被作者于2007-2-24 15:31:56编辑过]
不可行,错误为
Microsoft JET Database Engine (0x80040E14)
FROM 子句语法错误。
第15句为
rsadm.open sqladm,conn,1,1
[此贴子已经被作者于2007-2-24 16:39:07编辑过]