Visual FoxPro 6.0
This presentation is the property of its rightful owner.
Sponsored Links
1 / 404

Visual FoxPro 6.0 程序设计教程 PowerPoint PPT Presentation


  • 318 Views
  • Uploaded on
  • Presentation posted in: General

Visual FoxPro 6.0 程序设计教程. 第 1 章至第 6 章. 高等教育出版社. 编辑:朱梦环 郝德全 王洪 吴震林 达县职业高级中学. 第 1 章 Visual FoxPro 基础知识. 目 录. 第 2 章 基本数据元素. 第 3 章 数据库的基本操作. 第 4 章 数据处理与 SQL. 第 5 章 程序设计基础. 第 6 章 查询与视图. 第 1 章 Visual FoxPro 6.0 概述. 学习要点 1 、数据库的基本术语和概念。 2 、 常用文件类型和数据类型 3 、 Visual FoxPro 的命令格式。

Download Presentation

Visual FoxPro 6.0 程序设计教程

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Visual foxpro 6 0

Visual FoxPro 6.0

16


Visual foxpro 6 0

1 Visual FoxPro

2

3

4 SQL

5

6


Visual foxpro 6 0

1 Visual FoxPro 6.0

1

2

3Visual FoxPro

4 Visual FoxPro

5


Visual foxpro 6 0

1 Visual FoxPro 6.0

1.1 Visual FoxPro 6.0

1.2

1.3

1.4


Visual foxpro 6 0

1.1 Visual FoxPro 6.0

119866FoxBASE+ 1.0

219877FoxBASE+ 2.0

319887FoxBASE+ 2.1

41992FoxPro 2.5

51994FoxPro 2.6

619956Visual FoxPro 3.0

719968Visual FoxPro5.0

819989Visual FoxPro6.0


Visual foxpro 6 0

1.2

1.2.1

1.2.2

1.2.3

1.2.4


Visual foxpro 6 0

1(DatabaseDB)

2(Database Management SystemDBMS)(OS)

3

4Database SystemDBS

DBSDBMSDB


Visual foxpro 6 0

33VFP6


Visual foxpro 6 0

A1B1C1A2B2C2D234


Visual foxpro 6 0


Visual foxpro 6 0

1-2

1-3


Visual foxpro 6 0

1-5

1-61-41-5


Visual foxpro 6 0

1.2.3

1

-(E-R)

2

3-(Entity-Relationship Model)

P.PS.Chen1976E-R


Visual foxpro 6 0

1

N

N

N

1

N

M

1

N

N

E-R

E-R

1MN


Visual foxpro 6 0

4Relational Model

()

5Object Relational Model

1

2


Visual foxpro 6 0

1.2.4

1

1

StudentStudent_IDNameSexBirthdayClassesDormitoryPhonenumber Student (Student_IDNameSexBirthdayClassesDormitoryPhonenumber)

k(k1)k

1-8Student


Visual foxpro 6 0

Sex{}Student_IDPhonenumber

()


Visual foxpro 6 0

2

3

4

5

6


Visual foxpro 6 0

7

KR1R2R2KR1

8

9

3

()

3


Visual foxpro 6 0

2

1Projection

RR

PROJECT 12n

ARRA

1-1 1-9S1

PROJECT S1,

()

1-10


Visual foxpro 6 0

2

RRFSelect

SELECT WHERE

F(R)

1-2 1-9S1

SELECT S1 WHERE =

1-11


Visual foxpro 6 0

R

S

3

RSFRSJoin

JOIN 1 AND 2 WHERE

F=ABF><=ABRASB

RS3.113.12

JOIN R AND S WHERE B<D


Visual foxpro 6 0

1.3 VFP6

1 .PJT .PJX

2 .DBC .DCT

1.3.1

3 .DBF .FPT

4 .PRG .FXP

5.IDX .CDX

6.MEM

7.FMT

8.FRX .FRT

9 .LBX .LBT

10 .TXT

11 .MNT .MNX .MPR .MPX

12 .SCX .SCT


Visual foxpro 6 0

1.3.2 VFP6

1Character,C

2Numeric,N

3Logic,L

4DateD

5MemoM

6GeneralG


Visual foxpro 6 0

1.4

1.4.1

1.4.2

1.4.3 VFP6


Visual foxpro 6 0

1.4.1

USE Grade

COUNT ALL FOR <60

LIST ALL , FOR ; <60 TO PRINTER

USE

1GRADE

2GRADE60

360

4GRADE


Visual foxpro 6 0

Visual FoxPro

<>

[<>]

[<>]

[FOR<>]

[WHILE<>]

[TO FILE <>/TO PRINTER/TO ARRAY <>/TO <>]

[ALL [LIKE/EXCEPT <>]]

[IN <>]


Visual foxpro 6 0

VFP

ALL

NEXT <n> N

RECORD <n> N

REST

FOR <>

WHILE <>

TO

ALL [LIKE/EXCEPT <>]

IN </>


Visual foxpro 6 0

1.4.2

1

2VFP44

32048;

4


Visual foxpro 6 0

1.4.3 VFP6

10*/128.3

ABC_DE-f1

.DBF


Visual foxpro 6 0

[]

<>

/


Visual foxpro 6 0

VFP6VFP6VFP6


Visual foxpro 6 0

2

1

2

3

4

5

2.1

2.2

2.3

2.4


Visual foxpro 6 0

2.1

1VFP6

2Visual FoxPro 6.0


Visual foxpro 6 0


Visual foxpro 6 0

3VFP6

VFP6VFP6VFP6VFP6

VFP6|

VFP6QuitEnter

VFP6

4

1

Visual FoxPro

2

VFP6Wizard.app


Visual foxpro 6 0

2.2

2.2.1

Visual FoxPro:

2.2.2


Visual foxpro 6 0

2.2.3

1

Visual FoxPro

S1

S(1)

Visual FoxPro


Visual foxpro 6 0

2

DIMENSION <1><>[<>][<2> <>[,<>]]

DECLARE <1><>[<>][<2> <>[,<>]]

DIMENSIONDECLARE

<1>

<>[<>]

1

2

3


Visual foxpro 6 0

4

5

6DIMENSIONDECLAREDIMENSION

DIMENSION <1><>[<>][<2> <>[,<>]]

DIMENSION A 2 , 3 , BB ( 4 , 8 )

DIMENSION A(2,3),BB(4,8)

DIMENSION A(2,3)

DIMENSION A(6)


Visual foxpro 6 0

3

STORE <> TO </>

STORE 0 TO A 0A

STORE "" TO A(2,1) A21

</>=<>

A=.T. A


Visual foxpro 6 0

2.1 VFP

1

STORE <> TO <>

STORE 0 TO AA,BB,CC 0AA,BB,CC

STORE "" TO NAME NAME

<>=<>

A=.T. A


Visual foxpro 6 0

2

LIST MEMORY [LIKE<>] [TO PRINTER[PROMPT]/TO FILE<>] [NOCONSOLE]

LIST

MEMORYLIST

LIKE<>

TO PRINTER[PROMPT]

TO FILE<>

NOCONSOLE


Visual foxpro 6 0

DISPLAY MEMORY [LIKE <>] [TO PRINTER[PROMPT]/TO FILE<>] [NOCONSOLE]

DISPLAY

LIST

LIST MEMORYDISPLAY MEMORY

LIST MEMORY

DISPLAY MEMORY


Visual foxpro 6 0

LIST MEMORYDISPLAY MEMORY

LIST MEMORY

LIST MEMORY


Visual foxpro 6 0

LIST MEMORYDISPLAY MEMORY

DISPLAY MEMORY

DISPLAY MEMORY


Visual foxpro 6 0

3

SAVE TO <>/ <MEMO >[ALL LIKE/ EXCEPT <>]

<> .MEM

SAVE

<>

<MEMO>

ALL LIKE<>]<>

ALL EXCEPT <>]<>


Visual foxpro 6 0

SAVE

SAVE TO VAR1 VAR1.MEMAABBCCNAMEA

SAVE TO VAR2 ALL LIKE ?A* AVAR2.MEMAANAME

SAVE TO VAR3 ALL EXCEPT ?A*AVAR2.MEMBBCCA


Visual foxpro 6 0

4

RELEASE <>

<>,

RELEASE ALL [LIKE/EXCEPT <>]

CLEAR MEMORY

RELEASE ALL


Visual foxpro 6 0

RELEASE BB,CC

LIST MEMORY LIKE *

RELEASE ALL LIKE ?A*

LIST MEMORY LIKE *

RELEASE ALL

LIST MEMORY LIKE *


Visual foxpro 6 0

5

RESTORE FROM <> [ADDITIVE]

<>

RESTORE

FROM <>

[ADDITIVE] ADDITIVE


Visual foxpro 6 0

RESTORE FROM VAR1

LIST MEMORY LIKE *

RESTORE FROM VAR2

LIST MEMORY LIKE *

RESTORE FROM VAR3 ADDITIVE

LIST MEMORY LIKE *


Visual foxpro 6 0

2.3

2.3.1

2.3.2

2.3.3


Visual foxpro 6 0

2.3.1

C N

L D

<>

??<>

??


Visual foxpro 6 0

2.3.2

()

1

1 +NNN 2 -NNN

3 * NNN 4 /NNN

5 ** NNN 6 ^ NNN

7 %NNN

1

2


Visual foxpro 6 0

1 < NNLCCLDDL

2 > NNLCCLDDL

3 = NNLCCLDDL

4 <= NNLCCLDDL

5 >= NNLCCLDDL

6 <> NNLCCLDDL

7 # NNLCCLDDL

8 != NNLCCLDDL

9 $ CCL

10 == CCL


Visual foxpro 6 0

(1) .NOT. LL

(2) LL

(3) .AND. LLL

(4) .OR. LLL

(1) + CCC

(2) - CCC

(1) +DNDNDD

(2) -DDNDND


Visual foxpro 6 0

2.3.3

+-

+-

**^

*/%

+-

+-

.NOT.

<>=<=>=<>#!=$==

.AND.

.OR.


Visual foxpro 6 0

2.4

2.4.1

2.4.2

2.4.3

2.4.4

2.4.5

2.4.6


Visual foxpro 6 0

2.4.1

1.

ABS(<nExpression>)

<nExpression>

<nExpression>ABS( )

2.

SIGN(<nExpression>)

101

<nExpression>SIGN( )SIGN( )1100


Visual foxpro 6 0

3.

INT(<nExpression>)

<nExpression>INT( )

4.

SQRT(<nExpression>)

<nExpression>SQRT( )

5.

EXP(<nExpression>)

e

<nExpression>exx


Visual foxpro 6 0

6.

LOG(<nExpression>)

EXP

<nExpression>LOG( )ex=<nExpression>x<nExpression>0

7.

LOG10(<nExpression>)

10

<nExpression>LOG10( )10x=<nExpression>x<nExpression>0

8.

CEILING(<nExpression>)

<nExpression>CEILING( )


Visual foxpro 6 0

9.

FLOOR(<nExpression>)

<nExpression>FLOOR( )

10.

MAX(<eExpression1><eExpression2>[<eExpression3>])

<eExpression1><eExpression2>[<eExpression3>]MAX( )

11.

MIN(<eExpression1><eExpression2>[<eExpression3>])


Visual foxpro 6 0

12.

ROUND(<nExpression1><nExpression2>)

<nExpression1><nExpression2><nExpression2>ROUND( )<nExpression2>2()0

13.

RAND([<nExpression>])

(0,1)

<nExpression>RAND( )

14.

PI()


Visual foxpro 6 0

15.

MOD(<nExpression1><nExpression2>)

<nExpression1><nExpression2>

<nExpression1><nExpression2>

<nExpression2>

<nExpression2>

MOD()%

<nExpression1><nExpression2><nExpression1><nExpression2><nExpression1><nExpression2>

? MOD(132,11) 0

? MOD(132.45,11.56) 5.29

? MOD(-132.45,11.56) 6.27

? MOD(132.45,-11.56) -6.27

? MOD(-132.45,-11.56) -5.29


Visual foxpro 6 0

2.4.2

1.

1&<VarName>[.< cExpression>]

&&<VarName>

&.&<VarName>.

abcd=[Visual]

VisualFoxpro=[]

Visual=123456789

"&abcd.FoxPro" VisualFoxPro (C)

? &abcd.Foxpro (C)

? Abcd 123456789 (N)


Visual foxpro 6 0

2(<VarName>)

( )&

<VarName>

tableName=[Student]

use (tablename) &&Student

3EVALUATE(<cExpression>)

<cExpression>

<cExpression>VFP6<cExpression>255EVALUATE( )&EVALUATE( )


Visual foxpro 6 0

2.

1AT(<cSearchExpression>,<cExpressionSearched> [,<nOccurrence>])

n

<cSearchExpression>AT( )<cExpressionSearched><nOccurrence><cSearchExpression><cExpressionSearched><nExpression>

<nOccurrence><cSearchExpression>

<cExpressionSearched><cSearchExpression><nOccurrence>0

AT( )2

2ATC(<cSearchExpression>,<cExpressionSearched> [,<nOccurrence>])


Visual foxpro 6 0

3.

RAT(<cSearchExpression>,<cExpressionSearched> [,<nOccurrence>])

AT( )<cSearchExpression><cExpressionSearched><nOccurrence>

<nOccurrence>RAT( )<cExpressionSearched>< cSearchExpression ><nOccurrence><nExpression>=1<cExpressionSearched><cSearchExpression>RAT( )0

4.

RATC(<cSearchExpression>,<cExpressionSearched> [,<nOccurrence>])

<cSearchExpression><cExpressionSearched><nOccurrence>

<cExpressionSearched><cSearchExpression><nOccurrence>0


Visual foxpro 6 0

5.

SUBSTR(<cExpression>,<nStartPosition> [, <nCharactersReturned>])

<cExpression><nStartPosition><nCharactersReturned>

<nCharactersReturned><nCharactersReturned>

6.

LEFT(<cExpression>,<nExpression>)

<cExpression><nExpression>

<cExpression>LEFT( )<nExpression><cExpression><nExpression><cExpression><nExpression>LEFT()1SUBSTR( )


Visual foxpro 6 0

7.

RIGHT(<cExpression>,<nExpression>)

<cExpression><nExpression>

<cExpression>LEFT( )<nExpression><cExpression><nExpression><cExpression><nExpression>

8.

TRIM(<cExpression>)

<cExpression>

TRIM( )RTRIM( )

9.

RTRIM(<cExpression>)

RTRIM( )TRIM( )


Visual foxpro 6 0

10.

ALLTRIM(<cExpression>)

<cExpression>LTRIM (RTIMR(< cExpression>))

ALLTRIM( )

11.

LEN(<cExpression>)

<cExpression>,

12.

SPACE(<nExpression>)

<nExpression>

13.

REPLICATE(<cExpression>,<nExpression>)

<cExpression><nExpression>


Visual foxpro 6 0

14.

STUFF(<cExpression>,<nStartReplacement>,<nCharacters-Replaced>, <cReplacement>)

<cExpression><nStartReplacement><cExpression><nCharactersReplaced>0<cReplacement><cExpression><cReplacement><cExpression><nCharactersReplaced>


Visual foxpro 6 0

2.4.3

1.

TIME([<nExpression>])

248()

<nExpression>1/100 s<nExpression>1/18sSECONDS( )

2.

DATE( )

3.

DMY(<dExpression | tExpression>)

..22

<dExpression>

<tExpression>


Visual foxpro 6 0

4.

MDY(<dExpression | tExpression>)

..October 05 2000

5.

YEAR(<dExpression>)

<dExpression>

CENTURY

6.

MONTH(<dExpression>)

<dExpression>

7.

DAY(<dExpression>)

<dExpression>

DAY( )131


Visual foxpro 6 0

2.4.4

1.

UPPER(<cExpression>)

<cExpression>

2.

LOWER(<cExpression>)

<cExpression>

3.

PROPER(<cExpression>)

<cExpression>

4.

CTOD(<cExpression>)

<cExpression>


Visual foxpro 6 0

5.

DTOC(<dExpression | tExpression> [,1])

<dExpression | tExpression>[,1]

6.

STR(<nExpression>[,<nLength>[,<nDecimalPlaces>]])

<nExpression>

<nLength><nDecimalPlaces>(*)*<nDecimalPlaces><nLength><nExpression>


Visual foxpro 6 0

7.

VAL(<cExpression>)

<cExpression>

8. ASCII

ASC(<cExpression>)

<cExpression>ASC

9. ASCII

CHR(<nExpression>)

<nExpression>ASC1~255

7

? CHR(7)+""&&


Visual foxpro 6 0

2.4.5

1.

DBC( )

2.

DBF([<cTableAlias | nWorkArea>])

<cTableAlias><nWorkArea>

3.

LUPDATE([<cTableAlias> | <nWorkArea>])

4.

FDATE(<cFileName> [, <nType>])

<cFileName><nType>010


Visual foxpro 6 0

5.

FCOUNT([<nWorkArea>|<cTableAlias>])

0VFP6

6.

FIELD(<nExpression>[,<nWorkArea>|<cTableAlias>])

<nExpression>

<nWorkArea>|<cTableAlias>

VFP6


Visual foxpro 6 0

7.

FSIZE(<cFieldName>[,<nWorkArea>|<cTableAlias>])

<cFieldName><nWorkArea>|<cTableAlias>

8.

RECCOUNT([<nWorkArea>|<cTableAlias>])

<nWorkArea>|<cTableAlias>0VFP6

9.

RECSIZE([<nWorkArea>|<cTableAlias>])

<nWorkArea>|<cTableAlias>


Visual foxpro 6 0

10.

RECNO([<nWorkArea>|<cTableAlias>])

<nWorkArea>|<cTableAlias>

11.

BOF([<nWorkArea>|<cTableAlias>])

()

<nWorkArea>|<cTableAlias>

12.

EOF([<nWorkArea>|<cTableAlias>])

()

<nWorkArea>|<cTableAlias>


Visual foxpro 6 0

13.

DELETED([<nWorkArea>|<cTableAlias>])

.T..F.

<nWorkArea>|<cTableAlias>DELETED( ).F.

14.

FOUND([<nWorkArea>|<cTableAlias>])

LOCATECONTINUEFINDSEEK.T..F.

<nWorkArea>|<cTableAlias>

15.

ALIAS([<nWorkArea>|<cTableAlias>])

<nWorkArea>|<cTableAlias>


Visual foxpro 6 0

16.

SELECT([0/1])

01

17.

1TYPE(<cExpression>)

CNLDMYTOGSU

2VARTYPE(eExpression [, lNullDataType])

CNLDYTOGXNullU

TYPE()VARTYPE()TYPE()VARTYPE()TYPE()VARTYPE()


Visual foxpro 6 0

18.

EMPTY(<eExpression>)

<eExpression>.T..F.

19.

ISNULL(<eExpression>)

Null.T..F.

<eExpression>

20.

ISBLANK(<eExpression>)

<eExpression>


Visual foxpro 6 0

21.

OCCURS(<cSearchExpression>,<cExpressionSearched >)

<cSearchExpression><cExpressionSearched >

<cExpressionSearched><cSearchExpression>0

22.

FILE(<cFileName>)

.T..F.

<cFileName>

23.

ISALPHA(<cExpression>)

<cExpression>.T..F.


Visual foxpro 6 0

24.

ISLOWER(<cExpression>)

<cExpression>.T..F.

25.

ISUPPER(<cExpression>)

<cExpression>.T..F.

26.

ISDIGIT(<cExpression>)

<cExpression>(09).T..F.

27.

IIF(<lExpression>,<eExpression1>,<eExpression2>)

<lExpression>

<lExpression>.T.<eExpression1><eExpression2>


Visual foxpro 6 0

28.

BETWEEN(<eTestValue>,<eLowValue>,<eHighValue>)

<eTestValue><eLowValue><eHighValue>.T..F.<eLowValue><eHighValue>NullNull

2.4.6

1.

USED(<nWorkArea>|<cTableAlias>)

<nWorkArea>/<cTableAlias>.T.


Visual foxpro 6 0

2.

CREATEOBJECT(<ClassName>[,<eParameter1>,<ePara-meter2>])

OLE

<ClassName>OLE

3.

DODEFAULT(<eParameter1>[,<eParameter2>])

<eParameter1>[,<eParameter2>]

4.

MESSAGE([1])


Visual foxpro 6 0

5.

MESSAGEBOX(<cMessageText>[,<nDialogBoxType> [,<cTitle-BarText > ]])

mm=messagebox(MESSAGEBOX()+CHR(13)+",3+64+256,"MessageBox()")

-1-2-3-4-5-6-7


Visual foxpro 6 0

1VFP6

2VFP6

2VFP6


Visual foxpro 6 0

3

1

2

3

4


Visual foxpro 6 0

3

3.1

3.2

3.3

3.4

3.5

3.6


Visual foxpro 6 0

3.1

3.1.1

3.1.2

3.1.3

3.1.4


Visual foxpro 6 0

3.1.1

VFPControl Center

1VFP

2VFP

Gxglxt

CREATE PROJECT <|?>

<>VFP.PJX

<?>


Visual foxpro 6 0

.APP.EXE


Visual foxpro 6 0


Visual foxpro 6 0

3.1.2

1

Event loop

3-1:

DO Setup &&

DO MainMenu.mpr &&

READ EVENTS &&

DO cleanup &&

MainMenu.mprCLEAR EVENTS


Visual foxpro 6 0

2

External libraryprocedure

3

DODO FORM

4

READ EVENTSCLEAR EVENTS

5

SETSET TALKCtalkVal

CtalkVal=SET (Talk)

TALK

SET TALK &CtalkVal


Visual foxpro 6 0

3.1.3


Visual foxpro 6 0

3.1.4

1

2

3

4

1

2

3

4


Visual foxpro 6 0

3.2

3.2.1

3.2.2

3.2.3

3.2.4

3.2.5

3.2.6


Visual foxpro 6 0

3.2.1

1VFP

2

StudentGrade

3

Student

4

5


Visual foxpro 6 0

3.2.2

Gxglxt


Visual foxpro 6 0

3.2.3

Gxglxt

StudentGradeStudentGrade

Specialty


Visual foxpro 6 0

3.2.4

VFPnull


Visual foxpro 6 0

3.2.5

VFP

VFP


Visual foxpro 6 0

3.2.6


Visual foxpro 6 0

3.3

3.3.1

3.3.2


Visual foxpro 6 0

3.3.1


Visual foxpro 6 0

3.3.2

1

2

.DBF

OPEN DATABASEEXCLUSIVE


Visual foxpro 6 0

3.4

3.4.1

3.4.2

3.4.3


Visual foxpro 6 0

3.4.1

GxglxtStudent


Visual foxpro 6 0

3.4.2

CREATE <>

Enter

<>

Enter

CREATE.FPT

.DBF


Visual foxpro 6 0

A-J

Student.dbf

VFP|Alt+FCtrl+ NCtrl+N VFP


Visual foxpro 6 0

|


Visual foxpro 6 0

3.4.3

1

LIST STRUCTURE [TO PRINTER[PROMPT] /TO FILE<>]

DISPLAY STRUCTURE [TO PRINTER[PROMPT] /TO FILE<>]

[TO PRINTER][PROMPT][PROMPT]TO PRINTER

[TO FILE]


Visual foxpro 6 0

LIST STRUCTUREDISPLAY STRUCTURE

DISPLAY STRUCTURE

LIST STRUCTURE

Student

USE Student

LIST STRUCTURE


Visual foxpro 6 0

2

MODIFY STRUCTURE

NULL

(1)

Ctrl+D

Ctrl+W


Visual foxpro 6 0

(2)

Ctrl+I

Ctrl+W

(3)

MODIFY STRUCTURECREATE


Visual foxpro 6 0

3

COPY STRUCTURE TO <> [FIELDS <>]

<>

<>

FIELDS <>

FIELDS <>

4

1

COPY STRUCTURE TO <> EXTENDED


Visual foxpro 6 0

Studentstudstr

USE Student

COPY STRUCTURE TO studstr EXTENDED

USE studstr

LIST STRUCTURE


Visual foxpro 6 0

2

CREATE <> FROM <>

studstrStudent1

CREATE Student1 FROM studstr

USE Student1

LIST STRUCTURE


Visual foxpro 6 0

3.5

3.5.1

3.5.2

3.5.3

3.5.4

3.5.5

3.5.6

3.5.7


Visual foxpro 6 0

3.5.1

USE [<>] [EXCLUSIVE] [SHARED]

<>

[EXCLUSIVE]

[SHARED]

FPT

ALIAS<>


Visual foxpro 6 0

3.5.2

APPEND [BLANK]

[BLANK]


Visual foxpro 6 0

CREATE

APPENDAPPEND BLANKAPPENDVFP

|


Visual foxpro 6 0

3.5.3

VFP

1

GOTO [RECORD <> ] /TOP/BOTTOM

GO [RECORD <> ] /TOP/BOTTOM

<>

<>

TOP

[BOTTOM]

RECORD<>0


Visual foxpro 6 0

2

SKIP [<>]

<>

1<><>

2<>SKIP SKIP 1


Visual foxpro 6 0

3.5.4

1INSRET

INSERT [BLANK] [BEFORE]

[BEFORE]

[BLANK]

1

2VFPINSERTINSERT


Visual foxpro 6 0

2INSERTSQL

INSERT INTO <>[(<1> [<2>])] VALUES (<1>[,<2>])

INSERT INTO <> FROM ARRAY <>/ FROM MEMVAR

<><>

[(<1> [<2>])]

[VALUES (<1>[,<2>])]

[FROM ARRAY <>]

FROM MEMVAR


Visual foxpro 6 0

1<>VFP

2VALUES

3FROM ARRAY <><>

4FROM MEMVAR

INSERTSQLStudent


Visual foxpro 6 0

INSERT INTO Student(,,,,,,;

) VALUES("99045002","","",{^1980/03/22},;

"99","3-311","2356306")

3

APPEND FROM <>/ [FIELDS <>] [FOR <>]

<>

[<>]

[FIELDS <> ]

[FOR <>]<>FOR


Visual foxpro 6 0

3.5.5

LIST [OFF] [FIELDS <>] [<>] [FOR <>] [WHILE <>] [TO PRINTER [PROMPT] / TO FILE <>]

DISPLAY [OFF] [FIELDS <>] [<>] [FOR <>] [WHILE <>] [TO PRINTER [PROMPT] / TO FILE <>]

[OFF]OFF

[<>]ALLRECORDN [ NEXTNREST

FIELDS <><><>50


Visual foxpro 6 0

[FOR<>/WHILE<>]<>

[TO PRINTER [PROMPT] / TO FILE <>]TO PRINTER [PROMPT][PROMPT]TO FILE <>

LISTDISPLAY

(1)DISPLAYLIST

(2)DISPLAYNEXT 1LISTALL


Visual foxpro 6 0

3.5.6

1

(1)


Visual foxpro 6 0

VFP


Visual foxpro 6 0

2

BROWSE [FIELDS <>] [LOCK <>] [LAST] [FOR <>]

[Fields<>]

LOCK <>

LAST

FOR <>

1BROWSEBROWSE


Visual foxpro 6 0

2<>

VFP

10

<>=<>

BROWSE FIELDS NAME_BIRTH=+":"++":"+DTOC()+""


Visual foxpro 6 0

:H

BROWSE FIELDS NAME_BIRTH=+":"++":"+ ; DTOC()+"":H="" ,


Visual foxpro 6 0

2

REPLACE <1> [ADDITIVE] [,<2> WITH <2> [ADDITIVE]] [<>] [FOR <>] [WHILE <>]

<1>

WITH <1>

<>

FOR <>

WHILE <>

WITHWITH


Visual foxpro 6 0

3.5.7

VFP

1

DELETE [<>] [FOR <>] [WHILE <>]

GO 7

DELETE

GO 4

DELETE NEXT 3

LIST


Visual foxpro 6 0

2

PACK [DBF] [MEMO]

DBFMEMOPACK

PACKPACK

PACK

LIST


Visual foxpro 6 0

3

RECALL [<>] [FOR <>] [WHILE <>]

*

(Student)

RECALL ALL

BROW

4

ZAP

ZAPDELETE ALL PACKZAP


Visual foxpro 6 0

3.6

1

SCATTER [FIELDS <>/FIELDS LIKE <>/FIELDS EXCEPT <>] [MEMO] TO <>/ TO <> BLANK/MEMVAR/NAME <>

scatter fields student_id,name,sex,classes to abc

list memory like *


Visual foxpro 6 0

2

GATHER FROM [<>/<MEMVAR>]/[<NAME >] [FIELDS <>/ FIELDS LIKE <>/FIELDS EXCEPT <>]

dime aa(7)

aa(1)="1999045003"

aa(2)=""

aa(3)=99

append blank

Gather from aa fields Student_id,name,classes


Visual foxpro 6 0

3

COPY TO ARRAY <> [FIELDS <>] [<>] [FOR <>] [WHILE <>][NOOPTIMIZE]

SCATTER


Visual foxpro 6 0

4

APPEND FROM ARRAY <> [FOR <>] FIELDS <>

M

FIELDS <><><>

EMPTY().T.


Visual foxpro 6 0

1CREATE PROJECT

2

3

4

5

6CREATECOPY STRUCTURECREATEFROM

7MODIFY STRUCTURE

8APPENDINSERT INTODELETEBROWSEREPLACE

9


Visual foxpro 6 0

4SQL

1

2

3

4

5SQL


Visual foxpro 6 0

4 SQL

4.1

4.2

4.3

4.4

4.5

4.6 SQL


Visual foxpro 6 0

4.1

SORT TO <> ON <1> [/A | /D] [/C] [,<2> [/A | /D] [/C] ...] [ASCENDING|DESCENDING] [<>] [FOR <>] [WHILE <>] [FIELDS <>| FIELDS LIKE <> | FIELDS EXCEPT <>]

<>

ON <1>

[/A | /D] [/C]/A/D/C/C/A/D


Visual foxpro 6 0

[ASCENDING]/D

[DESCENDING]/AASCENDING DESCENDING

[<>]ALL

[FOR <>]

[WHILE <>]<>

[FIELDS <>]SORTFIELDS

[FIELDS LIKE <>]

[FIELDS EXCEPT <>]


Visual foxpro 6 0

4.2

VFP

Null


Visual foxpro 6 0

1

2

3

4.2.1

1

INDEX ON <> TO <> [UNIQUE] FOR <>[ADDITIVE]

<>.IDX

<>


Visual foxpro 6 0

<>

[UNIQUE]UNIPUE<>

[ADDITIVE]ADDITIVE

FOR <><>


Visual foxpro 6 0

1

2

3

4

USE STUDENT

INDEX ON TO XHSY

LIST


Visual foxpro 6 0

2

INDEX ON <> TAG <> [OF <>][FOR <>] [ASCENDING | DESCENDING] [UNIQUE][ADDITIVE]

.CDX

<>[FOR <>][ADDITIVE]

TAG <> [OF <>]TAG <>[OF <>]


Visual foxpro 6 0

TAG <>[OF <>]

[ASCENDING | DESCENDING]ASCENDING DESCENDING

[UNIQUE].IDX.CDXUNIQUE

DESCENDINGASCENDING


Visual foxpro 6 0

3

1


Visual foxpro 6 0


Visual foxpro 6 0

2


Visual foxpro 6 0

4.2.2

1

1

USE <> INDEX <> [ORDER <>/ <>/[TAG] <> [OF <>]] [ASCENDING/ DESCENDING]

<>

<>ORDERORDER


Visual foxpro 6 0

2ORDERORDER <>

3ORDER [TAG] <> [OF <>]ORDER

4ORDER <><>


Visual foxpro 6 0

(2)

SET INDEX TO [<>/] [ORDER <>/<>/[TAG] <> [OF <>]] [ASCENDING/DESCENDING] [ADDITIVE]

<>

[ORDER <>]


Visual foxpro 6 0

0

[ORDER <>]

[ORDER [TAG] <> [OF <>]][OF <>]

[ASCENDING/ DESCENDING][ASCENDING/ DESCENDING]ORDER

[ADDITIVE]SET INDEX


Visual foxpro 6 0

SET INDEX

SET INDEX TO

2

SET ORDER TO [<>/<>/[TAG] <> [OF <>] [ASCENDING/DESCEN-DING]


Visual foxpro 6 0

<>USESET INDEX

<>

[TAG] <> [OF <>][OF <>]

[ASCENDING/DESCENDING]

SET ORDER TO

VFPSET ORDERASCENDINGDESCENDINGSORT ON ASCENDINGDESCENDING


Visual foxpro 6 0

0

3

()

REINDEX

REINDEXUNIQUEINDEXSET UNIQUE ONUNIQUE


Visual foxpro 6 0

4.3

4.3.1

4.3.2

4.3.3


Visual foxpro 6 0

4.3.1

1LOCATE

LOCATE [<>] [FOR <>] [WHILE <>]

[<>]LOCATEALL

[FOR <>]LOCATERushmoreLOCATE FOR FOR


Visual foxpro 6 0

[WHILE <>]

(1)

(2)LOCATERECNO()FOUND()EOF()FOUND()

(3)SET EXACT OFFLOCATE

(4)

CONTINUE


Visual foxpro 6 0

2CONTINUE

CONTINUE

LOCATE

CONTINUELOCATE,LOCATECONTINUE<>CONTINUE

CONTINUERECNO() FOUND()EOF()

CONTINUERECNO()table plus one, FOUND()EOF()


Visual foxpro 6 0

4.3.2

LOCATEVFPFINDSEEK

1FIND

FIND <>/<>

FOUND()FOUND()EOF()

FIND


Visual foxpro 6 0

FIND

FIND

SET EXACTFINDSET EXACT ONFIND


Visual foxpro 6 0

+FINDSET EXACT-FIND

FINDCONTINUEFINDFINDSKIPDISP


Visual foxpro 6 0

2SEEK

SEEK <> [ORDER <>/<>/ [TAG] <> [OF <>] [ASCENDING/ DESCENDING]]

<>1

<>SEEK<>

ORDER <>/<>/[TAG] <> [OF <>] [ASCENDING/DESCENDING]<>

SEEKFIND


Visual foxpro 6 0

SEEKSEEKSEEK

SEEK

3


Visual foxpro 6 0

4.3.3

GETEXPR [<1>] TO <> [TYPE <2>[;<>]] [DEFAULT <3>]

GETEXPRLOCATE

[<1>]

TO <>VFPEscDEFAULTEsc


Visual foxpro 6 0

[TYPE <2>[;<>]]<2>C-N-D-L-T-F-I-B-Y-Currency

<><2><><2><><2><>

[DEFAULT <3>]GETEXPR<3>GETEXPR


Visual foxpro 6 0

GETEXPRLOCATE

GETEXPR "" TO CXTJ TYPE "L" DEFAULT "= "


Visual foxpro 6 0

4.4

4.4.1

4.4.2

4.4.3


Visual foxpro 6 0

4.4.1

COUNT [<>] [FOR <>] [WHILE <>] [TO <>]

<>

<><><><><><>COUNTALL

TO <>(SET TALK ON)

USE STUDENT

SET EXACT OFF

COUNT FOR ="".OR.="" TO RS


Visual foxpro 6 0

4.4.2

SUM [<>] [<>] [FOR <>] [WHILE <>] TO <>/TO ARRAY <>

<>

<><>

TO <><>


Visual foxpro 6 0

4.4.3

AVERAGE [<>] [<>] [FOR <1>] [WHILE <2>] [TO <>| TO ARRAY <>]

<><>

AVERAGESUM

<>ALL<><><>SET TALK ON


Visual foxpro 6 0

4.5

4.5.1

4.5.2

4.5.3


Visual foxpro 6 0

4.5.1

1

VFP632767132767110AJ1-32767A-J10A-J

USE <>USEALIAS

USE <> [ALIAS <>] [IN <//>] [AGAIN]


Visual foxpro 6 0

[IN <>/<>/<>]<><>

[ALIAS <>]

[AGAIN]

1AGAINUSE

2AGAINUSEIN


Visual foxpro 6 0

2

SELECT

SELECT <>/<>/0

0

SELECT 3

USE STUDENT ALIAS XS

SELECT 1

USE SCORE

USE SCORE ALIAS CJ IN XS AGAIN


Visual foxpro 6 0

CLOSE

1CLOSE DATABASE

1

2CLOSE TABLE

3CLOSE ALL

1CLOSE ALL FCREATE()()FOPEN()CLOSE ALLSET PRINT


Visual foxpro 6 0

USE

USE IN <>/<>

<>-><>.

<> -><> <>.<>

SELECT 2

USE SCORE ALIAS CJ

SELECT 1

USE STUDENT

DISPLAY ,,,CJ.,CJ.


Visual foxpro 6 0

4.5.2

1

SET RELATION TO [<1>] INTO <>/<> [,<2> INTO <>/<>]] [IN <>/<>][ADDITIVE]

<1>


Visual foxpro 6 0

<>

1<>RECNO()EOF().T.

SELECT 2

USE SCORE ALIAS CJ

SELECT 1

USE STUDENT

SET RELATION TO RECNO() INTO CJ

2<>RECNO()<><>


Visual foxpro 6 0

EOF().T.

SELECT 2

USE SCORE ALIAS CJ

SELECT 1

USE STUDENT

SET RELATION TO 3*RECNO()-2 INTO CJ

3<>

SELECT 2

USE SCORE ALIAS CJ

INDEX ON TO XHSY

SELECT 1

USE STUDENT

SET RELATION TO INTO CJ


Visual foxpro 6 0

INTO <>/<>

ADDITIVEADDITIVEADDITIVE

<><><>


Visual foxpro 6 0

SET SKIP TO

SET SKIP TO <>/<> [,<>/<>]

SET SKIP TO<><>

2

SET RELATION/


Visual foxpro 6 0

1SET RELATION TO

2SET RELSTION OFF INTO <>/<>

<>/<>C

SET RELATION OFF INTO C

USE


Visual foxpro 6 0

4.5.3

COPY

JOIN WITH <>/<> TO <> FOR <> [FIELDS <>]

<>/<><>

<>/<>

FOR <><>

[FIELDS <>]<>

JOINJOIN


Visual foxpro 6 0

4.6 SQL

4.6.1 SQL

4.6.2 SQL

4.6.3 SQL


Visual foxpro 6 0

4.6.1 SQL

1

CREATE TABLE|DBF TableName1 [NAME LongTableName] [FREE] (FieldName1FieldType [(nFieldWidth [,nPrecision])] [NULL | NOT NULL]

[CHECK lExpression1 [ERROR cMessageText1]]

[DEFAULT eExpression1][PRIMARY KEY|UNIQUE]

[REFERENCES TableName2 [TAG TagName1]] [NOCPTRANS]

[,FieldName2 ...][,PRIMARY KEY eExpression2 TAG TagName2

|,UNIQUE eExpression3 TAG TagName3]

[,FOREIGN KEY eExpression4 TAG TagName4 [NODUP]

REFERENCES TableName3 [TAG TagName5]]

[,CHECK lExpression2 [ERROR cMessageText2]])

|FROM ARRAY ArrayName


Visual foxpro 6 0

TableNamelTABLEDBF

NAMELongTableName128

FREE

FieldNamel255Null254

FieldType[(nFieldWidth[nPrecision])]()FieldTypenFieldWidthnPrecision


Visual foxpro 6 0

FiledTypenFiledWidthnPression

FiledType

nFiledWidth

nPrecision

nd

d

-VFP

DTIYLMGPnFieldWidthnPrecisionNFBnPrecision0

n

-

-

n

n

-

-

-

-

-

-

-

-

-

-

d

d

-

d

-

-

-

-

C

D

T

N

F

I

B

Y

L

M

G

P


Visual foxpro 6 0

NULLnullnull255254

NOT NULLnullNULLNOT NULLSET NULLnullNULLNOT NULLPRIMARY KEYUNIQUESET NULLNOT NULL

CHECK lExpression1lExpression1

ERROR cMessageText1VFP6

DEFAULT eExpression1eExpression1

PRIMARY KEY

UNIQUE

INDEXUNIQUEnull


Visual foxpro 6 0

REFERENCES TableName2 [TAG TagName1]TAG TagNamelTAG TagNamel

NOCPTRANS

PRIMARY KEY eExpression2 TAG TagName2eExpression2TAG TagName2

UNIQUE eExpression3 TAG TagName3eExpression3PRIMARY KEYTAG TagName3

FOREIGN KEY eExpression4 TAG TagName4 [NODUP]eExpression4TagName4NODUP


Visual foxpro 6 0

FROM ARRAY ArrayName

SET EXCLUSIVEFREECREATE TABLECREATE TABLE NULLNOT NULLCHECKDEFAULTPRIMARY KEYUNIQUE

4-15CREATE TABLEGradexsglxt4-2


Visual foxpro 6 0

xsglxt

CREATE TABLE Grade(Student_ID C(10) NOT Null,;

Course_ID C(4) NOT Null,;

TestType C(4) NOT Null CHECK TestType=[] OR TestType; =[] OR TestType=[] ;

ERROR [];

DEFAULT ,;

PRIMARY KEY Student_ID + Course_ID + TestType TAG SCT,;

TestDate D NOT Null,;

TestGrade N(5,1) NOT Null)

Grade5GradeCREATE TABLE


Visual foxpro 6 0

2

CREATE CURSOR alias_name(fieldname1type

[(precision [,scale])[NULL|NOT NULL]

[CHECK lExpression [ERROR cMessageText]]

[DEFAULT eExpression][UNIQUE][NOCPTRANS]][, fname2 ...])

| FROM ARRAY ArrayName

CREATE TABLECREATE TABLE

4-16StudentCREATE CURSORCUR_StudentStudent_IDNameSex

CREATE CURSOR CUR_Student(Student_ID C(10) NOT NULL UNIQUE,;

Name C(8) NOT NULL UNIQUE,;

Sex C(2) CHECK Sex=[] OR Sex=[] ERROR [] DEFAULT [],;

Birthday D,;

Classes C(10),;

Dormitory C(5),;

PhoneNumber C(8))


Visual foxpro 6 0

3

3

ALTER TABLE TableName1 ADD | ALTER [COLUMN] FieldName1

FieldType [(nFieldWidth [,nPrecision])][NULL | NOT NULL]

[CHECK lExpression1 [ERROR cMessageText1]]

[DEFAULT eExpression1][PRIMARY KEY | UNIQUE]

[REFERENCES TableName2 [TAG TagName1]][NOCPTRANS]

[NOVALIDATE]

TableName1

ADD [COLUMN] FieldName1

ALTER [COLUMN] FieldName1

FieldType[(nFieldWidth[,nPrecision])]


Visual foxpro 6 0

NULL | NOT NULL()null

CHECK lExpression11Expressionl

ERROR cMessageText1

DEFAULT eExpression1

PRIMARY KEY

UNIQUE

REFERENCES TableName2 TAG TagNamelTAG TagNamel

NOCPTRANSNOCPTRANSNOCPTRANS

4-17GradeIsTest.T.

xsglxt

ALTER TABLE Grade ADD IsTest L DEFAULT .T.


Visual foxpro 6 0

ALTER TABLE TableName1 ALTER [COLUMN] FieldName2 [NULL | NOT NULL] [SET DEFAULT eExpression2]

[SET CHECK lExpression2 [ERROR cMessageText2]]

[DROP DEFAULT][DROP CHECK][NOVALIDATE]

ALTER [COLUMN] FieldName2ALTER TABLEALTER [COLUMN] FieldName2

SET DEFAULT eExpresslon2

SET CHECK lExpression2

DROP DEFAULT

DROP CHECK

4-18GradeTestGrade3

xsglxt

ALTER TABLE Grade ALTER TestGrade N(3)


Visual foxpro 6 0

ALTER TABLETableName1 [DROP [COLUMN] FieldName3]

[SET CHECK lExpression3 [ERROR cMessageText3]]

[DROP CHECK]

[ADD PRIMARY KEY eExpression3 TAG TagName2 [FOR lExpression4]]

[DROP PRIMARY KEY]

[ADD UNIQUE eExpression4 [TAG TagName3 [FOR lExpression5]]]

[DROP UNIQUE TAG TagName4]

[ADD FOREIGN KEY [eExpression5] TAG TagName4 [FOR lExpression6]

REFERENCES TableName2 [TAG TagName5]]

[DROP FOREIGN KEY TAG TagName6 [SAVE]]

[RENAME COLUMN FieldName4 TO FieldName5]

DROP [COLUMN] FieldName3FieldName3


Visual foxpro 6 0

ADD PRIMARY KEY eExpression3 TAG TagName2 [FOR lExpression4]eExpression3TagName2TAG TagName2eExpression3eExpression3FOR lExpression4lExpression4FOR

DROP PRIMARY KEY

ADD UNIQUE eExpression4 [TAG TagName3 [FOR 1Expression5]]ADD PRIMARY KEY eExpression3 TAG TagName2 [FOR lExpression4]

DROP UNIQUE TAG TagName4

RENAME COLUMN FieldName4 TO FieldName5FieldName4FieldName5


Visual foxpro 6 0

4-19GradeTestTypeIsTest

xsglxt

ALTER TABLE Grade ALTER TestType SET DEFAULT [];

ALTER TestType SET CHECK testtype="".OR.testtype=

"".OR.testtype="".OR.testtype="";

ERROR [];

ALTER IsTest DROP DEFAULT

4-20GradeIsTestNoTest.F.

xsglxt

ALTER TABLE Grade RENAME COLUMN IsTest TO NoTest ALTER NoTest SET DEFAULT .F.

ALTER TABLE Grade ALTER IsTest SET DEFAULT .F. RENAME COLUMN IsTest TO NoTest

4-21Grade

DRPO TABLE Grade


Visual foxpro 6 0

[TOP nExpr [PERCENT]]TOPORDER BYORDER BYTOPnExpnExp %1~32767

[Alias.Select_Item]Select_ItemSelect_Item

FROM

[AS Column_Name]Select_Item

FROMVFP6


Visual foxpro 6 0

[FORCE]VFP6FROM

[DatabaseName!]

Table [[AS] Local_Alias]Select

INNER JOIN

LEFT [OUTER] JOINJOIN

RIGHT [OUTER] JOINJOIN

FULL [OUTER] JOINJOIN

[DatabaseName!]Table [[AS] Local_Alias]


Visual foxpro 6 0

ON JoinCondition

[INTO Destination]INTOTOTOINTO

Destination

ARRAY ArrayName

CURSOR CursorNameVFP6SELECT

DBF TableName|TABLE TableNameSET SAFETYOFFVFP6SELECT

[TO FILE FileName [ADDITIVE] | TO PRINTER [PROMPT] | TO SCREEN]TOINTOFileNameASCIIADDITIVE


Visual foxpro 6 0

[PREFERENCE PreferenceName]

[NOCONSOLE]VFP6

[PLAIN]

[NOWAIT]

WHERE JoinConditionFROM.AND.FieldName1ComparisonFieldName2

FieldName1FieldName2Comparison

===LIKE<>!=#>>=<<=

FilterCondition


Visual foxpro 6 0

[GROUP BY GroupColumn]GroupColumnSQL

[HAVING FilterCondition]GROUP BY GroupColumn

[UNION [ALL] SELECTCommand]SELECTSELECTALLUNION

[ORDER BY Order_Item ]Order_Item

1

4-22Student1981

SELECT Student_ID AS ,Name AS ,Sex AS ;

FROM xsglxt!Student;

WHERE Year(Birthday)>=1981


Visual foxpro 6 0

2

4-23StudentScore

SELECT Student.Name AS ,Sex AS ,;

Score.,Score.;

FROM xsglxt!Student INNER JOIN xsglxt!Score;

ON Student.Student_ID=Score.Student_ID

3

4-240001

SELECT Student_ID ,Name,Classes FROM Student ;

WHERE Student_ID IN (SELECT Student_ID FROM Grade ;

WHERE Course_ID ='0001')


Visual foxpro 6 0

4COUNT()SUM()AVG()MAX()MIN()

4-25Score

SELECT SUM() AS ,AVG() AS ,;

MAX() AS ,MIN() AS ,;

COUNT(RECNO()) AS FROM Score

5GROUP BY

4-26

SELECT Score., Student.student_id, Student.classes;

FROM xsglxt!score INNER JOIN xsglxt!student ;

ON Score.student_id = Student.student_id;

INTO CURSOR CursorTab

SELECT MAX(),MIN(),SUM(),;

AVG(),Classes AS ;

FROM CursorTab ;

GROUP BY CLASSES


Visual foxpro 6 0

6

4-2790

SELECT Student_id AS ,Name AS ;

FROM Student ;

WHERE Sex=[] ;

UNION ;

SELECT Student_id AS ,Name AS ;

FROM Score ;

WHERE >90

SELECTSELECTunionintersectminus

90union


Visual foxpro 6 0

4.6.3 SQL

1

INSERT INTO Tablename [(Fieldname1 [,Fieldname2, ...])]

VALUES (eExpression1 [, eExpression2, ...])

INSERT INTO Tablename FROM ARRAY ArrayName | FROM MEMVAR

INSERT INTO TablenameTablenameVFP6

[(Fieldname1 [,Fieldname2, ...])]INSERT-SQL


Visual foxpro 6 0

VALUES (eExpression1 [, eExpression2, ...])Fieldname1 [,Fieldname2, ...]SET NULLONINSERT-SQLnullVALUES

FROM ARRAY ArrayNameFROM ARRAY

FROM MEMVAR

4-28INSERTSQLStudent


Visual foxpro 6 0

INSERT INTO Student (Student_ID, Name, Sex, Birthday, Classes,;

Dormitory, Phonenumber,Age);

VALUES(1999041002,,,{^1980/03/22},;

"99","3-311","2356306",20)

INSERT INTO Student VALUES(1999041002,,;

"",{^1980/03/22},"99","3-311","2356306",20)

2

UPDATE [DatabaseName1!]TableName1

SET Column_Name1 = eExpression1[, Column_Name2 = eExpression2 ...]

WHERE FilterCondition1 [AND | OR FilterCondition2 ...]

WHERESETeExpression1Column_Name1WHERE


Visual foxpro 6 0

4-29990

UPDATE Score SET =0 ;

WHERE Student_ID IN (SELECT Student_ID FROM Student ;

WHERE Student.Classes=[99])

3

DELETE FROM [<cDatabaseName !>] <cTablename>

WHERE FilterCondition1 [AND | OR FilterCondition2 ...]

wherewhere

4-30goods(gid,num,)order_form(gid,num,)

DELETE FROM Order_form ;

WHERE Order_form.num>(SELECT Goods.num FROM Goods ;

WHERE Order_form.gid=Goods.gid)


Visual foxpro 6 0

1SORT

2

3INDEX

4LOCATEFINDSEEKGETEXPR

5COUNTSUMAVERAGE

6USEINALIAS

7SELECT

8SET RELATIONSET SKIP

9JOIN

10SQL4

11CREATE TABLE CREATE CURSOR ALTER TABLE

12SQLSELECTSELECT-SQL

13SQLINSERT INTOUPDATEDELETE FROM


Visual foxpro 6 0

5 VFP6

1

2

3


Visual foxpro 6 0

5 VFP6

5.1 VFP6

5.2 VFP6

5.3 VFP6

5.4


Visual foxpro 6 0

5.1.1 VFP6

VFP6

VFP

*

*L501.PRG

CLEAR

CTALK=SET("TALK")

SET TALK OFF

INPUT "=" TO R

S=PI()*R*R

? ""+ALLTRIM(STR(R))+"=",S

SET TALK &CTALK

RETURN


Visual foxpro 6 0

1VFP

12048

2;

3

2


Visual foxpro 6 0

37

VFP6


Visual foxpro 6 0

5.1.2 VFP6

1

VFP6EnterEnter

1

2Enter


Visual foxpro 6 0

VFP6

VFP6

2

1VFP6ASCIIVFP6

MODIFY COMMAND <>

MODIFY COMMAND [<>/]


Visual foxpro 6 0

5-2VFP6

VFP6

MODIFY COMMAND L501

Ctrl+WL501.prg


Visual foxpro 6 0

2

DO <>

.PRG

DO L501

3

Ctrl+WCtrl+Q


Visual foxpro 6 0

4

MODIFY COMMAND <>

MODIFY COMMAND


Visual foxpro 6 0

3

VFP6VFP6

VFP6

VFP6

(1) 5-1VFP6

(2)

VFP


Visual foxpro 6 0

5-1 VFP6


Visual foxpro 6 0

Tab

5-2ClickClickClickClickClick

5-3MouseMove

5-2


Visual foxpro 6 0

5-3 MouseMove

MouseMoveMouseUpMouseUp


Visual foxpro 6 0

3VFP6

VFPVFPVFP5-4

5-4 VFP


Visual foxpro 6 0

4VFP6

VFP6


Visual foxpro 6 0

5.2 VFP6

5.2.1 VFP

5.2.2

5.2.3

5.2.4


Visual foxpro 6 0

5.2.1 VFP

1

1

ACCEPT [<>] TO <>

VFP

[<>]

[<>]ACCEPTEnter


Visual foxpro 6 0

VFP6ACCEPT

<>ASCII

5-3

MODIFY COMMAND L503

(.PRG)


Visual foxpro 6 0

Ctrl+ W

CLEAR

SET TALK OFF

ACCEPT "" TO FileName

USE (FileName)

LIST

USE

RETURN

FileName

2

ACCEPT

INPUT[<>] TO <>


Visual foxpro 6 0

VFP

[<>]

[<>]VFP

INPUTACCEPT

<>

INPUTACCEPTACCEPTINPUTVFPACCEPTINPUT


Visual foxpro 6 0

5-4

*L504.PRG

CLEAR

CTALK=SET("TALK")

SET TALK OFF

INPUT "=" TO R

S=PI()*R*R

V=4/3*PI()*R**3

? "=",S

? "=",V

SET TALK &CTALK

RETURN

DO L504

10Enter

=

10

= 314.16

= 4188.790205


Visual foxpro 6 0

3

WAIT<>[TO <>]

ACCEPTTO <><>

WAIT

YNYN


Visual foxpro 6 0

2

???

@ <, > SAY <>

<>

3

1

Esc

Resume


Visual foxpro 6 0

Esc

SET ESCAPE OFF

EscEsc

CANCEL

SUSPEND

|RESUME


Visual foxpro 6 0

2

NOTE/ * <>

&& <>

NOTE*&&

USE STUDENT &&STUDENT

3

<>

TEXT

<>

ENDTEXT


Visual foxpro 6 0

5.2.2 VFP6

VFP

5-510005%100010%

*L505

CTALK=SET("TALK")

SET TALK OFF

SCAN

IF >=1000

REPLACE WITH *1.05

ELSE

REPLACE WITH *1.1

ENDIF

ENDSCAN

SET TALK &CTALK

RETURN


Visual foxpro 6 0

1

2

5-6VFP6

1

VFP

IF <>

<1>

[ELSE

<2>]

ENDIF

1

2

5-6


Visual foxpro 6 0

<><>IF<1><>ELSE<2><2><>ELSE<2>IFENDIFENDIF

IFENDIFIFENDIF

5-51000>=1000<1>REPLACE WITH *1.0510005%1000


Visual foxpro 6 0

>=1000<2>REPLACE WITH *1.1100010%

2

CASE <1> <1> VFP<><>CASEOTHER-WISEENDCASE

DO CASE

CASE <1>

<1>

[CASE <2>

<2>

CASE <N>

<N>]

[OTHERWISE

<N+1>]

ENDCASE


Visual foxpro 6 0

ENDCASE

CASE <><>

5-6

CLEAR

AA=INT(RAND()*10) &&10

DO CASE

CASE AA=0

? 0

CASE AA=1

? 1

CASE AA=2

? 2

CASE AA=3

? 3

OTHERWISE

? 3

ENDCASE


Visual foxpro 6 0

2

VFP

1DO WHILE

DO WHILE <>

[<>]

[EXIT]

[LOOP]

ENDDO

<>DO WHILEENDDO<>

[<>]<>


Visual foxpro 6 0

VFP

[LOOP]DO WHILELOOPDO WHILEENDDO

[EXIT]DO WHILEENDDOENDDOEXITDO WHILEENDDO

ENDDODO WHILE

5-71000

STORE 0 TO AA,BB

DO WHILE AA<=1000

BB=BB+1

AA=AA+BB

ENDDO

? BB

45


Visual foxpro 6 0

5-8N7101

STORE 0 TO AA,BB &&

DO WHILE .T.

BB=BB+1

IF MOD(BB,7)=0 &&BB7

LOOP &&BB7BB1

ENDIF

AA=AA+BB &&BB7

IF MOD(AA,101)=0 &&AA101

EXIT &&AA101

ENDIF

ENDDO

? BB,AA

20718483


Visual foxpro 6 0

2FOR

FOR <>=<> TO <> [STEP <>]

<>

[EXIT]

[LOOP]

ENDFOR/NEXT

<>FORENDFOR

<> TO <><><>

[STEP <>]<>STEP1

<>VFP


Visual foxpro 6 0

[EXIT]ENDFORFORENDFOREXIT

[LOOP]FORLOOPENDFORENDFORFORENDFORLOOP

FORENDFORVFPENDFORNEXTFORVFP<><>

5-91100

AA=0

FOR II=2 TO 100 STEP 2

AA=AA+II

ENDFOR

? AA

2550


Visual foxpro 6 0

3

SCAN [<>] [FOR <>] [WHILE <>]

[<>]

[LOOP]

[EXIT]

ENDSCAN

[<>]SCANALL

[FOR <>]FOR

[WHILE <>]

[<>]VFP


Visual foxpro 6 0

[LOOP]SCANLOOPSCANENDSCAN

[EXIT]SCANENDSCANENDSCANEXITSCANENDSCAN

ENDSCANSCAN

SCAN

5-10STUDENT

USE STUDENT

SCAN FOR =

DISP

WAIT

ENDSCAN

USE

USE STUDENT

SCAN

IF #

LOOP

ENDIF

DISP

WAIT

ENDSCAN

USE


Visual foxpro 6 0

5.2.3

1

RETURN

DO

DO <> [IN <>][WITH <>]

WITH

<> VFPVFPSET PROCEDURE


Visual foxpro 6 0

.FXP.PRG.FXP

DOVFP

IN <> <>

[WITH <>]<>27


Visual foxpro 6 0

*MYSUB.PRG

PROCEDURE MYSUB

PARAMETERS R,S

S=PI()*R^2

RETURN

5-11MYMAIN.PRGMYSUB.PRG

*MYMAIN.PRG

CTALK=SET("TALK")

SET TALK OFF

CLEAR

STORE 0 TO RR, AREA

DO WHILE .T.

INPUT " " TO RR

DO MYSUB WITH RR, AREA

? ""+ALLTRIM(STR(RR))+"", AREA

WAIT "Y/N" TO ANSWER

IF UPPER(ANSWER)="Y"

LOOP

ELSE

EXIT

ENDIF

ENDDO

SET TALK &CTALK


Visual foxpro 6 0

2

1

MODIFY COMMAND <>

PROCEDURE <>

<>


Visual foxpro 6 0

PROCEDURE <1>

<1>

RETURN

PROCEDURE <2>

<2>

RETURN

PROCEDURE <N>

<N>

RETURN

128

2

1

SET PROCEDURE TO <>


Visual foxpro 6 0

VFP6VFP6SET PROCEDURE.FXP.PRG.FXP

2

CLOSE PROCEDURE

3

RETURN [<>/TO MASTER/TO <>]


Visual foxpro 6 0

[<>]RETURN

[TO MASTER]

[TO <>]

RETURN5-7


Visual foxpro 6 0

MYPROCED

5-12MYPROCED.PRGMYMAIN.PRG

*MYMAIN

CLEAR

TEXT

1--2--3--4

21015

ENDTEXT

CTALK=SET("TALK")

SET TALK OFF

SET PROCEDURE TO MYPROCED

DO WHILE .T.

ACCEPT "" TO SELECT

PROGNAME="PROGRAM"+SUBSTR(SELECT,1,1)

IF (SUBSTR(SELECT,1,1)="1".OR. SUBSTR(SELECT,1,1)="3").AND.

OCCURS(",",SELECT)#1.OR.SUBSTR(SELECT,1,1)="2".AND.

OCCURS(",",SELECT)#2.OR.SUBSTR(SELECT,1,1)>"4";

.OR.SUBSTR(SELECT,1,1)<"1"


Visual foxpro 6 0

WAIT WINDOW AT 15,20 " " NOWAIT

LOOP

ELSE

IF SUBSTR(SELECT,1,1)="4"

EXIT

ENDIF

ENDIF

IF OCCURS(",",SELECT)=1

POSITION=ATC(",",SELECT,1)

AA=VAL(SUBSTR(SELECT,POSITION+1,LEN(SELECT)-POSITION))

DO (PROGNAME) WITH AA

ELSE

POSITION1=ATC(",",SELECT,1)

POSITION2=ATC(",",SELECT,2)

AA=VAL(SUBS(SELECT,POSITION1+1, LEN(SELECT)-POSITION1))

BB= VAL(SUBS(SELECT,POSITION2+1,LEN(SELECT)-POSITION2))

DO (PROGNAME) WITH AA,BB

ENDIF

ENDDO

CLOSE PROCEDURE

SET TALK &CTALK

RETURN


Visual foxpro 6 0

MYPROCED

*MYPROCED

PROCEDURE PROGRAM1

PARAMETERS R

S=PI()*R^2

? ""+ALLTRIM(STR(R))+"",S

RETURN

PROCEDURE PROGRAM2

PARAMETERS LONG,WIDTH

S=LONG*WIDTH

? ""+ALLTRIM(STR(LONG))+""+ALLTRIM(STR(WIDTH))+;

"",S

RETURN

PROCEDURE PROGRAM3

PARAMETERS R

N=1

T=1

DO WHILE N<=R

T=T*N

N=N+1

ENDDO

? ""+ALLTRIM(STR(R))+"",T

RETURN


Visual foxpro 6 0

3

5-1330

*MYMAIN.PRG

CTALK=SET("TALK")

SET TALK OFF

SET PROCEDURE TO MYSUB

INPUT 30 TO NUMBER

II=1

DO MYSUB WITH NUMBER,II

CLOSE PROCEDURE

SET TALK &CTALK

RETURN

*MYSUB.PRG

PROCEDURE MYSUB

PARAMETERS MM,NN

IF MM>1

DO MYSUB WITH MM-1,NN &&

NN=NN*MM &&

ENDIF

? STR(MM,2)+=+STR(NN,10)

RETURN


Visual foxpro 6 0

5.2.4

1

FUNCTION <>

PARAMETERS <>

<>

RETURN <>

<><>RETURN <><>


Visual foxpro 6 0

5-14PRODUCT()

*PRODUCT.PRG

FUNCTION PRODUCT

PARAMETERS MM,NN

IF TYPE("MM")="L".OR.TYPE("NN")="L"

=MESSAGEBOX("",64,"PRODUCT()")

RETURN .F.

ELSE

IF MM>NN

=MESSAGEBOX(1+

CHR(13)+"2",64,"PRODUCT()")

RETURN .F.

ENDIF

ENDIF

TT=1

DO WHILE NN>=MM

TT=TT*MM

MM=MM+1

ENDDO

RETURN TT


Visual foxpro 6 0

2

<>(<>)

PARAMETERS <><>


Visual foxpro 6 0

5.3 VFP6

5.3.1

5.3.2

5.3.3

5.3.4

5.3.5

5.3.6

5.3.7

5.3.8


Visual foxpro 6 0

5.3.1

5.3.2

VFP6


Visual foxpro 6 0


Visual foxpro 6 0

5.3.3

VFP6

cTest=123_456_7 8 9_0

1

SUBSTR()

? Substr(cTest,1,1)

? Substr(cTest,4,1)

? Substr(cTest,10,1)

? Substr(cTest,11,1)

1

-

8


Visual foxpro 6 0

15FORFOR1SUBSTR()

FOR II=1 TO 15

?? SUBSTR(cTest,II,1)

ENDFOR

L508.PRG

123_456_7 8 9_0

2

? ISDIGIT(2)

.T.

? ISDIGIT(_)

.F.

? ISDIGIT(SUBSTR(cTest,10,1))

.F.


Visual foxpro 6 0

3

cNumbVar=

FOR

cCharacter=SUBSTR(cTest,II,1)

cNumbVar=cNumbVar+ cCharacter

cNumbVar=

FOR II=1 TO 15

cCharacter=SUBSTR(cTest,II,1)

IF ISDIGIT(cCharacter)

cNumbVar=cNumbVar+ ccharacter

ENDIF

ENDFOR


Visual foxpro 6 0

5.3.4

cNumbVar=

FOR II=1 TO 15

cCharacter=SUBSTR(cTest,II,1)

IF ISDIGIT(cCharacter)

cNumbVar=cNumbVar+ ccharacter

ENDIF

ENDFOR

? cTest

? cNumbVar

123_456_7 8 9_0

1234567890

cTest=123_456_7 8 9ab0

123_456_7 8 9ab0

123456789

FOR1516


Visual foxpro 6 0

FORVFPLEN()FOR

cNumbVar=

FOR II=1 TO LEN(cTest)

cCharacter=SUBSTR(cTest,II,1)

IF ISDIGIT(cCharacter)

cNumbVar=cNumbVar+ ccharacter

ENDIF

ENDFOR

? cTest

? cNumbVar

123_456_7 8 9ab0

1234567890

cTest="123_456_7 8 9ab0cd1e2 3"

123_456_7 8 9ab0cd1e2 3

1234567890123


Visual foxpro 6 0

5-9

5.3.5

STUDENTSTUDENT5-9

REPLACE


Visual foxpro 6 0

REPLACE WITH cNumbVar

SCANENDSCANcTest

SCAN

cNumbVar=

FOR II=1 TO LEN()

cCharacter=SUBSTR(,II,1)

IF ISDIGIT(cCharacter)

cNumbVar=cNumbVar+ ccharacter

ENDIF

ENDFOR

REPLACE WITH cNumbVar

ENDSCAN


Visual foxpro 6 0

5-10 STUDENT

5.3.6

STUDENT

5-9


Visual foxpro 6 0

5.3.7

STUDENTSTUDENT

ACCEPT TO TABNAMESR

LtableOK=.F. &&

&&.F.

LfieldOK=.F. &&

TABNAME= &&

IF AT(.,TABNAMESR)=0

TABNAME=TABNAMESR+.DBF &&


Visual foxpro 6 0

ENDIF

DO WHILE .T.

IF FILE(TABNAME) &&

USE (TABNAME) &&

LtableOK=.T. &&.T.

EXIT &&

ELSE

=MESSAGEBOX(,64,)

USE ? &&

IF USED() &&

EXIT &&

ENDIF

ENDIF

ENDDO

*

*LfieldOK.T.EXIT

*LfieldOK.F.

FOR II=1 TO FCOUNT()

IF FIELD(II)=.AND.TYPE()=C

LfieldOK=.T.

EXIT


Visual foxpro 6 0

ENDIF

ENDFOR

IF LtableOK.AND. LfieldOK

SCAN

cNumbVar=

FOR II=1 TO LEN()

cCharacter=SUBSTR(,II,1)

IF ISDIGIT(cCharacter)

cNumbVar=cNumbVar+ ccharacter

ENDIF

ENDFOR

REPLACE WITH cNumbVar

ENDSCAN

ENDIF


Visual foxpro 6 0

5.3.8

5-15

FUNCTION NUMBERONLY(CMIXEDVAL)

cNumbVar=

FOR II=1 TO LEN(CMIXEDVAL)

cCharacter=SUBSTR(CMIXEDVAL,II,1)

IF ISDIGIT(cCharacter)

cNumbVar=cNumbVar+ ccharacter

ENDIF

ENDFOR

RETURN cNumbVar

ENDFUNC

SCAN

REPLACE FIELDNAME WITH NUMBERONLY(FIELDNAME)

ENDSCAN

REPLACE ALL FIELDNAME WITH NUMBERONLY(FIELDNAME)


Visual foxpro 6 0

5.4

VFP6

5.4.1

5.4.2

5.4.3


Visual foxpro 6 0

5.4.1

VFP6VFP6

1VFP6

VFP6VFP6


Visual foxpro 6 0

5-2

5-2VFP

VFP5-3

5-3VFP

ParentClass


Visual foxpro 6 0

2

VFPVFPVFP6

1VFP6


Visual foxpro 6 0

2

3

26


Visual foxpro 6 0

5.4.2

VFP6


Visual foxpro 6 0

WindowsVFP6

VFP65-4VFP6

VFP6VFP6

Release

Object.Release


Visual foxpro 6 0

5-4VFP6


Visual foxpro 6 0

5.4.3

1

1|

2


Visual foxpro 6 0

NewToolBarToolBarc:\gxglxt\libs\gxglxt_app.vcx

3


Visual foxpro 6 0


Visual foxpro 6 0


Visual foxpro 6 0

5-15

4NewToolBar5-15

5-15NewToolBarCaption


Visual foxpro 6 0

Command1CaptionBFontBold.T.Command2CaptionIFontBold.T.FontItalic.T.Command3CaptionUFontBold.T.FontUnderLine.T.

Combo1|RowSourceType1RowSource


Visual foxpro 6 0

12ValueControlSourceValue

5

1Combo2Click Event


Visual foxpro 6 0

THISFORMSET.ActiveForm.ActiveControl.FontName=THIS.VALUE

2Combo3Click Event

THISFORMSET.ActiveForm.ActiveControl.FontSize=;

VAL(ALLTRIM(THIS.VALUE))

3Command1Click Event

THISFORMSET.ActiveForm.ActiveControl.FontBold=;

!THISFORMSET.ActiveForm.ActiveControl.FontBold

THIS.FontBold=THISFORMSET.ActiveForm.ActiveControl.FontBold

4Command2Click Event

THISFORMSET.ActiveForm.ActiveControl.FontItalic=;

!THISFORMSET.ActiveForm.ActiveControl.FontItalic

THIS.FontItalic=THISFORMSET.ActiveForm.ActiveControl.FontItalic

5Command3Click Event

THISFORMSET.ActiveForm.ActiveControl.FontUnderline=;

!THISFORMSET.ActiveForm.ActiveControl.FontUnderline

THIS.FontUnderline=THISFORMSET.ActiveForm.ActiveControl.FontUnderline

6Combo1Click EventVFP


Visual foxpro 6 0

2

|


Visual foxpro 6 0


Visual foxpro 6 0

1VFP6

2Modify Command

3Do

4IfEndifDocaseEndcaseDo WhileEnddoScan EndscanForEndfor

578

6

7


Visual foxpro 6 0

6

1

2

3

4

5

6


Visual foxpro 6 0

6

6.1

6.2

6.3

6.4

6.5


Visual foxpro 6 0

6.1

6.1.1

6.1.2


Visual foxpro 6 0

6.1.1

GXGLXTStudent0499


Visual foxpro 6 0

GXGLXTStudent


Visual foxpro 6 0

Student.

0

4

9

8


Visual foxpro 6 0


Visual foxpro 6 0

1

2

3

4


Visual foxpro 6 0

.QPR


Visual foxpro 6 0

Stud_query


Visual foxpro 6 0

6.1.2

Grade Grade


Visual foxpro 6 0


Visual foxpro 6 0

1

2254

3


Visual foxpro 6 0

1

2

3

4

5


Visual foxpro 6 0

.QPR

.NULL.

NULL


Visual foxpro 6 0

Grad_Query

.NULL.,


Visual foxpro 6 0

6.2

6.2.1

6.2.2

6.2.3

6.2.4

6.2.5

6.2.6

6.2.7

6.2.8


Visual foxpro 6 0

6.2

VFP6

Grad_Query

1

2


Visual foxpro 6 0

|

CREATE QUERY


Visual foxpro 6 0

1

2

3

4SET FILTER TO

5

1

2

3

4

5

6


Visual foxpro 6 0

6.2.1

GXGLXTStudentGradeCourses99049804

GXGLXTStudentGrade

Courses


Visual foxpro 6 0

VFP6


Visual foxpro 6 0

1Inner Join:

2Right Outer Join

3Left Outer Join:

4Full Join

1=


Visual foxpro 6 0

2LIKEStudent. LIKE 99049904

3==

4>

5>=

6<

7<=

8Is NullNull

9Between


Visual foxpro 6 0

10IN

.NOT..AND..OR.

1

2.T.

3

4


Visual foxpro 6 0

6.2.2

Student.Student.Courses.Grade.

Student.Courses.Grade.


Visual foxpro 6 0

6.2.3

99049804

Grade.=1


Visual foxpro 6 0

ANDStudent.In9904,9804,En

6.2.4


Visual foxpro 6 0

Student.


Visual foxpro 6 0

6.2.5

SUM()COUNT()AVG()


Visual foxpro 6 0

1

2AVGexpNGradeAVG(Grade.)Grade

3

4Grade.


Visual foxpro 6 0

6.2.6

SQLDistinct


Visual foxpro 6 0

XY

Student.Student.Courses.Grade.Grade.


Visual foxpro 6 0

6.2.7


Visual foxpro 6 0

.DBF

Microsoft GraphVFP6

VFP6

.FRX

.LBX

1


Visual foxpro 6 0

6.2.8

DO .qpr

1|1


Visual foxpro 6 0

6.3

6.3.1

6.3.2


Visual foxpro 6 0

6.3.1

1

1

2

1


Visual foxpro 6 0

1

2

3

1

2

3

4

1

2

3


Visual foxpro 6 0

1

1


Visual foxpro 6 0

2

3

4

5

6

7

GradeCourses1

Grade

Courses

2


Visual foxpro 6 0

2

1

2

3

2a


Visual foxpro 6 0

2a

Grade

Courses

3


Visual foxpro 6 0

3

4


Visual foxpro 6 0

4

4a


Visual foxpro 6 0

4a

5

5

1


Visual foxpro 6 0

2

1


Visual foxpro 6 0

|

||

|


Visual foxpro 6 0

SQL

/SQLSQL

/


Visual foxpro 6 0

2

ClasszcDepartment


Visual foxpro 6 0

GXGLXT

Classzc


Visual foxpro 6 0


Visual foxpro 6 0

Classzc.Classzc. Classzc.Classzc.Classzc.


Visual foxpro 6 0


Visual foxpro 6 0

3

3


Visual foxpro 6 0

DepartmentClasszcStudentCoursesGrade3


Visual foxpro 6 0

4


Visual foxpro 6 0


Visual foxpro 6 0

SQL

3


Visual foxpro 6 0

SQL WHERE

WHERE

WHERE

WHERE

WHERE

SQL DELETEINSERT

SQL UPDATE

6.5


Visual foxpro 6 0

6.3.2

1

ODBC

|


Visual foxpro 6 0

1

2

3

4

5

6

7

ODBCODBCVFP TablesVFP


Visual foxpro 6 0

DatabasesPathBrowse


Visual foxpro 6 0

2


Visual foxpro 6 0


Visual foxpro 6 0

Visual FoxPro DatabaseConfigure Connection

BrowseSelect Database


Visual foxpro 6 0

Configure ConnectionPath\\092\FOXPRO\Visualfp.dbcOK

1


Visual foxpro 6 0


Visual foxpro 6 0

3

VFP

SQL WHERE VFP

SQL WHERE

UPDATEDELETEWHEREVFPWHERE


Visual foxpro 6 0

4

1


Visual foxpro 6 0

SQL

SQL DELETEINSERTSQL UPDATE

2

VFP


Visual foxpro 6 0

5

ODBC

ODBC

VFPVFPODBC

1


Visual foxpro 6 0

VFP

ODBC

VFP


Visual foxpro 6 0

Data Sources

2ODBC

VFPODBC

VFP ODBCID

VFP

3

DBSETPROP( )

Asynchronous

Disp


Visual foxpro 6 0

warning

BatchMode

Transactions

4

DBSETPROP( )

ConnectTimeout

QueryTimeout

IdleTimeout

VFPSQLWaitTime


Visual foxpro 6 0

6.4

6.4.1

6.4.2

6.4.3

6.4.4

6.4.5

6.4.6

6.4.7


Visual foxpro 6 0

6.4.1

USE

USE

c:\gxglxtgxglxt1

open database c:\gxglxt\gxglxt

use 1


Visual foxpro 6 0

browse

VFP6Close All112|


Visual foxpro 6 0

6.4.2

NODATAUSE

open database c:\gxglxt\gxglxt

use 1 nodata in 0

Select 1

browse

1NODATAVFP61.F. WHEREWHERE


Visual foxpro 6 0

6.4.3

RENAME VIEW

RENAME VIEW

21

rename view 1to 2

6.4.4

DELETE VIEW


Visual foxpro 6 0

DELETE VIEW

xsglxt2

delete view2

6.4.5

INDEX ON


Visual foxpro 6 0

6.4.6

VFP

1


Visual foxpro 6 0

2

3

4

1ClasszcStudentCourseGrade. Classzc.Classzc.Student.Student.Course.Grade.Grade.7

2 Classzc.=?Grade.=?

3|


Visual foxpro 6 0

4|

05"1"


Visual foxpro 6 0

6.4.7

3


Visual foxpro 6 0

Grade

Grade++

||041


Visual foxpro 6 0

3

6299


Visual foxpro 6 0

Grade

99

99

Grade


Visual foxpro 6 0

6.5

1MIS990520

2

Visual FoxPro


Visual foxpro 6 0

6.6.1

.DBF

CREATE SQL VIEWCREATEOFFLINE()studentgrade

CREATE SQL VIEW test1

CONNECTION 1

AS SELECT * FROM student INNER JOIN grade;

ON student.=grade.;

CREATEOFFLINE(test1)


Visual foxpro 6 0

6.6.2

1

test1

USE test1

2

ADMINUSEtest1

USE test2 ADMIN


Visual foxpro 6 0

1VFP6

2.QPRDO

3

4

5

6

7

8

9

10SQL-SELECTSQLSQL


  • Login