ASP快速開發(fā)方法之?dāng)?shù)據(jù)操作(4)_ASP教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!

      推薦:ASP實(shí)例:即時(shí)顯示當(dāng)前頁面瀏覽人數(shù)
      ASP實(shí)現(xiàn)即時(shí)顯示當(dāng)前頁面瀏覽人數(shù) online.asp文件 以下為引用的內(nèi)容: <!--#include file="dbconn.asp" --> <% onlineTimeout=10

      以下是我的sql.asp文件,請自己進(jìn)行增刪

      以下為引用的內(nèi)容:

      <%
      '用于查詢數(shù)據(jù)
      Class DataTable
      '查出記錄
      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
      '查出記錄條數(shù)
      public Function SelectDataNum(sql)
      If sql<>"" then
      Opendatabase
      Rs.open sql,conn,1,1
      If not Rs.eof then
      Thedata=Rs.GetRows(-1)
      Closedatabase
      Num=ubound(Thedata,2)
      Else
      Closedatabase
      End If
      End If
      SelectDataNum=Num
      End Function
      '使用select count(*) from tablename 查出記錄有數(shù)
      public Function SelectCountNum(sql)
      If sql<>"" then
      Opendatabase
      Rs.open sql,conn,1,1
      If not Rs.eof then
      Thedata=Rs.GetRows(-1)
      Closedatabase
      Num=Thedata(0,0)
      Else
      Closedatabase
      End If
      End If
      SelectCountNum=Num
      End Function
      '將查詢的數(shù)據(jù)全部生成隱藏值
      public Function GetHiddenData(sql)
      dim tempvalue
      If sql<>"" then
      Opendatabase
      Rs.open sql,conn,1,1
      If not Rs.eof then
      Thedata=Rs.getRows(-1)
      TheFieldCount=rs.fields.count
      For i=0 to TheFieldCount-1
      TheFieldList = TheFieldList & Rs.fields(i).name & ","
      Next
      Closedatabase
      TheField = split(TheFieldList,",")
      For i=0 to TheFieldCount-1
      tempvalue = tempvalue & "<input type=""hidden"" id="""&TheField(i)&""" name="""&TheField(i)&""" value="""&Thedata(i,0)&""" />"
      Next
      Else
      Closedatabase
      End If
      End If
      GetHiddenData=tempvalue
      End Function
      public Function UpdataSql(sql)
      If sql<>"" then
      Opendatabase
      conn.execute(sql)
      Closedatabase
      End If
      End Function

      public Function DeldataSql(tableName,DelField,id)
      dim tempvalue
      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
      %>

      分享:ASP教程:解決ASP腳本運(yùn)行超時(shí)的方法
      最近在學(xué)習(xí)服務(wù)器知識(shí)。有時(shí)候遇到asp腳本運(yùn)行超時(shí)的錯(cuò)誤,真是麻煩。找了相關(guān)資料,其中有一些解決方法。 IIS默認(rèn)的腳本超時(shí)時(shí)間是90秒 這樣的話如果你是上傳軟件或者傳送數(shù)據(jù)大于90秒的時(shí)

      共4頁上一頁1234下一頁
      來源:模板無憂//所屬分類:ASP教程/更新時(shí)間:2008-08-22
      相關(guān)ASP教程