DAO to ADO Tabledef Code

I need to convert some DAO code to ADO.  How do I access tabledef info?  Below is how I did it using DAO:

Private Sub cboTables_Enter()
    Dim tdf As TableDef
    Dim strOutput As String
   
    dbMCL.TableDefs.Refresh
    For Each tdf In dbMCL.TableDefs
        strOutput = strOutput & ";" & tdf.Name
    Next tdf
    strOutput = Mid(strOutput, 2)
    Me.cboTables.RowSource = strOutput
End Sub
schmir1Asked:
Who is Participating?
 
arbertConnect With a Mentor Commented:
information_schema views allow access to the SQL Server system tables and return structure information about your tables and you can also get information on your stored procs and views....

Brett
0
 
arbertCommented:
Use this as a query and then act upon the recordset:  select * from information_schema.tables
0
 
schmir1Author Commented:
I'm afraid I don't understand your answer.  

I did find a way to do what I want using AccessObject as follows:

Private Sub cboTables_Enter()
'List all tables in the tables section
  Dim strOutput As String
  Dim obj As AccessObject
  Dim dbs As Object
 
  Set dbs = Application.CurrentData
 
  For Each obj In dbs.AllTables
    'Filter out the system tables
    If InStr(1, obj.Name, "sys", vbTextCompare) = 0 Then
     strOutput = strOutput & ";" & obj.Name
    End If
  Next obj
 
  strOutput = Mid(strOutput, 2)
  Me!cboTables.RowSource = strOutput
End Sub
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
arbertCommented:
I guess I didn't understand your question then--do you not want to get away from Access objects and use ADO?
0
 
schmir1Author Commented:
Looks like Access Objects work with SQL.  Does your way have advantages?  If so, can you give me more detail as to how I would use it (understanding that I don't know anything about information_schema.tables
0
 
schmir1Author Commented:
arbert

Do you have any farther input?  It will probably be useful to me to understand your answer (and exept it as an answer) even if I don't use it in this particular case.  

You wouldn't know anything about replication(-:.  I've have opened another question just begging for an answer.
0
All Courses

From novice to tech pro — start learning today.