コードコピーは次のとおりです。
rem ==前の記事==
REM ========================================================================================================================
REM =パラメーター説明:
rem = pid current id、prame:列が現在ドロップされています(一般的なweb_newsテーブルなど、フィールドは通常_ **、ルールはwnを表します)
rem = ptable(テーブルの前のテーブル。たとえば、一般的なテーブル名は次のとおりです。
REM =説明:上記の命名法を使用すると、このプロセスを一般的にすることができます
Rem =========================================================================================================================
functiongetPre(pid、prame、ptable)
id = prame& "_ id"
タイトル= prame& "_ title"
表= "City _"&ptable
url = "show _"&ptable
sql = "SelectTop1"&id& "、"&title& "from"&table& "&"& "<"&pid& "orderby"&id& "desc"
setrs = conn.execute(sql)
ifrs.eoforrs.bofthen
pre = "前の記事:もうニュースはありません"
それ以外
pre = "<ahref ="&url& "。asp?"&id& "&"&rs(0)& ">"&rs(1)& "</a>" "
endif
getPre = pre
エンド機能
REM =次の記事
REM ===============
rem =パラメーターの意味は以前と同じです
REM ===========
functiongetnext(nid、nrame、ntable)
id = nrame& "_ id"
タイトル= nrame& "_ title"
表= "City _"&nable
url = "show _"&ntable
sql = "SelectTop1"&id& "、"&title& "from"&table& "&"&id& "&"&nid& "orderby"&id& ""&id& "" "
setrs = conn.execute(sql)
ifrs.eoforrs.bofthen
nnext = "次:ニュースなし"
それ以外
nnext = "<ahref ="&url& "。asp?"&id& "&"&rs(0)& ">次の記事:"&rs(1)& "</a>"
endif
getNext = nnext
エンド機能
実装コード:
データベースにもテーブルがあります。
city_activecity_datecity_note
City_activeメインフィールドは次のとおりです。CA_ID、CD_TITLE
City_dateメインフィールドは次のとおりです。CD_ID、CD_TITLE
City_noteメインフィールドは次のとおりです。CN_ID、CN_TITLE
この方法で引用できます:
show_note.asp?cn_id = 4の次の記事を引用します
<%= getPre(cn_id、 "cn"、 "note")%> '前の記事
<%= getNext(cn_id、 "cn"、 "note")%> '次の記事