资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

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://cdkjz.cn/article/gdsic.html
返回首页 了解更多建站资讯
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220