twdesign 0 Newbie Poster

I am a Python newbie! I'm trying to list the feature classes in a dataset (Access .MDB) and then list the fields in each feature class.

I'm able to list the feature classes and I'm able to list the fields in a particular feature class if I name it specifically. For example, PARCEL is one of the feature classes listed in the dataset return. If I put "PARCEL" in the list fields criteria I get the field information for parcels. I would like to make it so that for each feature class returned it then lists the field information after it. I envisioned doing this with the list function, a loop (listing feature classes), and a sub-loop (listing fields from the feature classes. I feel like I'm close but that there is a small tweak that can be done or a more efficient way of going about this. I have listed the code below. Any help would be appreciated!
-Ty

## Import modules
import win32com.client, os.path, sys
gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")

## Set workspace
gp.workspace = "C:\\Temp\\Zoning_Update_Final_060908.mdb"

#### List Datasets
dsList = gp.ListDatasets ("*", "all")
ds = dsList.Next()
while ds <> "":
    print "DATASET:",ds
    ds = dsList.Next()

## Set New workspace
gp.workspace = "C:\\Temp\\Zoning_Update_Final_060908.mdb\\Layers"

## List Featureclasses
fcList = gp.ListFeatureClasses ("*", "all")
fc = fcList.Next()
while fc <> "":
    print fc
    fc = fcList.Next()

fList = gp.ListFields ("Parcel", "*", "all")
f = fList.Next()
while f <> None:
    print "NAME:",f.Name
    print "TYPE:",f.Type
    print "LENGTH:",f.Length
    print "PRECISION:",f.Precision
    print "SCALE:",f.Scale
    print "NULL:",f.IsNullable
    print "DOMAIN:",f.Domain
    f = fList.Next()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.