国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

將ASP代碼移植為VB COM組件(4)

2024-05-04 11:06:20
字體:
來源:轉載
供稿:網友
  • 網站運營seo文章大全
  • 提供全面的站長運營經驗及seo技術!
  • asp頁面
    作 者 : 青蘋果電腦工作室

    這個例子中的第一站是asp頁。這個asp頁用ado與northwind 數據庫連接。為了保持良好的編碼習慣,我
    使用了option explicit 并明確地聲明了所有變量。這個asp頁的第一個草稿使用了內聯代碼。

    < % @ language=vbscript % >
    < %
    'example of inline code
    option explicit

    'declare variables
    dim oconn
    dim ors
    dim connectionstring
    dim x

    connectionstring = "dsn=northwind;"

    set oconn = server.createobject("adodb.connection")
    oconn.open connectionstring

    set ors = server.createobject("adodb.recordset")

    'set variables
    ors.activeconnection = oconn
    ors.source = "select * from products"
    ors.open
    % >
    < html >
    < head >
    < meta http-equiv="content-type" content="text/html; charset=windows-1252" >
    < title >new page 1< /title >
    < /head >
    < body >
    < h1 >products< /h1 >
    < table cellspacing="2" cellpadding="5" >
    < tr bgcolor="#ff6666" >
    < th >product name< /th >
    < th >quantity per unitr< /th >
    < th >price< /th >
    < /tr >
    < %
    do until ors.eof
    if x = 1 then
    x = 0
    % >
    < tr bgcolor="#ffcccc" >
    < % else % >
    < tr >
    < %
    x = 1
    end if
    % >
    < td >< %=ors("productname")% >< /td >
    < td >< %=ors("quantityperunit")% >< /td >
    < td >< %=ors("unitprice")% >< /td >
    < /tr >
    < %
    ors.movenext
    loop
    % >
    < /table >
    < /body >
    < /html >
    < %
    'destroy objects
    set ors = nothing
    set oconn = nothing
    % >

    發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 屏南县| 义马市| 永年县| 海伦市| 浦县| 鲁山县| 阿勒泰市| 景宁| 洮南市| 三门峡市| 县级市| 资兴市| 米脂县| 正蓝旗| 光山县| 孝义市| 东台市| 济阳县| 修武县| 韶山市| 湖南省| 葵青区| 陆川县| 扶余县| 威信县| 漳浦县| 六盘水市| 青浦区| 论坛| 江津市| 翁牛特旗| 临泉县| 甘孜县| 黄石市| 周口市| 张家港市| 梅河口市| 德钦县| 东海县| 永善县| 乌拉特中旗|