国产探花免费观看_亚洲丰满少妇自慰呻吟_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
    % >

    發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 东安县| 攀枝花市| 北京市| 巴彦县| 西乌| 平南县| 通榆县| 兴国县| 腾冲县| 宜兰县| 多伦县| 宝清县| 洪洞县| 荥经县| 台东市| 深水埗区| 镇沅| 琼结县| 龙泉市| 平邑县| 吕梁市| 祁门县| 屏东市| 成安县| 蓬莱市| 玉林市| 田林县| 旺苍县| 贵州省| 百色市| 上高县| 舒城县| 永丰县| 容城县| 延长县| 南康市| 惠来县| 万山特区| 平泉县| 安溪县| 莱西市|