Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Database Structure Report
Message
From
28/01/2002 04:41:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/01/2002 04:17:29
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00611391
Message ID:
00611400
Views:
27
>>
>>Srdjan,
>>You could use home()+'tools\gendbc\gendbc' to get a programmatic version of your database.
>>Cetin
>
>Thks for fast response,
>but what I want is something to print table fields,captions,comments indexes etc
>in more reporting manner. Simmilar with what Stonefield has but freeware :-))
>I used to hv one but I lost it somewhere ...
>Thks++

Then here is partial code of my dictionary creator. For my own purposes all dbf were lying in same directory + I needn't table level info (like default, comment...). You might tweak the code easily to get what you want :
Note : Collecting free tables. You need to adjust for nonfree.
Create cursor crsSTRUCTS ;
  (FIELD_NAME c(128) nocptrans, ;
  FIELD_TYPE c(1), ;
  FIELD_LEN N(3, 0), ;
  FIELD_DEC N(3, 0), ;
  FIELD_NULL L, ;
  FIELD_NOCP L, ;
  _TABLENAME M nocptrans)
Create cursor crsINDEXES ;
  (TAG_NAME c(10) nocptrans, ;
  KEY_EXPR M, ;
  NDXTYPE c(1), ;
  IS_DESC L, ;
  FILTEREXPR M nocptrans, ;
  _TABLENAME M nocptrans)
Select 0
lnTables = adir(arrTables,tcDataDir+'*.dbf')
For ix=1 to lnTables
  Use (tcDataDir+arrTables[ix,1])
  If empty(cursorgetprop('Database'))
    lnFields=afields(arrStruc)
    For jx=1 to lnFields
      arrStruc[jx,7]=arrTables[ix,1]
    Endfor
    Insert into crsSTRUCTS from array arrStruc
    Release arrStruc
    If tagcount()>0
      Dimension arrIndexes[tagcount(),6]
      For jx=1 to tagcount()
        arrIndexes[jx,1] = tag(jx)
        arrIndexes[jx,2] = key(jx)
        arrIndexes[jx,3] = iif(Primary(jx),'P',;
            iif(Candidate(jx),'C',iif(unique(jx),'U','R')))
        arrIndexes[jx,4] = descending(jx)
        arrIndexes[jx,5] = sys(2021,jx)
        arrIndexes[jx,6] = arrTables[ix,1]
      Endfor
      Insert into crsINDEXES from array arrIndexes
    Endif
  Endif
  Use
Endfor
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform