asp教程之如何橫向顯示數(shù)據(jù)代碼_ASP教程

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

      推薦:淺析asp程序創(chuàng)建access數(shù)據(jù)庫
      access數(shù)據(jù)庫屬于“文件型數(shù)據(jù)庫”,創(chuàng)建時(shí)需要指定它要使用的文件,如下所示: SetCatalog_object=Server.CreateObject(ADOX.Catalog) Catalog_object.Create(Provider=Microsoft.Jet.OLEDB.4.0;DataSource=Server.MapPath(/數(shù)據(jù)庫.mdb)) 簡單的兩句話

      <% 
      sql="select * from serr where order by id asc"
      set rs=server.createobject("adodb.recordset")
      rs.open sql,conn,1,1
      %><style type="text/css">
      <!--
      body,td,th {
      font-size: 12px;
      }
      -->
      </style> 
      <table width=""100%"" align=’center’> 
      <% 
      for i=1 to rs.recordCount ’變量i從1循環(huán)到數(shù)據(jù)庫中的全部記錄數(shù) 
      if (i mod 4 =1) then ’每個(gè)tr顯示4個(gè)記錄,可根據(jù)需要自行修改 
      response.write "<tr>" 
      end if 
      response.write "<td width=200>"&rs("title")&"<br>"&rs("con")&"<br>"&rs("www")&"<br>"&rs("keyword")&"</td>"
      if (i mod 4 = 0) then 
      response.write "</tr>" 
      end if 
      rs.movenext 
      next 
      rs.close 
      %> 
      </table>

      分享:揭秘ASP中單引號(hào)雙引號(hào)和 連接符使用技巧
      一、單引號(hào) :如學(xué)習(xí)語文課一樣,繼續(xù)放在雙引號(hào)中的引號(hào)可以采用單引號(hào) response.write(Iamhere) 二、ASP中處在雙引號(hào)中的可以是任意的字符、字符串 ,HTML代碼 1.%response.write(Iamhere)%%response.write(cnbrucehere)% 2.%response.write(bIamhe

      來源:模板無憂//所屬分類:ASP教程/更新時(shí)間:2010-01-31
      相關(guān)ASP教程