一个关于数据库写入的问题。
程序如下
使用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
%>