Microsoft Visual FoxPro 6.0 Database Table

Microsoft Visual FoxPro 6.0 Database Table (.dbf)

How to Create Database Table

STARTàAll ProgramsàMicrosoft Visual Studio 6.0àMicrosoft Visual FoxPro 6.0

Write in Command Window

            CREATE SCHOOL <ENTER>

1. Create the following table.

            Field Name                 Data Type               Width                          Dec

            studroll                        Numeric                      3                                 

            studname                    Character                  20

            dob                              Date                            8

            beng                            Numeric                      2

            engb                            Numeric                      2

            hist                              Numeric                      2

            geog                             Numeric                      2

            comp                            Numeric                      2

            total                              Numeric                      3

            aveg                             Numeric                      5                                  2

            grade                            Character                    4

[Use Tab key to go another box also create another label.]

Click OK

Click No

[If you want to Input Data Record click Yes, otherwise No.]

2. Change the date settings to DD/MM/YYYY format.

Write in Command Window

SET DATE BRITISH <ENTER>

3. Input the following date.

Write in Command Window

APPEND <ENTER>

STUDNAMEDOBBENGENGBHISTGEOGCOMP
ANUP MISTRI05-02-19925645637880
TAPAN PAL24-06-19906367857870
SUSMITA DAS21-02-19915645756575
RIMPA DAS12-02-19925648687058

After type all record close that window and saw status bar at the bottom of the screen.

4. List the Records.

Write in Command Window

LIST <ENTER>

[Show all record in background window.]

5. Clear the screen.

Write in Command Window

CLEAR <ENTER>

[Clear the background screen.]

6. Goto record no. 3, change the STUDNAME to SUNITA MITRA and HIST to 57.

Write in Command Window

GOTO 3 <ENTER> or 3 <ENTER>

REPLACE STUDNAME WITH “SUNITA MITRA” <ENTER>

REPLACE HIST WITH 57 <ENTER>

7. List the Records showing STUDROLL,STUDNAME,DOB,BENG,ENGB,HIST,GEOG,COMP.

Write in Command Window

LIST STUDROLL,STUDNAME,DOB,BENG,ENGB,HIST,GEOG,COMP <ENTER>

[Show all record of that specific field.]

8. Display record number 4.

Write in Command Window

GOTO 4 <ENTER> or 4 <ENTER>

DISPLAY <ENTER>

[Show only record of 4.]

9. Insert the following record next of 3.

Write in Command Window

GOTO 3 <ENTER> or 3working

INSERT <ENTER>

STUDROLL   STUDNAME              DOB          BENG ENGB HIST   GEOG COMP

         4        BIMAL KAR             04/06/1990      36      75        40        35        50

10. Display all the records.

Write in Command Window

DISPLAY ALL <ENTER>

11. Modify the structure to insert a Character field name GURDNAME having a Width of 20 before DOB.

Write in Command Window

MODIFY STRUCTURE <ENTER>

(1) Click dob

(2)Click Insert

(3)Edit that field with the given information.

(4)Click OK

Click Yes

12. Browse the Database and Edit the records in the following.

Write in Command Window

BROWSE <ENTER>

Write all information one by one as you known.

            STUDROLL               GURDNAME

            1                                  MANAJ MISTRI

             2                                  PRADIP PAL

             3                                  SUKUMAR MITRA

             4                                  BISHNU KAR

             5                                  RATAN DAS

[Don’t close that screen back to command window.]

13. Calculate Total and Average of all records.

Write in Command Window

REPLACE ALL TOTAL WITH BENG+ENGB+HIST+GEOG+COMP <ENTER>

REPLACE ALL AVEG WITH TOTAL/5 <ENTER>

14. Replace Grade with “PASS” where AVEG>=40, Otherwise “FAIL”.

Write in Command Window

REPLACE ALL GRADE WITH “PASS” FOR AVEG>=40 <ENTER>

REPLACE ALL GRADE WITH “FAIL” FOR AVEG<40 <ENTER>

15. List the Records.

Write in Command Window

LIST <ENTER>

[Then clear the background. CLEAR <ENTER>]

16.  Goto the first record in one shot.

Write in Command Window

GOTO TOP <ENTER>

[Show the status bar.]

17. Goto the last record in one shot.

Write in Command Window

GOTO BOTTOM <ENTER>

[Show the status bar.]

18. Display records where BENG=56.

Write in Command Window

DISPLAY FOR BENG=56 <ENTER>

LIST FOR BENG=56 <ENTER>

BROWSE FOR BENG=56 <ENTER>

[Show the result on background screen and browse window.]

19. Delete record number 2and 4 temporary.

Write in Command Window

GOTO 2 <ENTER> or 2 <ENTER>

DELETE <ENTER>

GOTO 4 <ENTER> or 4 <ENTER>

DELETE <ENTER>

[This command uses for temporary delete that record.]

20. Recall record no. 4.

Write in Command Window

GOTO 4 <ENTER> or 4 <ENTER>

RECALL <ENTER>

21. Permanently delete that entire temporary deleted record.

Write in Command Window

PACK <ENTER>

[This command use for permanently delete that entire temporary deleted record.]

22. Count all field names, Records and show field name of 5.

Write in Command Window

?FCOUNT() <ENTER>                       Will Display : 12

[How many field name in database file this function help to count them. Here ?means Print.]

?RECCOUNT() <ENTER>                  Will Display : 4

[How many record in database file this function help to count them. Here ?means Print.]

?FIELD(5) <ENTER>                          Will Display : BENG

[These functions help to find field name. Here ?means Print.]

23 Delete all records.

Write in Command Window

ZAP <ENTER>

[IF Yes all record of data delete permanently.]