Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DAO to ADO Tabledef Code

Posted on 2004-04-29
6
Medium Priority
?
1,242 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:schmir1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 34

Expert Comment

by:arbert
ID: 10954060
Use this as a query and then act upon the recordset:  select * from information_schema.tables
0
 

Author Comment

by:schmir1
ID: 10954763
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
 
LVL 34

Expert Comment

by:arbert
ID: 10955130
I guess I didn't understand your question then--do you not want to get away from Access objects and use ADO?
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 

Author Comment

by:schmir1
ID: 10960758
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
 

Author Comment

by:schmir1
ID: 11153235
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
 
LVL 34

Accepted Solution

by:
arbert earned 1500 total points
ID: 11156920
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

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question