数据库的更新问题
<%
Set Conn=Server.CreateObject( "ADODB.Connection ")
Connstr= "DBQ= "+server.mappath( "jdgl.mdb ")+ ";DRIVER={Microsoft Access Driver (*.mdb)}; "
Conn.Open connstr
set rs=server.createObject( "adodb.RecordSet ")
SQL= "SELECT * FROM jdgl "
rs.Open SQL,conn,1,3
IF rs.eof or rs.bof then
rs.addnew
end if
rs( "lx ")=Request.Form( "tjlx ")
rs( "pm ")=Request.Form( "tjpm ")
rs( "sl ")=Request.Form( "tjsl ")
rs( "dj ")=Request.Form( "tjdj ")
rs( "bz ")=Request.Form( "tjbz ")
rs( "zh ")=Request.Form( "tjzh ")
rs( "user ")=Request.Form( "user ")
rs.update
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
单独调试无错 提交到这里去执行就出错了
------解决方案--------------------IF rs.eof or rs.bof then
rs.addnew
end if
改成
IF rs.eof and rs.bof then
rs.addnew
end if