當(dāng)前位置:首頁文章首頁 IT學(xué)院 IT技術(shù)

教你數(shù)據(jù)庫簡(jiǎn)單實(shí)現(xiàn)添加,顯示,修改,刪除的方法

作者:  來源:  發(fā)布時(shí)間:2011-6-8 11:35:56  點(diǎn)擊:
function del()'刪除數(shù)據(jù)

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

'設(shè)置動(dòng)作
if request("act")="add" then session("act")="add_save"
if request("act")="edit" then session("act")="edit_save"
%>

  調(diào)用實(shí)例

<%get_act("26")‘使用了26個(gè)字段%>
<% 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">數(shù)據(jù)表</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]  下一頁 尾頁

文章評(píng)論

軟件按字母排列: 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