Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracts Structure of all DBFS from Projects

Databases and tables

Extracts Structure of all DBFS from Projects

by  ramani  Posted    (Edited  )
*********************************************************
** gs_TableS=Extracts Structure of all DBFS from Projects
*********************************************************
** by Subramanian.G (ramani)
** FoxAcc Software
** ramani_g@yahoo.com
** Last modified : 15th December, 2002
** provided as freeware. Use at your Own Risk.
*********************************************************
** How to use .... (Example)
** 1. Copy the gs_TableS.PRG routine as given below
** 2. Open up your project in your project manager
** 3. Run the programme from Command window by typing
** DO gs_TableS
** 4. All the open projects Tables are involved
** SO if you want for one project..
** .... only keep that project open.
*********************************************************
** PROCEDURE gs_TableS
**
IF Application.Projects.Count()=0
=MESSAGEBOX("No Project Open.Exiting... ", ;
0+16,"No Active Project Available")
RETURN
ENDIF
CLOSE TABLES ALL
myFile=PUTFILE("Select a file name for the Table Structure","c:\my documents","txt")
IF EMPTY(myFile)
RETURN
ENDIF
myFile = ALLTRIM(myFile)
IF ATC(".",myFile) > 0
myFile = LEFT(myFile,ATC(".",myFile)-1)+".txt"
ELSE
myFile = myFile+".txt"
ENDIF
ERASE (myFile)
**
LOCAL cTable, i, p
FOR p = 1 TO application.Projects.Count
FOR i = 1 TO application.Projects(p).Files.Count
cTable = application.Projects(p).Files(i).NAME
IF UPPER(JUSTEXT(cTable)) = "DBC"
OPEN DATABASE (cTable)
DISPLAY TABLES TO (myFile) ADDITIVE NOCONSOLE
SELECT objectName FROM (cTable) ;
WHERE UPPER(objectType)="TABLE" ;
INTO CURSOR myCursor
SCAN
** WAIT WINDOW objectName && if you want
SELECT 0
USE (myCursor.objectName)
DISPLAY STRUCTURE TO (myFile) ADDITIVE NOCONSOLE
USE
SELECT myCursor
ENDSCAN
USE IN myCursor
ENDIF
IF UPPER(JUSTEXT(cTable)) = "DBF"
** WAIT WINDOW cTable && if you want wait status
USE (cTable)
DISPLAY STRUCTURE TO (myFile) ADDITIVE NOCONSOLE
USE
ENDIF
ENDFOR
ENDFOR
CLOSE TABLES ALL
MODIFY FILE (myFile)
RETURN
*********************************************************
** Ramani (Subramanian.G), FoxAcc, ramani_g@yahoo.com
** EOF
*********************************************************
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top