受<! #include file="filename.asp" --> 宏限制 必須存在該檔案並且會預先編譯(不管前面是否加以條件) 經常有這樣的要求,根據不同的需求要求include不同的檔案 如各個人的不同設定,所以要求能動態include檔案。 代碼如下: Function include(filename) Dim re,content,fso,f,aspStart,aspEnd set
<% '------------------------------------------------- '函數名稱:ReadTextFile '作用:利用AdoDb.Stream對象來讀取UTF-8格式的文字檔 '---------------------------------------------------- function ReadFromTextFile (FileUrl,CharSet) dim str set
資料庫欄位:id(自動編號),class_name(菜單名),parentID(父菜單id) 複製代碼 代碼如下:<% dim m m=0 call ShowTree(0)%> <% Sub ShowTree(parentID) dim s m=m+1 Dim rs Set rs = Server.CreateObject("ADODB.RecordSet") sql="Select class_id,class_name
複製代碼 代碼如下:<% Function Newtxt(sz,strtxt,cityid) Dim ali,icount,i Dim ali2 ali=split(sz,",") ali2=split(strtxt,",") icount=UBound(ali) cityid = Request.QueryString("cityid") if Request.QueryString("cityid") ="" then cityid="234" end if
複製代碼 代碼如下:<!--#include file="conn.asp"--> <% set js = server.CreateObject("ADODB.RecordSet") sql="select top 10 * from article order by id desc" set js = conn.Execute (Sql) do while not js.eof title=js("title") addate=js("addate")
複製代碼 代碼如下:<%@ Language = VBSCRIPT %> <% Option Explicit %> <% rem 在asp中通過getrows實現資料庫記錄分頁的一段代碼 Dim iStart, iOffset iStart = Request("Start") iOffset = Request("Offset") if Not IsNumeric(iStart) or Len(iStart) = 0 then