INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Databases and tables

Extracts Structure of all DBFS from Projects by ramani
Posted: 16 Dec 02 (Edited 16 Dec 02)

*********************************************************
** 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
*********************************************************

Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close