FoxPro Commands - Part 1

Submitted by Karthikeyan on

FoxPro 2.6 for MS-DOS / Windows - Basic Commands

  • FoxPro is SEMI-RDBMS
  • Unlike other RDBMS systems, in FoxPro each database can contain only one table.
  • Hence, the single table is called as database in this tutorial

foxpro front screen

In FoxPro, first four characters of any command is enough to execute

For e.g.:- crea ==> create

1. TO OPEN A DATABASE:

        Syn:

                use <dbname>

        Ex:

                use book

2.TO CLOSE THE DATABASE:

         Use

               To close the current opened database.

        Close all

               To close the all opened database.

3. To CREATE NEW DATABASE:

Syn:
                crea <dbname>   

                create <dbname>

Ex:

                crea book

 

Foxpro create db

4. To Modify Structure of the Database:

        Modify structure

                        (Or)

            Modi stru

5. To add new records in database

 Append is used to add the new record.

Syn:

          append

                       [Blank]

                       [From <dbname>]

Ex

Append  
Append Blank
- To add blank records.
Append from first.dbf
- To add the records from FIRST.DBF to SECOND.DBF
- Same Structure is required for these databases

 

6. To display the records in the current database 

 Used to display the particular record.

 Syn:

  Display

              [All]

              [Structure]

              [Status]

              [Memory]

Ex:

Display      
Display All          
Display All Records in page wise.

7. To Display the structure of the database:

Display Structure     

8. To display the status of the set commands:

Display Status

9. To display the status of the system memory variables.

Display Memory

10. To view the status bar

Set stat on

11. To edit records

EDIT

- It list all the records one by one for editing.

Any one of the record can be edited using 'FOR' as below

EDIT FOR empname = "LEELA"

EDIT FOR rollno = 103

 

12. To delete records

DELETE

- To delete current record

DELETE NEXT 4

- To delete next 4 records

After using the delete command the records marked with * (asterisk) mark, i.e., marked for deletion.

RECALL

- It is used to recover the deleted records.

e.g. RECALL

RECALL NEXT 4

PACK

- To delete the records permanently. It is used after the delete command.

BLANK

- It can be used to empty the record instead of deleting.

13. To delete all the records in the current database

ZAP

 

Comments

Submitted by Pankaj Rathi (not verified) on Mar 12, 2019 - 12:07

Permalink

I learned FoxPro when I was in Class 6. Feeling Nostalgia!

Submitted by Karthikeyan on Sep 02, 2018 - 21:58

In reply to by Deep (not verified)

Permalink

Make sure no space in folder or file name. Do not use depth directory structure. Reduce the file or folder name to 10 chars or less.

Submitted by Deep (not verified) on Sep 02, 2018 - 21:28

Permalink

Mr Karthikeyan, I have copied one particular directory which has some database folders to a system running win 10. I'm using VM to run Foxpro. I'm unable to locate one of the directory from Foxpro but the directory exists when I look from Windows Explorer. How to select that directory in Foxpro. Can you help please ?

Submitted by Haris Dojki (not verified) on Apr 22, 2016 - 15:42

Permalink

Sir I want to sequence (Re numbering voucher number) date with vcno in forpro how to squence it with command in foxpro 2.6a. I really stress with this. Plz help me.

Submitted by Karthikeyan on Feb 13, 2016 - 18:39

In reply to by Akash1000 (not verified)

Permalink

'Use' command without specifying any database name closes the current database connection.

Submitted by Akash1000 (not verified) on Feb 13, 2016 - 18:13

Permalink

My small doubt, as you mentioned command to close current database the command should be "clos db" instead of use. Pls tell me if I am wrong, i was just doubting it.

Submitted by Anwer Nathani (not verified) on May 18, 2015 - 00:16

Permalink

i want the dwanlod foxpro progrimnig

Submitted by muthu kumaran (not verified) on Jan 19, 2015 - 21:27

Permalink

i want help to foxpro open in windows 7-64bit.

Submitted by Yogesh Jadhav (not verified) on Dec 21, 2013 - 22:26

Permalink

can I get number of Karthik Sir

Submitted by Karthikeyan on Feb 18, 2013 - 18:49

In reply to by jacz (not verified)

Permalink

Please ask the question in forums with detailed information.

Submitted by jacz (not verified) on Feb 18, 2013 - 14:31

Permalink

Hi Karthik,
How we can solve the trial balance difference, even though all vouchers are listed properly...

Submitted by M.Bilal Arshed (not verified) on Jan 27, 2013 - 22:04

Permalink

i want to know about foxpro.plz help me ........................

Submitted by Karthikeyan on Jan 10, 2013 - 19:25

In reply to by ArunShah

Permalink

Ya sure, open a new question in forums and describe your problem in detail. I'll help you.

Submitted by ArunShah on Jan 10, 2013 - 17:34

In reply to by Karthikeyan

Permalink

actually i have some data base.. and i want some query.. its in dbf format will, you pls help me how to gather query from data base.

Submitted by Karthikeyan on Jan 09, 2013 - 19:46

In reply to by ArunShah

Permalink

Download from the below link, and see the readme file for installation instructions. if you have any problem in install let me know. https://www.box.com/s/zad72...

Submitted by ArunShah on Jan 09, 2013 - 11:53

Permalink

i want to learn foxpro... and pls help me to install foxpro in my win7 system..

Submitted by ms anuraj (not verified) on Oct 24, 2012 - 18:06

Permalink

exellent

Submitted by RAMYAKUMAR (not verified) on Jun 29, 2012 - 10:48

Permalink

 I am able to recollect my UG foxpro now only.very nice post by you.