Need a simple list of Objects and fields

J

jmillerWV

I am in the prosess of getting my Access 2003 Database upsized to SQL server
2000. I need a way to list the DB Objects and the fields therein. I am
getting items that are not properly upsizing or the wizard says these items
cannot be upsized. This I believe is due to some table fields having spaces
in them. So I need to be able to get a list of Objects and the fields in
order that I may make correction to the tables and also to the objects that
use them, without spending hours looking at each object and probably missing
some. I am able to create a list of the objects but am not sure how to get
the field names. Any help would be greatly appreciated.

jmillerWV
 
D

Dirk Goldgar

jmillerWV said:
I am in the prosess of getting my Access 2003 Database upsized to SQL
server
2000. I need a way to list the DB Objects and the fields therein. I am
getting items that are not properly upsizing or the wizard says these
items
cannot be upsized. This I believe is due to some table fields having
spaces
in them. So I need to be able to get a list of Objects and the fields in
order that I may make correction to the tables and also to the objects
that
use them, without spending hours looking at each object and probably
missing
some. I am able to create a list of the objects but am not sure how to get
the field names. Any help would be greatly appreciated.


Listing the tables and the fields in them is easy enough with code:


'---- start of example code (note: this is "air code") ---

' You must have a reference set to the Microsoft DAO 3.6 Object Library

Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field

Dim intFile As Integer

intFile = FreeFile()

Open CurrentProject.Path & "\FieldList.txt" For Output As #intFile

Set db = CurrentDb

For Each tdf in db.TableDefs

If Left(tdf.Name, 4) <> "MSys" Then

Print #intFile, "Table: " & tdf.Name

For Each fld in tdf.Fields
Print #intFile, , "Field: " & fld.Name
Next fld

End If

Next tdf

Close #intFile

Set db = Nothing

'--- end of code ---

The above could be modified to print the types, sizes, or other properties
of the fields as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top