最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

asp快速開發(fā)方法之?dāng)?shù)據(jù)操作實(shí)例代碼第3/3頁(yè)

 更新時(shí)間:2007年08月08日 11:05:52   作者:  

當(dāng)然你也這以這樣寫:
<%
sql="insert into cnarticle(cn_title,cn_author,cn_content) values(' "&whattitle&" ',' "&whoauthor&" ',' "&whatcontent&" ')"
opendatabase
conn.execute(sql)
closedatabase
%>
考慮到可能刪除語(yǔ)句我們會(huì)這么寫:
sql="delect from cnarticle where id in(1,3,5,6,7,8)"

我新建一個(gè)類DeldataTable,直接使用DeldataTable.DeldataSql(tableName,DelField,id)完成記錄的刪除操作。
<%
Class DeldataTable
    dim tempvalue
    public Function DeldataSql(tableName,DelField,id)
        If tableName<>"" and id<>"" then
            sql="delete from "&tableName
            If isnumeric(id) and instr(id,",")=0 then
                sql = sql & " where "&DelField&" = "&id
            Else
                sql = sql & " where "&DelField&" in ("& id &")"
            End If
            Opendatabase
                conn.execute(sql)
            Closedatabase
            tempvalue=true
        Else
            tempvalue=false
        End If
        DeldataSql=tempvalue
    End Function
End Class
%>
以下是我的sql.asp文件,請(qǐng)自己進(jìn)行增刪
復(fù)制代碼 <%
'用于查詢數(shù)據(jù)
Class selectDataTable
    '查出記錄
    public Function SelectData(sql)
        If sql<>"" then
            opendatabase
            Rs.open sql,conn,1,1
            If not Rs.eof then
                Thedata=Rs.GetRows(-1)
                Closedatabase
            Else
                Closedatabase
            End If
        End If
        SelectData=Thedata
    End Function

相關(guān)文章

最新評(píng)論

勐海县| 华亭县| 莆田市| 文登市| 佛教| 邻水| 长武县| 闻喜县| 五莲县| 仙居县| 上虞市| 大余县| 陆川县| 东兰县| 洪雅县| 仁寿县| 分宜县| 乐安县| 武平县| 合江县| 茂名市| 枝江市| 永新县| 昂仁县| 德阳市| 东城区| 镇雄县| 怀集县| 旬邑县| 晋江市| 昂仁县| 阿拉善左旗| 新闻| 宁化县| 红原县| 郸城县| 漳浦县| 香格里拉县| 克拉玛依市| 万荣县| 七台河市|