一个关于数据库写入的问题。

baiwei 2003-08-22 01:14:27
程序如下
使用add 加入数据成功,modify 提示找不到Corporatoin_id

if founderr=false then
dim sql_loan,rs_loan

if request("action")="add" then
sql_loan="select * from Loan_basic_circs where Loan_code='" & Loan_code & "'"
set rs_loan=server.createobject("adodb.recordset")
rs_loan.open sql_loan,conn,1,3
if not(rs_loan.bof and rs_loan.eof) then
founderr=true
errmsg=errmsg & "<br><li>您输入的借款企业已经存在!请先查询后再进行借款记录的输入!</li>"
else
rs_loan.addnew
call Save_data()
rs_loan.update
Corporation_id=rs_loan("Corporation_id")
founderr=false
end if
rs_loan.close
set rs_loan=nothing
elseif request("action")="Modify" then
Corporation_id=trim(request("Corporation_id"))
if Corporation_id<>"" then
sql_loan="select * from Loan_basic_circs where Corporation_id=" & Corporation_id
set rs_loan=server.createobject("adodb.recordset")
rs_loan.open sql_loan,conn,1,3
if not (rs_loan.bof and rs_loan.eof) then
call SaveData()
rs_loan.update
rs_loan.close
set rs=nothing
end if
else
founderr=true
errmsg=errmsg+"<li>找不到此借款企业,可能已经被其他人删除。</li>"
call Loan_WriteErrMsg()
end if
else
founderr=true
errmsg=errmsg+"<li>不能确定Corporatoin_id的值</li>"
end if
end if
%>
...全文
57 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧