当前位置:首页文章首页 IT学院 IT技术

教你数据库简单实现添加,显示,修改,删除的方法

作者:  来源:  发布时间:2011-6-8 11:35:56  点击:
function del()'删除数据

if request("id")<>"" and request("act")="del" then

conn.execute("Delete from pub_doc where id="&request("id")&" ")
response.write "删除成功!"
response.end

end if

end function

function xiaoqi_end()
if request("id")<>"" and request("act")="" then response.write "<sc"+"ript language=java script>frm.save.removeNode(true);read_data()</sc"+"ript>"
if request("id")<>"" and request("act")="edit" then response.write "<sc"+"ript language=java script>read_data()</sc"+"ript>"
session("act")=""
end function

function get_act(sl)
add_form       sl
edit_form      sl
read_edit_form sl
read_form      sl
del
end function

'设置动作
if request("act")="add" then session("act")="add_save"
if request("act")="edit" then session("act")="edit_save"
%>

  调用实例

<%get_act("26")‘使用了26个字段%>
<% if request("act")<>"" or request("id")<>"" then’如果不是显示列表页面%>

<p> </p>
<form method="POST" action="index.asp" name="frm">
        <div align="center">
                <table border="1" width="600" id="table2" bordercolorlight="#000000" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" style="text-align: center">
                        <tr>
                                <td width="149">数据表</td>
                                <td width="149"><input type="text" name="memo1"></td>
                                <td width="150"><input type="text" name="memo2"></td>
                                <td width="150"><input type="text" name="memo3"></td>
                        </tr>
                        <tr>
                                <td width="149"><input type="text" name="memo4"></td>
                                <td width="149"><input type="text" name="memo7"></td>
                                <td width="150"><input type="text" name="memo6"></td>
                                <td width="150"><input type="text" name="memo5"></td>
                        </tr>
                        <tr>
                                <td width="149"><input type="text" name="memo9"></td>
                                <td width="149"><input type="text" name="memo10"></td>
                                <td width="150"><input type="text" name="memo11"></td>
                                <td width="150"><input type="text" name="memo12"></td>
                        </tr>
                        <tr>
                                <td width="149"><input type="text" name="memo16"></td>
                                <td width="149"><input type="text" name="memo15"></td>
                                <td width="150"><input type="text" name="memo14"></td>
                                <td width="150"><input type="text" name="memo13"></td>
                        </tr>
                        <tr>
                                <td width="149"><input type="text" name="memo17"></td>
                                <td width="149"><input type="text" name="memo18"></td>
                                <td width="150"><input type="text" name="memo19"></td>
                                <td width="150"><input type="text" name="memo20"></td>
                        </tr>
                        <tr>
                                <td width="149"><input type="text" name="memo24"></td>
                                <td width="149"><input type="text" name="memo23"></td>
                                <td width="150"><input type="text" name="memo22"></td>
                                <td width="150"><input type="text" name="memo21"></td>
                        </tr>
                        <tr>
                                <td width="149"><input type="text" name="memo25"></td>
                                <td width="149"><input type="text" name="memo26"></td>
                                <td width="150"><input type="text" name="memo8"></td>
                                <td width="150"><input type="submit" value="提交" name="save"></td>
                        </tr>
                </table>
        </div>
<input type="hidden" name="id" value="<%=request("id")%>">
<input type="hidden" name="act" value="<%=session("act")%>">
</form>
<p> </p>

首页 上一页 [1] [2] [3] [4] [5]  下一页 尾页

文章评论

软件按字母排列: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z