db_path = "../database/cnbruce2005.mdb" Set conn= Server.CreateObject("ADODB.Connection") connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="Server.MapPath(db_path) conn.Open connstr |
Set rs = Server.CreateObject ("ADODB.Recordset") sql = "Select top 5 * from [news] order by n_id desc" rs.Open sql,conn,1,1 |
do while not rs.eof response.write rs("n_title") rs.movenext loop '還有最后的關(guān)閉和釋放操作 rs.close set rs=nothing |
Function topnews(tnum) Set rs = Server.CreateObject ("ADODB.Recordset") sql = "Select top "tnum" * from [news] order by n_id desc" rs.Open sql,conn,1,1 do while not rs.eof response.write rs("n_title") rs.movenext loop rs.close set rs=nothing End Function |
Class cnbruce '聲明一個名為cnbruce的類 Private cnrose Private Sub Class_Initialize cnrose="My Name is cnrose." End Sub Private Sub Class_Terminate() End Sub End Class |
Class cnbruce '聲明一個名為cnbruce的類 Private cnrose Private Sub Class_Initialize cnrose="My Name is cnrose." End Sub Private Sub Class_Terminate() End Sub Public Property get YName YName=cnrose End Property End Class |
% Class cnbruce Private cnrose Private Sub Class_Initialize cnrose="My Name is cnrose." End Sub Public Property get YName YName=cnrose End Property public property let MName(nnn) cnrose=nnn end property End Class Set aaa=New cnbruce aaa.MName="hahahoho" response.write aaa.YName %> |
標(biāo)簽:上海 通遼 涼山 楚雄 清遠(yuǎn) 赤峰 邢臺 南京
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ASP怎么談到應(yīng)用到類的?》,本文關(guān)鍵詞 ASP,怎么,談到,應(yīng),用到,類,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。