午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    asp 輔助工具(hta版)
    來源:易賢網(wǎng) 閱讀:989 次 日期:2016-06-22 09:11:36
    溫馨提示:易賢網(wǎng)小編為您整理了“asp 輔助工具(hta版)”,方便廣大網(wǎng)友查閱!

    使用方法:保存為asptools.hta然后再運行

    代碼如下:

    <!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>

    <head>

    <meta http-equiv=content-type content=text/html; charset=gb2312 />

    <meta name=author content=柳永法 />

    <title>asp輔助工具</title>

    <style>body{ font-size:12px}</style>

    <hta:application

    id=asptools

    applicationname=asptools

    scroll=no

    singleinstance=yes

    windowstate=normal

    >

    </head>

    <body>

    <div>

    <input type=file id=txtfile onchange=createtableselect('access') style=display:none />

    ip:<input type=text name=ip size=16 style=border:1px solid green value=.\sql2005 />

    登錄名:<input type=text name=userid size=10 style=border:1px solid green value=sa />

    密碼:<input type=password name=pwd size=10 style=border:1px solid green value=yongfa365 />

    數(shù)據(jù)庫名:<input type=text name=dbname size=10 style=border:1px solid green value=hb605-8-8 /><br />

    <input name=button2 type=button id=button2 style=border:1px solid green onclick=createtableselect

    ('mssql') value=連接sql數(shù)據(jù)庫 />

    <input type=button id=btnfromfile onclick=txtfile.click() value=連接access數(shù)據(jù)庫 style=border:1px solid

    green />

    <span id=tables ></span>

    <hr />

    模板:

    <input type=text id=opt value= size=40 />

    <select size=1 id=fz onchange=opt.value=this.value style=width:200px></select>

    <input name=button type=button id=button onclick=c() value=轉(zhuǎn)換 style=border:1px solid green>

    <hr />

    <textarea id=s rows=10 cols=80 style=width:98%></textarea>

    <input type=button onclick=madesql() value=生成sql語句 style=border:1px solid green />

    <textarea id=d rows=10 cols=80 style=width:98%></textarea>

    </div>

    <pre id=sqldemo style=display:none intro=通用建表結(jié)構(gòu)>

    --通用建表結(jié)構(gòu)

    create table [dbo].[tablename] (

    [id] int primary key identity(1,1),--id,主鍵,自動號

    [txttitle] varchar(255),--標(biāo)題

    [txtcontent] text,--內(nèi)容

    [puttime] datetime default (getdate()),--提交時間

    [moditime] datetime default (getdate()),--修改時間

    [hits] int default (0),--點擊數(shù)

    [flags] int default (0) ,--標(biāo)識

    [orderid] int default (0),--排序號

    )

    </pre>

    <pre id=sdemo style=display:none intro=初始源測試數(shù)據(jù)>

    username

    password

    sex

    truename

    age

    tel

    msn

    qq

    email

    </pre>

    <pre id=fzdemo style=display:none intro=輔助輸入>

    輔助輸入

    rs($1) = request($1)

    rs($1) = saferequest($1)

    $1 = request($1)

    $1 = saferequest($1)

    <tr><td>$1:</td><td><input type=text name=$1 size=20></td></tr>

    </pre>

    <hr />

    建議查看源文件然后保存為asptools.hta然后再運行

    <script language=vbscript type=text/vbscript>

    self.focus()

    self.resizeto 620, 520

    '初始化數(shù)據(jù)

    s.value = sdemo.innerhtml

    fzs = split(fzdemo.innerhtml, vbcrlf)

    for each opttemp in fzs

    set o = document.createelement(option)

    o.text = opttemp

    o.value = opttemp

    fz.add o

    next

    opt.value = fz.options(1).value

    '程序運行時的一些函數(shù)

    function c()

    ss = split(s.value, vbcrlf)

    for each sss in ss

    if sss<> then str = str & replace(opt.value, $1, sss) & vbcrlf

    next

    d.value = str

    end function

    dim xcat '定義全局變量,避免重復(fù)鏈接數(shù)據(jù)庫。

    function createtableselect(dbtype)

    set xcat = createobject(adox.catalog)

    if dbtype = access then

    xcat.activeconnection = provider=microsoft.jet.oledb.4.0;data source= & txtfile.value

    elseif dbtype = mssql then

    xcat.activeconnection = provider=sqloledb.1; persist security info=true; data source= & ip.value & ;

    initial catalog=& dbname.value &; user id=& userid.value &; password= & pwd.value

    end if

    for each xtable in xcat.tables

    tabletype = xtable.type

    if tabletype = table then

    tabless = tabless & <option value='& xtable.name &'>& xtable.name &</option>

    end if

    next

    tables.innerhtml =  <select name='nowtables' onchange='createfieldselect( & dbtype & )'><option>==請選擇

    表名==</option> & tabless & </select>

    end function

    function createfieldselect(dbtype)

    dim item

    for each xtable in xcat.tables

    if xtable.name = nowtables.value then

    for each item in xtable.columns

    str = str + item.name & vbcrlf

    next

    exit for

    end if

    next

    s.value = left(str, len(str) -2)

    end function

    function madesql()

    yongfa365fields = split(s.value, vbcrlf)

    yongfa365code2 =

    for each sql in yongfa365fields

    if sql<> then strsql = strsql & [ & sql & ] varchar(50),

    next

    strsql = left(strsql, len(strsql) -1)

    yongfa365code2 = create table tablename( & vbcrlf & replace(strsql, ,, , & vbcrlf) & vbcrlf & ) & vbcrlf

    & vbcrlf

    tempvalue = join(yongfa365fields, & ',' & objitem.)

    yongfa365code2 = yongfa365code2 & conn.execute insert into info ( & join(yongfa365fields, ,) & ) values

    (' & objitem. & tempvalue & & ') & vbcrlf & vbcrlf & vbcrlf

    tempvalue = join(yongfa365fields, ) & ',' & rs()

    yongfa365code2 = yongfa365code2 & conn.execute insert into info ( & join(yongfa365fields, ,) & ) values

    (' & rs( & tempvalue & ) & ') & vbcrlf & vbcrlf & vbcrlf

    tempvalue = join(yongfa365fields, & ',' & )

    yongfa365code2 = yongfa365code2 & conn.execute insert into info ( & join(yongfa365fields, ,) & ) values

    (' & & tempvalue & & ') & vbcrlf & vbcrlf & vbcrlf

    d.value = sqldemo.innerhtml & string(2, vbcrlf) & yongfa365code2

    end function

    function rereplace(str, restrs, restrd)

    set re = new regexp

    re.ignorecase = true

    re.global = true

    re.pattern = restrs

    rereplace = re.replace(str, restrd)

    end function

    </script>

    </body>

    </html>

    更多信息請查看腳本欄目
    易賢網(wǎng)手機網(wǎng)站地址:asp 輔助工具(hta版)
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2025國考·省考課程試聽報名

    • 報班類型
    • 姓名
    • 手機號
    • 驗證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
    工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報警專用圖標(biāo)