*********************************************************
** 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
*********************************************************
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.