Click here to save this page

** Extract Structure of all DBFS in a Project



**********************************************************
** Author      : Ramani (Subramanian.G)
**               FoxAcc Software / Winners Software
** Type        : Freeware with reservation to Copyrights
** Warranty    : Nothing implied or explicit
** Last modified : 15 December, 2002
**********************************************************
** 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
**********************************************************
** EOF
**********************************************************

Home       Feedback       DataBase       VisualFoxProFAQ