'To get all Table(s) name in .mdb file with splitting of Original Table(s) and 'System Table(s) in
'To get all Table(s) name in .mdb file with splitting of Original Table(s) and 'System Table(s) in ListBox1 and ListBox2
API Declarations
Dim myTab As TableDef
Rate 'To get all Table(s) name in .mdb file with splitting of Original Table(s) and 'System Table(s) in
(2(2 Vote))
Dim atr As String
Set myDb = DBEngine.Workspaces(0).OpenDatabase("C:\Program Files\Microsoft Visual Studio\VB98\Nwind.mdb")
List1.Clear
List2.Clear
' For Each myTab In myDb.TableDefs
' If Mid(myTab.Name, 1, 4) <> "MSys" Then
' List1.AddItem myTab.Name
' Else
' List2.AddItem myTab.Name
' End If
' Next
For i = 0 To myDb.TableDefs.Count - 1
Set myTab = myDb.TableDefs(i)
atr = (myTab.Attributes And dbSystemObject)
If atr = 0 Then
List1.AddItem myTab.Name
Else
List2.AddItem myTab.Name
End If
Next i
Me.Caption = "Total Tables : " & List1.ListCount & " / " & List2.ListCount
End Sub
'To get all Table(s) name in .mdb file with splitting of Original Table(s) and 'System Table(s) in Comments
No comments yet — be the first to post one!
Post a Comment