thornmastr
Programmer
I am looking at a database with a large but unknown number of tables. I need to capture the names of all the tables on the database. Doing a search of google, the consensus of opinion is I cannot build such a list using any ADO constructs but DAO will work quite nicely and it does. Below is the routine I am using.
Public aTableNames() As String
Public Sub sTestNames()
Dim dbMyDB As Database
Dim td As TableDef
Dim f As Field
Dim sStr As String
Dim sMypath As String
Dim iknt As Integer
sMypath = App.Path & "\dbaseIII.mdb"
Set dbMyDB = OpenDatabase(sMypath)
iknt = 0
ReDim aTableNames(0 To 1000) As String
For Each td In dbMyDB.TableDefs
If Left$(td.Name, 4) <> "MSys" Then
aTableNames(iknt) = td.Name
iknt = iknt + 1
End If
Next
ReDim Preserve aTableNames(0 To iknt - 1) As String
End Sub
While this works very nicely, I am used to and more comfortable referencing only the ADO libraries and now I find myself referencing both ADO and DAO.
Is there not some ADO functionality to do the above?
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@earthlink.net
Public aTableNames() As String
Public Sub sTestNames()
Dim dbMyDB As Database
Dim td As TableDef
Dim f As Field
Dim sStr As String
Dim sMypath As String
Dim iknt As Integer
sMypath = App.Path & "\dbaseIII.mdb"
Set dbMyDB = OpenDatabase(sMypath)
iknt = 0
ReDim aTableNames(0 To 1000) As String
For Each td In dbMyDB.TableDefs
If Left$(td.Name, 4) <> "MSys" Then
aTableNames(iknt) = td.Name
iknt = iknt + 1
End If
Next
ReDim Preserve aTableNames(0 To iknt - 1) As String
End Sub
While this works very nicely, I am used to and more comfortable referencing only the ADO libraries and now I find myself referencing both ADO and DAO.
Is there not some ADO functionality to do the above?
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@earthlink.net