| 发表于:2007-09-20 21:22:394楼 得分:10 |
用adox即可 dim cnn as new adodb.connection dim cat as new adox.catalog dim tbl as table dim col as new adox.column cnn.open "provider=microsoft.jet.oledb.4.0; " & _ "data source= c:\windows\desktop\library\library1\db2.mdb " set cat.activeconnection = cnn for each tbl in cat.tables debug.print tbl.name next 获得每个表 下面获得表中每个字段得名称,尺寸及类型 dim tblname as new adox.table set tblname = cat.tables( "check_out ") for each col in tblname.columns debug.print col.name & " " & col.definedsize & " " & col.type next dim ind as new adox.index for each ind in tblname.indexes debug.print ind.name next end sub 根据col.type来判断是不是主键或索引等 | | |
|