版主源代码是<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <BR><html> <BR><head> <BR><meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <BR><title>无标题文档</title> <BR><!-- #include file="../include/conn.asp" --> <BR><script language="javascript"> <BR><% <BR> '判断是否提交 <BR> IF Request("IsSubmit")="True" Then <BR> Dim rsAct,ygh',BH变量生命 <BR> Set rsAct=Server.CreateObject("ADODB.RecordSet")'创建记录集 <BR> Select Case Request("Action") <BR> Case "Add"'添加操作 <BR> <BR> '获得最新的编号 <BR> ygh=request.QueryString("id") <BR> Dim rsMaxID <BR> Set rsMaxID=conn.Execute("select Max(编号) from pxinfo") <BR> BH=rsMaxID.Fields(0).Value+1 <BR> rsMaxID.Close <BR> Set rsMaxID=Nothing <BR> '添加代码 <BR> rsAct.Open "select * from pxinfo",conn,1,3 <BR> rsAct.AddNew <BR> rsAct("编号")=BH <BR> rsAct("员工号")=ygh <BR> rsAct("培训时间")=Request("pxsj") <BR> rsAct("培训内容")=Request("pxnr") <BR> rsAct("培训地点")=Request("pxdd") <BR> rsAct("培训结果")=Request("pxjg") <BR> rsAct.Update <BR> Response.Write "alert('添加成功');" <BR> Case "Edit"'修改操作 <BR> <BR> '修改代码 <BR> rsAct.Open "select * from pxinfo Where 编号='"&request("BH")&"'",conn,1,3 <BR> IF Not rsAct.EOF Then <BR> rsAct("培训时间")=Request("pxsj") <BR> rsAct("培训内容")=Request("pxnr") <BR> rsAct("培训地点")=Request("pxdd") <BR> rsAct("培训结果")=Request("pxjg") <BR> rsAct.Update <BR> Response.Write "alert('修改成功');" <BR> Else <BR> Response.Write "alert('修改失败');" <BR> End IF <BR> End Select <BR> End IF <BR>%> <BR></script> <BR><% <BR> dim ActionCmd <BR> if request("Action")="" then <BR> ActionCmd="Add" <BR> else <BR> ActionCmd=request("Action") <BR> end if <BR>%> <BR></head> <BR><body> <BR><p align="center"><font color="#FF0000" size="6" face="仿宋_GB2312"><strong>添 加 <BR> 员 工 计 算 机 培 训 记录</strong></font></p> <BR><div align="center"> <BR> <table width="907" style="border:1px;" border="1" cellpadding="0" cellspacing="0" bgcolor="#00FFFF"> <BR> <!--DWLayoutTable--> <BR> <tr bordercolor="#333333" bgcolor="#99FFCC"> <BR> <td width="163" valign="center"> <BR> <div align="center" class="style1"><font color="#3366FF" size="5">培训时间</font></div></td> <BR> <td width="170" valign="center"> <BR> <div align="center" class="style1"><font color="#3366FF" size="5">培训内容</font></div></td> <BR> <td width="113" valign="center"> <BR> <div align="center" class="style1"><font color="#3366FF" size="5">培训地点</font></div></td> <BR> <td width="127" valign="center"> <BR> <div align="center" class="style1"><font color="#3366FF" size="5">培训结果</font></div></td> <BR> <td width="121" valign="center"> <BR> <div align="center" class="style1"><font color="#3366FF" size="5">操作</font></div></td> <BR> </tr> <BR> <% <BR> Dim rspage,str <BR> set rspage=server.CreateObject("adodb.recordset") <BR> str="select * from pxinfo where 员工号='"&request("id")&"'" <BR> rspage.open str,conn,2,4 <BR> do while not rspage.eof <BR> response.Write("<tr>") <BR> response.Write("<td align=center>"&rspage("培训时间")&"</td>") <BR> response.Write("<td align=center>"&rspage("培训内容")&"</td>") <BR> response.Write("<td align=center>"&rspage("培训地点")&"</td>") <BR> response.Write("<td align=center>"&rspage("培训结果")&"</td>") <BR> response.Write("<td align=center><a href=../admin/admin_bjpxjl.asp?Action=Edit&ID="&rspage("员工号")&"&BH="&rspage("编号")&" target=_self>编辑</a></td>") <BR> response.Write("</tr>") <BR> rspage.movenext <BR> loop <BR> %> <BR> </table> <BR> </div> <BR><p>&nbsp;</p> <BR><p>&nbsp;</p> <BR><p>&nbsp;</p> <BR><p>&nbsp;</p> <BR><p>&nbsp;</p> <BR><p>&nbsp;</p> <BR><p>&nbsp; </p> <BR><div align="center"> <BR><table width="907" border="0" cellpadding="0" cellspacing="0"> <BR> <tr> <BR> <td width="907" height="369"><div align="center"> <BR><form action="../admin/admin_bjpxjl.asp?Action=<%=ActionCmd%> &ID=<%=Request("id")%> &BH=<%=request("BH")%> method="post" name="form1" target="_self"> <BR><% <BR> '操作判断 <BR> Dim pxsj,pxnr,pxdd,pxjg <BR> '变量初始化 <BR> ygh=-1 <BR> pxsj="" <BR> pxnr="" <BR> pxdd="" <BR> pxsj="" <BR> '判断当前是否为修改操作 <BR> IF Request("Action")="Edit" Then <BR> '读取修改的内容 <BR> Dim rsRead,bh <BR> bh=request("BH") <BR> Set rsRead=conn.Execute("select * from pxinfo Where 编号='"&bh&"'") <BR> IF Not rsRead.EOF Then'判断是否读取到内容 <BR> ygh=rsRead("员工号") <BR> pxsj=rsRead("培训时间") <BR> pxnr=rsRead("培训内容") <BR> pxdd=rsRead("培训地点") <BR> pxjg=rsRead("培训结果") <BR> End IF <BR> rsRead.Close <BR> Set rsRead=Nothing <BR> End IF <BR>%> <BR><table width="392" border="1" cellpadding="0" cellspacing="0"> <BR> <!--DWLayoutTable--> <BR> <tr bordercolor="#333333"> <BR> <td height="30" valign="center"> <div align="center" class="style8"><font color="#3366FF" size="4">培训时间</font></div></td> <BR> <td valign="center"> <div align="center"> <BR> <input type="text" name="pxsj" value="<%=pxsj%>"> <BR> </div></td> <BR> </tr> <BR> <tr bordercolor="#333333"> <BR> <td height="21" valign="center"> <div align="center" class="style5 style9"><font color="#3366FF" size="4">培训内容</font></div></td> <BR> <td valign="center"> <div align="center"> <BR> <input type="text" name="pxnr" value="<%=pxnr%>"> <BR> </div></td> <BR> </tr> <BR> <tr bordercolor="#333333"> <BR> <td height="26" valign="center"> <div align="center" class="style8"><font color="#3366FF" size="4">培训地点</font></div></td> <BR> <td valign="center"> <div align="center"> <BR> <input type="text" name="pxdd" value="<%=pxdd%>" > <BR> </div></td> <BR> </tr> <BR> <tr bordercolor="#333333"> <BR> <td height="21" valign="center"> <div align="center" class="style8"><font color="#3366FF" size="4">培训结果</font></div></td> <BR> <td valign="center"> <div align="center"> <BR> <input type="text" name="pxjg" value="<%=pxjg%>" > <BR> </div></td> <BR> </tr> <BR> <tr bordercolor="#333333"> <BR> <td height="36" colspan="2" valign="top"> <p align="center">&nbsp;</p> <BR> <p align="center"> <BR> <input type="hidden" name="IsSubmit" value="True"> <BR> &nbsp;&nbsp;&nbsp;&nbsp; <BR> <input type="submit" name="Submit" value="提交"> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR> <input type="reset" name="ClearForm" value="重填"> <BR> </p></td> <BR> </tr> <BR></table> <BR></form> <BR></table> <BR></div> <BR></body> <BR></html> <BR>