ASP 数据存储问题

qiqi163 2008-12-02 10:25:39
专家请指教. 以下是将修改的数据,重新提交到数据库下一个表下的程序.问题:我想将修改前数据存到表O_FlowDoc下的A字段 B字段.这代码应该怎么写?
<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"--><!--#include file="../HXINCLUDE/upload_5xsoft.inc"-->
<%
WS_FDID=request("ID")
if WS_FDID="" or isnull(WS_FDID) then
HX_GoBack "非法操作",""
end if
ColumnName="":Tablename="HX_FlowDoc":Orderby=" where WS_FDID="&WS_FDID
action=request("action")
set rs=WS_S.HX_SetRSD("",Tablename,Orderby)
Tablename="WS_FlowDoc":Orderby=" where WS_FDID="&WS_FDID
if action="saveinfo" then
set upload=new upload_5xSoft
Subject=upload.form("Subject"):WS_FlowDoczi=upload.form("WS_FlowDoczi"):WS_FlowDochao=upload.form("WS_FlowDochao"):WS_FlowDocGrade=upload.form("WS_FlowDocGrade"):WS_FlowDocmj=upload.form("WS_FlowDocmj"):WS_FlowDocdepartment=upload.form("WS_FlowDocdepartment"):WS_FlowDocTopic=upload.form("WS_FlowDocTopic"):WS_FlowDocCensor=upload.form("Censor"):WS_FlowDocIntroduce=upload.form("Introduce"):WS_FlowDocMemo=upload.form("Memo"):WS_FlowDocContent=upload.form("Content"):send=upload.form("send"):call WS_S.ChkIsOuter()
filepath=WorkFlowFilePath
for each formName in upload.objFile ''列出所有上传了的文件X
set file=upload.file(formName) ''生成一个文件对象
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
FileName=file.FileName
fileExt=lcase(file.FileExt) '得到的文件扩展名不含有.
uploadsuc=false
for i=0 to ubound(Forumupload)
if fileEXT=trim(Forumupload(i)) then
uploadsuc=false
exit for
else
uploadsuc=true
end if
next
if uploadsuc=false then HX_GoBack "文件格式不正确,重新上传",""
ranNum=int(90000*rnd)+10000
FileNextName=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
FileSeverPath=Server.mappath(filepath&FileNextName)
file.SaveAs FileSeverPath
if WS_S.HX_ScanFile(FileSeverPath) then
WS_S.CheckFile FileSeverPath,True
HX_GoBack "不能上传!",""
end if
wsoasfile=wsoasfile&filepath&FileNextName&"|"
wsoasnextfile=wsoasnextfile&FileName&"|"
end if
FileName=wsoasfile
FileNextName=wsoasnextfile
next

rs("WS_FlowDocSubject")=Subject:rs("WS_FlowDoczi")=WS_FlowDoczi:rs("WS_FlowDochao")=WS_FlowDochao:rs("WS_FlowDocGrade")=WS_FlowDocGrade:rs("WS_FlowDocmj")=WS_FlowDocmj:rs("WS_FlowDocdepartment")=WS_FlowDocdepartment:rs("WS_FlowDocUserName")=LOGINUSERNAME:rs("WS_FlowDocTopic")=WS_FlowDocTopic:rs("WS_FlowDocIntroduce")=WS_FlowDocIntroduce:rs("WS_FlowDocMemo")=WS_FlowDocMemo:rs("WS_FlowDocContent")=WS_FlowDocContent:rs("WS_FlowDocForm")=send:rs("WS_FlowDocBack")=0:rs("WS_FlowDocBackUserName")="":rs("WS_FlowDocBackContent")=""
if file.FileSize>0 then rs("WS_FlowDocAnnex")=FileName:rs("WS_FlowDocAnnexName")=FileNextName
rs.update
'set rs1=server.createobject("ADODB.recordset")
'sql1="select * from O_FlowDoc"
'rs1.Open sql1,conn,1,3
'rs.addnew
'if not rs1.EOF then
'Topic2=rs1("WS_FlowDocTopic")


msg="发文成功!"
set file=nothing
call WS_S.HX_RSClose(rs)
set upload=nothing
HX_GoBack msg,"FlowDocDraft.asp"
end if
%><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title>修改工作流</title>

</head>
<body>
<table cellpadding='2' cellspacing='1' border='0' class='border' align=center><tr><td class='Navigation'>修改工作流</font></td>
</tr></table>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<form name="frmAddMessage" method="post" action="?action=saveinfo&id=<%=rs("WS_FDID")%>" onSubmit="return CheckForm();" onReset="return ResetForm();" enctype='multipart/form-data' target='_self'> <tr bgcolor="#FFFFFF" >
<td width="14%" HEIGHT="16" > 处理方式: </td>
<td width="86%" ><input type="radio" name="send" value="0" checked class=radio id="send01">
<font color="#0000FF"><label for="send01" style="cursor:hand">马上发送</label></font>
<input type="radio" name="send" value="1" class=radio id="send02">
<font color="#0000FF"><label for="send02" style="cursor:hand">暂时保存</label></font></td>
</tr>
<tr bgcolor="#FFFFFF" >
<td> 标  题: </td>
<td> </td>
</tr>
<tr bgcolor="#FFFFFF" >
<td> 是否预算:</td>
<td>
<input name="WS_FlowDoczi" type="text" autocomplete=off value="<%=rs("WS_FlowDoczi")%>" size="5" >
其他:
<input name="WS_FlowDochao" type="text" autocomplete=off value="<%=rs("WS_FlowDochao")%>" size="8" ></td>
</tr>
<tr bgcolor="#FFFFFF" >
<td> 报销类别: </td>
<td><select name="WS_FlowDocGrade">
<option value="普通"<%if rs("WS_FlowDocGrade")="普通" then response.write " selected"%>>普通
<option value="紧急"<%if rs("WS_FlowDocGrade")="紧急" then response.write " selected"%>>急
<option value="加急"<%if rs("WS_FlowDocGrade")="加急" then response.write " selected"%>>加急
</select>
<select name="WS_FlowDocmj">
<option value="电话费"<%if rs("WS_FlowDocmj")="普通" then response.write " selected"%>>电话费
<option value="餐费" selected<%if rs("WS_FlowDocmj")="秘密" then response.write " selected"%>>餐费
<option value="差旅费"<%if rs("WS_FlowDocmj")="机密" then response.write " selected"%>>差旅费
</select></td>
</tr>
<tr bgcolor="#FFFFFF" >
<td> 申请金额:</td>
<td><input name="WS_FlowDocTopic" type="text" autocomplete=off value="<%=rs("WS_FlowDocTopic")%>" size="30" >
<input name="Topic2" type="text" id="Topic2" autocomplete=off value="<%=rs("WS_FlowDocTopic")%>" size="30" ></td>
</tr>
<tr bgcolor="#FFFFFF" >
<td> 发 文 人: </td>
<td><input type="text" autocomplete=off name="WS_FlowDocUserName" size="10" value="<%=rs("WS_FlowDocUserName")%>" readonly></td>
</tr>

<tr bgcolor="#FFFFFF" >
<td> 发文部门:</td>
<td><input type="text" autocomplete=off name="WS_FlowDocdepartment" value="<%=rs("WS_FlowDocdepartment")%>" readonly></td>
</tr>

<tr bgcolor="#FFFFFF" >
<td> 其他说明: </td>
<td><textarea name="Introduce" cols="40" rows="2"><%=rs("WS_FlowDocIntroduce")%></textarea></td>
</tr>
<tr bgcolor="#FFFFFF" >
<td> 附注: </td>
<td><textarea name="Memo" cols="40" rows="2"><%=rs("WS_FlowDocMemo")%></textarea></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="right"> 正文内容: </td>
<td><!--#include file="../HXEditor/WSOAEDITOR.ASP"--></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="right"></td><input name="Content" type="hidden" id="Content" value="<%=Server.HTMLEncode(rs("WS_FlowDocContent"))%>">
<td><input type="submit" class="button" name="submit" value=" 保 存 "> <input type="reset" class="button" name="Reset" value=" 重 写 "> </td>
</tr></form>
</table>
</td>
</tr></table>
...全文
110 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
virgo2008 2008-12-03
  • 打赏
  • 举报
回复
试试吧,你只是换了一个表去显示更改前的内容,你改下表名,其它的不变就可以出来了!
qiqi163 2008-12-03
  • 打赏
  • 举报
回复
好的,我试下
virgo2008 2008-12-02
  • 打赏
  • 举报
回复
在更新记录前O_FlowDoc下的A字段 B字段.
conn.execute("insert into FlowDoc select a,b from 表")
zjzb0409 2008-12-02
  • 打赏
  • 举报
回复
把第一个表的连接 复制下 改下表名 跟楼上说的是一个道理
jhwcd 2008-12-02
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 qiqi163 的回复:]
很好用,谢谢. 如果想读取显示第二个表的信息.我应该怎么加代码?/
[/Quote]
跟第一个表读取的方式类试吧。
qiqi163 2008-12-02
  • 打赏
  • 举报
回复
很好用,谢谢. 如果想读取显示第二个表的信息.我应该怎么加代码?/

28,409

社区成员

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

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