vb怎么列举出一个mdb数据库里面所有表名
答案:2 悬赏:0 手机版
解决时间 2021-01-02 21:50
- 提问者网友:喧嚣尘世
- 2021-01-02 04:25
vb怎么列举出一个mdb数据库里面所有表名
最佳答案
- 五星知识达人网友:鱼芗
- 2021-01-02 05:01
工程引用 microsoft dao 3.6 object library
Dim db1 As Database
Set db1 = DBEngine.OpenDatabase(数据库文件全路径)
Dim Tables As TableDef, fld
For Each Tables In db.TableDefs
If Left(Tables.Name, 4) <> "MSys" Then Print Tables.Name
Next Tables
db.Close
Set db = Nothing
Dim db1 As Database
Set db1 = DBEngine.OpenDatabase(数据库文件全路径)
Dim Tables As TableDef, fld
For Each Tables In db.TableDefs
If Left(Tables.Name, 4) <> "MSys" Then Print Tables.Name
Next Tables
db.Close
Set db = Nothing
全部回答
- 1楼网友:长青诗
- 2021-01-02 05:37
private sub command1_click()
dim conn as adodb.connection
dim rs as adodb.recordset
set conn = new adodb.connection
conn.connectionstring = _
"provider=microsoft.jet.oledb.4.0;" & _
"data source=" & app.path & "\" & "销售.mdb" & ";" & _
"persist security info=false"
conn.open
combo1.clear
set rs = conn.openschema(adschematables, _
array(empty, empty, empty, "table"))
do while not rs.eof
combo1.additem rs!table_name
rs.movenext
loop
rs.close
conn.close
end sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯