G Gina Jul 27, 2005 #1 Hi all. Does someone know how to get all the table names of the current db .... Thanks, Gina
A Alex Dybenko Jul 27, 2005 #2 Hi, you can either loop through Cirrentdb.TableDefs collection, or make a query on MSysObjects table, filtering for Type=1
Hi, you can either loop through Cirrentdb.TableDefs collection, or make a query on MSysObjects table, filtering for Type=1
D Dirk Goldgar Jul 27, 2005 #3 Gina said: Hi all. Does someone know how to get all the table names of the current db Click to expand... DAO version: '======= Dim db As DAO.Database Dim tdf As DAO.TableDef Set db = CurrentDb For each tdf in db.TableDefs ' skip system tables If Left(tdf.Name, 4) <> "MSys" Then Debug.Print tdf.Name End If Next tdf Set db = Nothing '======= In Access 2000 or later, you can also do this: '======= Dim ao As AccessObject For Each ao in CurrentData.AllTables ' skip system tables If Left(tdf.Name, 4) <> "MSys" Then Debug.Print ao.Name End If Next ao '======= You could also do it with ADOX, but I don't have that code off the top of my head.
Gina said: Hi all. Does someone know how to get all the table names of the current db Click to expand... DAO version: '======= Dim db As DAO.Database Dim tdf As DAO.TableDef Set db = CurrentDb For each tdf in db.TableDefs ' skip system tables If Left(tdf.Name, 4) <> "MSys" Then Debug.Print tdf.Name End If Next tdf Set db = Nothing '======= In Access 2000 or later, you can also do this: '======= Dim ao As AccessObject For Each ao in CurrentData.AllTables ' skip system tables If Left(tdf.Name, 4) <> "MSys" Then Debug.Print ao.Name End If Next ao '======= You could also do it with ADOX, but I don't have that code off the top of my head.