vbs怎么生成ACCESS數(shù)據(jù)里所有表的字段-創(chuàng)新互聯(lián)

這篇文章主要講解了“vbs怎么生成ACCESS數(shù)據(jù)里所有表的字段”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“vbs怎么生成ACCESS數(shù)據(jù)里所有表的字段”吧!

我們擁有10余年網(wǎng)頁(yè)設(shè)計(jì)和網(wǎng)站建設(shè)經(jīng)驗(yàn),從網(wǎng)站策劃到網(wǎng)站制作,我們的網(wǎng)頁(yè)設(shè)計(jì)師為您提供的解決方案。為企業(yè)提供網(wǎng)站建設(shè)、網(wǎng)站制作、微信開(kāi)發(fā)、小程序開(kāi)發(fā)、手機(jī)網(wǎng)站制作設(shè)計(jì)、H5網(wǎng)站設(shè)計(jì)、等業(yè)務(wù)。無(wú)論您有什么樣的網(wǎng)站設(shè)計(jì)或者設(shè)計(jì)方案要求,我們都將富于創(chuàng)造性的提供專業(yè)設(shè)計(jì)服務(wù)并滿足您的需求。

<job id ="生成ACCESS數(shù)據(jù)庫(kù)里所有表及所有字段并生成一定格式的字符組合">
<script language ="vbscript">
databasename ="access.mdb"''數(shù)據(jù)庫(kù)地址
tablename ="blogarticle"''要處理的表名


Set conn = CreateObject("ADODB.Connection")
connstr ="provider=microsoft.jet.oledb.4.0;data source="&databasename
conn.Open connstr

Set rs_all = CreateObject("adodb.recordset")
sql_all ="select name from MSysObjects where type=1 and flags=0"
rs_all.Open sql_all, conn,1,1

DoWhileNot rs_all.EOF
    tablename = rs_all(0)
Set rs = CreateObject("adodb.recordset")
    sql ="select * from "& tablename &" where 1<>1"
    rs.Open sql, conn,1,1
    j = rs.Fields.Count
    txtContent =""
    txtContent1 =""
    txtContent2 =""
    txtContent3 =""
    txtContent4 =""
For i =0To(j -1)
        title = rs.Fields(i).Name
        txtContent = txtContent & title &"|"
        txtContent1 = txtContent1 & title&"=trim(request("""&title&"""))"&"<br>"
        txtContent2 = txtContent2 & title&"=rs("""&title&""")<br>"
        txtContent3 = txtContent3 &"rs("""&title&""")=trim(request("""&title&"""))<br>"
        txtContent4 = txtContent4 & title&"=rs("""&title&""")<br>"
Next
    yongfa365 ="<div align=center><a href=""http://www.yongfa365.com"" class=""titlink"" title=""柳永法(yongfa365)'Blog http://www.yongfa365.com"">柳永法(yongfa365)'Blog</a>制作</div>"&title&"里的字段<br><br>"
    CreateFile tablename&".html", yongfa365 & txtContent &"<br><br>"& txtContent1 &"<br><br>"& txtContent2 &"<br><br>"& txtContent3 &"<br><br>"& txtContent4
    rs_all.movenext
Loop

Function CreateFile(FileName, Content)
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fd = FSO.CreateTextFile(FileName,True)
    fd.WriteLine Content
EndFunction

</script>
</job>


<job id ="生成ACCESS數(shù)據(jù)庫(kù)里指定表的所有字段并生成一定格式的字符組合">
<script language ="vbscript">
databasename ="access.mdb"''數(shù)據(jù)庫(kù)地址
tablename ="blogarticle"''要處理的表名


Set conn = CreateObject("ADODB.Connection")
connstr ="provider=microsoft.jet.oledb.4.0;data source="&databasename
conn.Open connstr

''Set rs_all = CreateObject("adodb.recordset")
''sql_all = "select name from MSysObjects where type=1 and flags=0"
''rs_all.Open sql_all, conn, 1, 1

''Do While Not rs_all.EOF
''    tablename = rs_all(0)
Set rs = CreateObject("adodb.recordset")
sql ="select * from "& tablename &" where 1<>1"
rs.Open sql, conn,1,1
j = rs.Fields.Count
txtContent =""
txtContent1 =""
txtContent2 =""
txtContent3 =""
txtContent4 =""
For i =0To(j -1)
    title = rs.Fields(i).Name
    txtContent = txtContent & title &"|"
    txtContent1 = txtContent1 & title&"=trim(request("""&title&"""))"&"<br>"
    txtContent2 = txtContent2 & title&"=rs("""&title&""")<br>"
    txtContent3 = txtContent3 &"rs("""&title&""")=trim(request("""&title&"""))<br>"
    txtContent4 = txtContent4 & title&"=rs("""&title&""")<br>"
Next
yongfa365 ="<div align=center><a href=""http://www.yongfa365.com"" class=""titlink"" title=""柳永法(yongfa365)'Blog http://www.yongfa365.com"">柳永法(yongfa365)'Blog</a>制作</div>"&title&"里的字段<br><br>"
CreateFile tablename&".html", yongfa365 & txtContent &"<br><br>"& txtContent1 &"<br><br>"& txtContent2 &"<br><br>"& txtContent3 &"<br><br>"& txtContent4
''    rs_all.movenext
''Loop

Function CreateFile(FileName, Content)
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fd = FSO.CreateTextFile(FileName,True)
    fd.WriteLine Content
EndFunction

</script>
</job>


感謝各位的閱讀,以上就是“vbs怎么生成ACCESS數(shù)據(jù)里所有表的字段”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)vbs怎么生成ACCESS數(shù)據(jù)里所有表的字段這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司,,小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!

文章名稱:vbs怎么生成ACCESS數(shù)據(jù)里所有表的字段-創(chuàng)新互聯(lián)
文章轉(zhuǎn)載:http://bm7419.com/article2/gdsic.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供服務(wù)器托管、網(wǎng)站內(nèi)鏈、網(wǎng)頁(yè)設(shè)計(jì)公司、電子商務(wù)品牌網(wǎng)站建設(shè)、自適應(yīng)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都seo排名網(wǎng)站優(yōu)化