vbs怎么生成ACCESS数据里所有表的字段-创新互联

这篇文章主要讲解了“vbs怎么生成ACCESS数据里所有表的字段”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“vbs怎么生成ACCESS数据里所有表的字段”吧!

我们拥有10余年网页设计和网站建设经验,从网站策划到网站制作,我们的网页设计师为您提供的解决方案。为企业提供网站建设、网站制作、微信开发、小程序开发手机网站制作设计H5网站设计、等业务。无论您有什么样的网站设计或者设计方案要求,我们都将富于创造性的提供专业设计服务并满足您的需求。



databasename ="access.mdb"''数据库地址
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&"""))"&"
"
        txtContent2 = txtContent2 & title&"=rs("""&title&""")
"
        txtContent3 = txtContent3 &"rs("""&title&""")=trim(request("""&title&"""))
"
        txtContent4 = txtContent4 & title&"=rs("""&title&""")
"
Next
    yongfa365 ="柳永法(yongfa365)'Blog制作

"&title&"里的字段

"
    CreateFile tablename&".html", yongfa365 & txtContent &"

"& txtContent1 &"

"& txtContent2 &"

"& txtContent3 &"

"& txtContent4
    rs_all.movenext
Loop

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







databasename ="access.mdb"''数据库地址
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&"""))"&"
"
    txtContent2 = txtContent2 & title&"=rs("""&title&""")
"
    txtContent3 = txtContent3 &"rs("""&title&""")=trim(request("""&title&"""))
"
    txtContent4 = txtContent4 & title&"=rs("""&title&""")
"
Next
yongfa365 ="柳永法(yongfa365)'Blog制作
"&title&"里的字段

"
CreateFile tablename&".html", yongfa365 & txtContent &"

"& txtContent1 &"

"& txtContent2 &"

"& txtContent3 &"

"& txtContent4
''    rs_all.movenext
''Loop

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



感谢各位的阅读,以上就是“vbs怎么生成ACCESS数据里所有表的字段”的内容了,经过本文的学习后,相信大家对vbs怎么生成ACCESS数据里所有表的字段这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是创新互联网站建设公司,,小编将为大家推送更多相关知识点的文章,欢迎关注!


分享文章:vbs怎么生成ACCESS数据里所有表的字段-创新互联
文章分享:http://bzwzjz.com/article/gdsic.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 外贸营销网站建设 移动网站建设 教育网站设计方案 成都企业网站建设 成都网站设计公司 四川成都网站设计 成都网站建设公司 成都网站设计 网站建设方案 手机网站建设 成都网站设计 企业网站设计 成都网站制作 公司网站建设 高端网站建设 成都响应式网站建设 企业网站建设公司 宜宾网站设计 成都企业网站建设公司 重庆外贸网站建设 网站建设 古蔺网站建设