Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT MSysObjects.Name AS table_name
- FROM MSysObjects
- WHERE (((Left([Name],1))<>"~")
- AND ((Left([Name],4))<>"MSys")
- AND ((MSysObjects.Type) In (1,4,6)));
- order by MSysObjects.Name
- SELECT
- Table_Name = Name,
- FROM
- MSysObjects
- WHERE
- (Left([Name],1)<>"~")
- AND (Left([Name],4) <> "MSys")
- AND ([Type] In (1, 4, 6))
- ORDER BY
- Name
- Sub ListAccessTables2(strDBPath)
- Dim cnnDB As ADODB.Connection
- Dim rstList As ADODB.Recordset
- Set cnnDB = New ADODB.Connection
- ' Open the connection.
- With cnnDB
- .Provider = "Microsoft.Jet.OLEDB.4.0"
- .Open strDBPath
- End With
- ' Open the tables schema rowset.
- Set rstList = cnnDB.OpenSchema(adSchemaTables)
- ' Loop through the results and print the
- ' names and types in the Immediate pane.
- With rstList
- Do While Not .EOF
- If .Fields("TABLE_TYPE") <> "VIEW" Then
- Debug.Print .Fields("TABLE_NAME") & vbTab & _
- .Fields("TABLE_TYPE")
- End If
- .MoveNext
- Loop
- End With
- cnnDB.Close
- Set cnnDB = Nothing
- End Sub
- SELECT
- Name
- FROM
- MSysObjects
- WHERE
- (Left([Name],1)<>"~")
- AND (Left([Name],4) <> "MSys")
- AND ([Type] In (1, 4, 6))
Add Comment
Please, Sign In to add comment