|
-
Sep 24th, 2001, 03:34 AM
#1
Thread Starter
Lively Member
ADO Problem
Hi!
I have an ADO object that connect to DB.
How can I get a list of all tables that belong to this DB?
(By code)
Thank you
-
Sep 24th, 2001, 04:07 AM
#2
Fanatic Member
Dim i As Long
Dim db As Database
Dim AllTableDefs
Set db = DBEngine.OpenDatabase(db)
Set AllTableDefs = db.TableDefs
'list the table name,List_AccessTable is a listbox control that can listing the table name
List_AccessTable.Clear
For i = 0 To AllTableDefs.Count - 1
List_AccessTable.AddItem AllTableDefs(i).Name
Next
'del the unnecessary table
For i = 0 To List_AccessTable.ListCount - 1
If List_AccessTable.List(i) = "MSysAccessObjects" Or List_AccessTable.List(i) = "MSysACEs" Or List_AccessTable.List(i) = "MSysObjects" Or _
List_AccessTable.List(i) = "MSysQueries" Or List_AccessTable.List(i) = "MSysRelationships" Or List_AccessTable.List(i) = "MSysModules" _
Or List_AccessTable.List(i) = "MSysModules2" Then
List_AccessTable.RemoveItem (i)
i = i - 1
End If
Next i
db.Close
Last edited by dongaman; Sep 24th, 2001 at 08:19 PM.
I am just aman.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|