Listing Access tables

Results 1 to 4 of 4

Thread: Listing Access tables

  1. #1
    muddMuse Guest

    Default Listing Access tables

    How can I list tables and fields of an Access database? There was an article but its unavailable right now.

  2. #2
    Join Date
    Dec 1969

    Default RE: Listing Access tables

    There are a couple of ways. Here&#039s the one that uses by far less code.<BR><BR>Dim cn, rs<BR>Set cn = Server.CreateObject ("ADODB.Connection")<BR>Set rs = Server.CreateObject ("ADODB.Recordset")<BR>cn.Open connectionstring<BR>Set rs = cn.OpenSchema (adSchemaTables)<BR><BR>Then your recordset (theoretically - I recall somebody on this board having a problem with one of the schemas but don&#039t remember if it was tables) holds the values for TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, and TABLE_TYPE as its fields.<BR>

  3. #3
    scott johnson Guest

    Default RE: Listing Access tables

    &#039Paste this code into the module section<BR>&#039debug.print (press Ctrl-G)<BR><BR>Option Compare Database<BR>Option Explicit<BR><BR>Sub main()<BR> Dim db As Database<BR> Dim i As Long<BR> <BR> Set db = CurrentDb<BR> For i = 1 To db.TableDefs.Count - 1<BR> Debug.Print db.TableDefs(i).Name<BR> Next i<BR> <BR> db.Close<BR> Set db = Nothing<BR> <BR>End Sub<BR><BR>

  4. #4
    Join Date
    Dec 1969
    Los Angeles, CA

    Default from the FRONT END

    that is where i think they want to get the table names...from the ASP page

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts