網(wǎng)頁設(shè)計之a(chǎn)sp網(wǎng)站制作程序員必備知識

2022-05-27    分類: 網(wǎng)站制作

數(shù)據(jù)庫連接:
    <%
    set conn=server.createobject("adodb.connection")
    conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("數(shù)據(jù)庫名")
    %>
    打開數(shù)據(jù)庫:
    exec="select * from 數(shù)據(jù)庫表"
    set rs=server.createobject("adodb.recordset")
    rs.open exec,conn,1,1
    參數(shù)1,1為讀取
    讀取內(nèi)容格式:<%=rs("字段")%>
    添加記錄處理程序:
    <%
    set conn=server.createobject("adodb.connection")
    conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("數(shù)據(jù)庫名")
    name=request.form("字段") name,tel,message為提交表單所設(shè)置的字段值
    tel=request.form("字段")
    message=request.form("字段")
    exec="insert into 表名(字段)values(';"+字段+"';)" 多個用逗號隔開
    conn.execute exec 使用execute提交
    conn.close
    set conn=nothing
    %>
    搜索處理程序:
    <%
    name=request.form("字段") name,tel為提交表單所設(shè)置的字段值
    tel=request.form("字段")
    set conn=server.createobject("adodb.connection")
    conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("數(shù)據(jù)庫名")
    exec="select * from 表 where name=';"+字段+"'; and tel="+字段
    set rs=server.createobject("adodb.recordset")
    rs.open exec,conn,1,1
    %>
    ';頁面搜索到的內(nèi)容導(dǎo)出來
    <%
    do while not rs.eof
    %><tr>
    <td><%=rs("name")%></td>
    <td><%=rs("tel")%></td>
    <td><%=rs("time")%></td>
    </tr>
    <%
    rs.movenext
    loop
    %>
    刪除記錄處理程序:
    <%
    set conn=server.createobject("adodb.connection")
    conn.open "dri

新聞名稱:網(wǎng)頁設(shè)計之a(chǎn)sp網(wǎng)站制作程序員必備知識
文章分享:http://www.bm7419.com/news2/159702.html

網(wǎng)站建設(shè)、網(wǎng)絡(luò)推廣公司-創(chuàng)新互聯(lián),是專注品牌與效果的網(wǎng)站制作,網(wǎng)絡(luò)營銷seo公司;服務(wù)項目有網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

搜索引擎優(yōu)化