濮阳杆衣贸易有限公司

主頁 > 知識庫 > Asp類 的數(shù)據(jù)庫領(lǐng)域

Asp類 的數(shù)據(jù)庫領(lǐng)域

熱門標(biāo)簽:萊西電子地圖標(biāo)注 金昌電話機(jī)器人價格 修改地圖標(biāo)注 個人可以辦理400電話么 怎么在地圖標(biāo)注自己 縣域地圖標(biāo)注打印店 鳳臺百度地圖標(biāo)注店 武夷山旅游地圖標(biāo)注 外呼系統(tǒng)API接口
奶奶的,Asp類 是真不好學(xué)啊,看著簡單,可真到用的時候,網(wǎng)上的代碼是都報錯?。。?
郁悶了恩久??! 3天了,終于調(diào)試出來了,一個簡單的 數(shù)據(jù)庫類模型,不敢獨(dú)享,拿出來大家分享吧!
本作品 歸 站長中國 www.zzcn.net 彭彭所有 ,你們拷貝的時候不許去掉版權(quán),否則拷貝的人全家死光光?。。。『呛?。。:)
復(fù)制代碼 代碼如下:

%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
html xmlns="http://www.w3.org/1999/xhtml">
%
' 彭彭制作的一個新聞類 敬請笑納 【站長中國】 http://www.zzcn.net QQ:76526211
class NewsClass
 Private zzcn,conn,cnnstr
 private title_p,id_p   
 '對象初始化 
 Private Sub Class_Initialize()    
  'response.write "初始化br>"
  call newsconnstart()    
 End Sub 

 '析構(gòu)函數(shù),在使用 set nothing 釋放對象時,自動執(zhí)行 
    Private Sub Class_Terminate() 

  'response.Write "釋放對象 事件:Class_Terminatebr>"
  call newsconnend()
    end sub 

 '數(shù)據(jù)庫鏈接函數(shù)
 Private sub newsconnstart() 

        Set conn = Server.createObject("ADODB.Connection")
  cnnstr="DRIVER={Microsoft Access Driver (*.mdb)}; "
  cnnstr=cnnstr  "DBQ="  Server.MapPath("admin/WataVase/%29to-dream.mdb")
  conn.Open cnnstr
  'response.write cnnstr  "br>"
    End sub 

 Private sub newsconnend() 
        conn.close
  set conn = nothing
    End sub 

 

 '=========================================
 '函數(shù)名 getrs()
 '獲得 某個欄目 的 一條 記錄集 
 '欄目名 lanmu 
 '每頁幾條記錄 k
 '第幾頁 page
 '第幾條記錄 n
 '日期 riqi  1 為按日期逆序 0 為升序
 '=========================================
 Public Function getrs(ByVal lanmu,ByVal k,ByVal page,ByVal n,ByVal riqi) 

  sql = "Select * From ArticleClass where ClassName = '"lanmu"' order By ClassID Desc"  
  'response.write sql"br>"
  set rs=Server.CreateObject("adodb.recordset") 
  rs.open sql, conn, 1, 1

   if not rs.eof then
    ClassID_p = rs("ClassID")
   end if

  rs.close
  set rs = nothing

  

  
   if riqi = 1 then
    riqi_p = " order By UpdateTime Desc"
   else
    riqi_p = ""
   end if

   
  sql = "Select * From Article where ClassID = "ClassID_p""riqi_p
  set rs=Server.CreateObject("adodb.recordset") 
  rs.open sql, conn, 1, 1
  rs.PageSize = k

   if not rs.eof then  
       rs.AbsolutePage = page
     end if
  i = 0 
  do while not rs.eof and i  n
  i = i + 1
  rs.movenext
  loop

  
  'response.write "rsbr>"
  if n = i then
   title_p = rs("Title")
   id_p = rs("ArticleID")
   'response.write title_p
   'response.write id_p
  else
   title_p = null
   id_p = null
  end if

    
  rs.close
  set rs = nothing
    end Function 

 

 '----------------------------------------
 '
 '屬性寫 標(biāo)題
    Public Property Let title(byval v) 
        title_p = v 
    End Property 
    '屬性讀  標(biāo)題
    Public Property Get title() 
        title = title_p 
    End Property

 '屬性寫 標(biāo)題ID
    Public Property Let id(byval v) 
        id_p = v 
    End Property 
    '屬性讀  標(biāo)題ID
    Public Property Get id() 
        id = id_p 
    End Property

end class 

 


%>
head>
meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
title>Asp 數(shù)據(jù)庫 類 彭彭制作 QQ:76526211/title>
/head>

body>

%
dim news
set news = new NewsClass
call news.getrs("網(wǎng)站收藏",1,1,1,1)
response.write news.id  " "  news.title
set news = nothing
%>
/body>
/html>



標(biāo)簽:清遠(yuǎn) 楚雄 通遼 南京 涼山 上海 邢臺 赤峰

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Asp類 的數(shù)據(jù)庫領(lǐng)域》,本文關(guān)鍵詞  Asp,類,的,數(shù)據(jù)庫,領(lǐng)域,Asp,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Asp類 的數(shù)據(jù)庫領(lǐng)域》相關(guān)的同類信息!
  • 本頁收集關(guān)于Asp類 的數(shù)據(jù)庫領(lǐng)域的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    沈阳市| 云南省| 民权县| 成武县| 米林县| 彭水| 河池市| 乌拉特后旗| 博爱县| 堆龙德庆县| 成都市| 永济市| 阳新县| 兰州市| 建宁县| 茂名市| 呈贡县| 尼勒克县| 股票| 山西省| 满洲里市| 栾川县| 沁阳市| 郓城县| 太原市| 沙田区| 共和县| 阿合奇县| 大新县| 阳谷县| 巴林右旗| 和平县| 利辛县| 东港市| 洞口县| 探索| 阜城县| 汝城县| 淮阳县| 松滋市| 远安县|