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>
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-1-1024x555.png)
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
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-2.png)
[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>
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-3-1024x553.png)
3. Input the following date.
Write in Command Window
APPEND <ENTER>
STUDNAME | DOB | BENG | ENGB | HIST | GEOG | COMP |
ANUP MISTRI | 05-02-1992 | 56 | 45 | 63 | 78 | 80 |
TAPAN PAL | 24-06-1990 | 63 | 67 | 85 | 78 | 70 |
SUSMITA DAS | 21-02-1991 | 56 | 45 | 75 | 65 | 75 |
RIMPA DAS | 12-02-1992 | 56 | 48 | 68 | 70 | 58 |
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-4-1024x552.png)
After type all record close that window and saw status bar at the bottom of the screen.
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-5-1024x241.png)
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>
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-7-1024x553.png)
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
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-8-1024x553.png)
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
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-9-1024x553.png)
(3)Edit that field with the given information.
(4)Click OK
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-10-1024x553.png)
Click Yes
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-11-1024x552.png)
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
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-12-1024x553.png)
[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>
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-13-1024x553.png)
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>
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-14-1024x552.png)
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.]
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-15-1024x553.png)
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.]
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-16.png)
20. Recall record no. 4.
Write in Command Window
GOTO 4 <ENTER> or 4 <ENTER>
RECALL <ENTER>
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-17.png)
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.]
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-18.png)
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.]
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-19-1024x553.png)
23 Delete all records.
Write in Command Window
ZAP <ENTER>
[IF Yes all record of data delete permanently.]
![](http://www.samasto.in/wp-content/uploads/2021/03/VS-Database-Table-20-1024x553.png)