国产毛片午夜福利,国产黄网,国产亚洲天堂,97国产精品

  •  
    簡單ASP論壇DIY
    發(fā)布時間:2008-05-06   瀏覽次數(shù):1184087

    簡單ASP論壇DIY

    首先用Access新建一個數(shù)據(jù)庫,設(shè)取名為luntan,數(shù)據(jù)表的名稱為“information”,建立如下字段:“text”,“name”,“time”,并將“time”默認(rèn)值設(shè)為Now()

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

      Set com = Server.CreateObject("ADODB.Connection")

      com.open"DRIVER={Microsoft Access Driver("luntan.mdb");

    pwd=information;DBQ="&Server.MapPath("luntan.mdb")

      sql="select*from information order by time Desc"

      Set rs=Server.CreateObject("ADODB.Recordest")

      rs.open sql,com,3,2

      if rs.EOF or rs.BOF then

      response.write"沒有留言"

      else

        rs.MoveFirst

        while Not rs.EOF.

              response.write rs("name")&"發(fā)布于"&rs("time")&"<br>"

            response.write rs("text")&"<br><hr>"

           rs.MoveNext

      wend

    AbsolutePosition=N,(N=1,2,3......)

      end if

      %>

    接著是用戶書寫留言部分。設(shè)論壇頁為“information.asp”,則

      <form method=post action="information.asp">

      姓名:<input type=text size=12 name="name"><br>

      留言:<textarea cols=30 row=4 name="text"></textarea><br>

      <input type=submit value="提交">

      </form>

    一部分是將用戶提交的表單數(shù)據(jù)記錄到數(shù)據(jù)庫中,則

    以下為引用的內(nèi)容:
     <%
      if request("text")<>empty and request ("name")<>empty then

      Set comb=Server.CreateObject("ADODB.Connection")

      comb.Open"DRIVER={Microsoft Access Driver(*.mdb)};pwd=information;

    DBQ="&Server.MapPath("luntan.mdb")

      sql="select*from information"

      Set rsb=Server.CreateObject("ADODB.Recordset")

      rsb.open sql,comb,3,2

      rsb.AddNew

      rsb("text")=request("text")

      rsb("name")=request("name")

      rsb.update

      end if
    %>

    立即預(yù)約