by Hari Har Maharana (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Fri 3rd March 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)
'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
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
No comments have been posted about 'To get all Table(s) name in .mdb file with splitting of Original Table(s) and 'System Table(s) in . Why not be the first to post a comment about 'To get all Table(s) name in .mdb file with splitting of Original Table(s) and 'System Table(s) in .