Вы находитесь на странице: 1из 445

c o n v e r t e d to P D F b y H u p B a H 9 I

. , . , . .

1.

1. -
1.1.
1.2. , -

2.
2.1.



2.2.
1.
2.
3. ,
4.
5.
2.3.
2.4.

3.
3.1.
3.2. Visual FoxPro
Project Manager
Database Designer
Form Designer
Visual Class Designer
Q u ery / View Designer
Connection Designer
Report/Label Designer
Menu Designer

3.3. Access


3.4. Visual Basic
3.5. MS SQ L Server
3.6.

4.
4.1.
4.2.
4.3. " "

converted to PDF by H u pB aH 9 I

4 .4 .

5. -
5.1.
5.2.



-

O LE
5.3.
5.4.

2.

6.
6.1. Visual FoxPro



6.2. Access
6.3. Visual Basic
6.4. MS SQ L Server

7.
7.1. ,
Visual FoxPro
Microsoft Access
7.2. S Q L-




7.3. SQL
7.4. Microsoft Visual FoxPro
7.5. Microsoft Access

-



7.6.
Visual FoxPro

MicroxPro
Microsoft Access

8. -
8.1. ODBC
Transact-SQL

converted to PDF by H u pB aH 9 I

8.2.

8.3.
8.4.
8.5.
8.6.



Visual FoxPro


Access Visual Basic
O DBC API
Remote Data Objects
SQL-DM O

3.

9.
9.1.
9.2.
" " Visual FoxPro
" " Access
9.3.
Visual FoxPro
Access

10.
10.1.
10.2. OLE 2.0
OLE 2.0
OLE Automation
Excel
W ord for Windows
10.3. OLE Autom ation
MS Graph 5.0
MS Excel 7.0
W ord for Windows
Schedule+
10.4. ActiveX

11.
11.1. Visual FoxPro

11.2. Access

12.
12.1.
12.2.
Visual FoxPro
Access
Access
Visual Basic
12.3.

converted to PDF by H u pB aH 9 I

1.
Visual FoxPro 5.0



Project Manager



-

OLE

2. Visual
FoxPro Visual Basic

1

1.1.
1.2. , -
. ,
" ", .
, ,
. ,
, ,
. ,
, - - .

1.1.
" ..."

, , , , ,
D e l . ""
"", , ,
, ,
.
:

;
;
;
;
, ;
;
;
;
;
;

converted to PDF by H u pB aH 9 I

;
;
;
;
;

.
,
.
.
,
.
.
, , ,
. ,
.
.
, .
.
,
, -
, .
,
, , .
, ,
.

,
.


.
, .
(, , ,
).
( ,
, ..) .
(,

).
.
, ,
, , , , ,
, , , ,
, , , .

, .
.

(, , - )
(, , ). ,
,
. - , , . .
,
.
, , ,
.

converted to PDF by HupBaH9I

,
.

, ,
, , . ,
,
, .
. ,
, .

- .
.

, , ,
, , , . . ,
, , , , , , ,
. . -
, .
, . 1.1.

. 1 .1 .
- ,
. .

,
"" "" .
( !) ,
.

,
.

" " , "Voyager'96


3.8 Grand", "Continental 4.6" "Crown Victoria 4.6". ,
, ,
.

, .
.
.
.

converted to PDF by HupBaH9I

.
.

. , ,
, .
, - 7, ,
"Voyager'96 3.8 Grand" "3778".

,
.

.
"" . ,
, .
,
.

- ( ),
.


, .

- ( ),
.

, "", " ",


"", "" "", "", "", ""
" " (
, ).

- .

. 1.2 ,
, . , - "7
Voyager'96 3.8 Grand 3778 6 164,0". ,
(MODEL).
. ,
, , , . .
| Model

| ! | | |! | ||| *

!
13S1
51.<
2 1161.9
j
19391
90.0.
28GJ0
3 740UD
3902[
3382L
1
4 8*00*0
0'
5 .
|
3201
321,0
193,0
6iGMCJnimv4.3
}
4300

'f
IS
Si
and
i
77
164.0
J
7
8 ZX 20
\
1998
150,0 _
16
9l5toatt3.G
I
2972
10 34?Sptf3.4
1
3*05
!

----- ----- .----------- 1____.-----

. 1 .2 . MODEL
.

converted to PDF by HupBaH9I


. ,
, , (,
), (, ,
.). ,
.

,
.

,
.
, ,
, ,
"" .
"", . ,
"" (. 1.3) ,
, ( ,
, -
).
. ,
"" "", "".
: ,
. " "
" " , .
1II1

______ ______
^

y 'T lQ M F H h l

jL

..--

rujJi

O T I IOLUEIII-1E

M O flFnh

1C

*. I1
2. 2

LiwejL irmld

177

'in r
1

34S SpiAM 3.4

CusL

JSS

4illik

+:5

. 1 .3 .
- (
).

,
.

- .

converted to PDF by HupBaH9I

,
.

. "" ,
, (
).
:

(, , / ,
);
;
() ;
(cordiality);
(null) .

,
( ) . ,
, .
.
,
, . ,
,
.

. ,
, 1:n.

- (),
( , . .) .


,
. , , ,
.
,
.


() .

- .
, ,
. .
,
,
.

- ,
,
.

,
, .
.
"".

converted to PDF by HupBaH9I

, ,
, .
:

, .
, ,
. (,
- ),
(, ).

, ,
.

.

.
,
.
.
, ,
.
, ,
- .

-
.
, .


, .
:

;
;
;

;
(NULL) .

-
.

,
. ,
, ,
, .

- ,
, , , ,
.

converted to PDF by HupBaH9I

1.2. ,
,
, 77 100 , , 99 100
,
, . ,
, ,
,
.
.
, ,
. ,
, ,
. ,
, ,
, , .
,
.
"" ( -,
: "",
"") .
.
, .

- ( ). ""
- .
""
.
- "" .
1.4.

; .
. ,
, . , ,
, , ,
.
,
, .
- 6 : , , , ,
.

. 1 .4 . -

converted to PDF by HupBaH9I

: " ?", ,
.
:

;
();
;
;
;
.

: " ?" , .
:

;
;
;
;
;
;
;
.

: " ?"
. , ,
, ,
.
.
, ,
. ,
, ,
, .
, ,

.
: " ?" .
"" . 1.5.

. 1.5.
: " ?"
-

converted to PDF by HupBaH9I

.
:

- ;
- ;
- 20 .

: " ?"
. - "" :

" - " ;
;
;
.


- .
- -,
. 1.6.
E R - (Entity-relationship diagram (ERD) - "-"). ER
.
, ,
.

. 1 .6 . - -

.
:
"AUTO STORE".
:
.
:

.
, .
() .
(): ,
, , .
.
( ).
.

- :

10 .
3 , , .

converted to PDF by HupBaH9I

-
.
9%
, .
4 .
""
0,1% , .
2 ,
.

:
Windows 95 Windows
NT.
:

;
, 3;
;
, . .;
, ;
, /;
100 /, ;
;
;
, ;
, ;
, ;
90 /, /100 ;
120 /, /100 ;
, /100 ;
;
, ;
;
;
;
;
;
;
;
;
;
, ;
;
;
;
;
;
;
, .

;
;
;
;
.

converted to PDF by HupBaH9I

: Pentium 100/16/420 Windows


95 Windows NT Workstation MS Office.
Pentium 166/32/1000 Windows NT Server MS
SQL Server 6..
.
.

2

2.1.



2.2.
1.
2.
3. ,
4.
5.
2.3.
2.4.
, , ,
, . , -
"" .

.

2.1.

. .
.
:

;
, ;
.


.
.



(. 2.1).
(), .
,
, ,
.
" ". .

converted to PDF by HupBaH9I

, , , .


.

. ,

. ,
, , .
,
. ,
.
. ,
, .

, .
,
( ),
. ,
,
,
.
, , , - .
, ,
, .

,
, .
. ,
,
. -
. . 2.1. ,
.
.

, . ,
,
( ) .
.
""
. ,
.
, ,
. ,
.
.

.
.
(,
) .
,
.


.
" ", " " " ".

converted to PDF by HupBaH9I


, ,
.
, . ,
,
( ). ,
, , , , , , .
, " ",
" ", " " . .
- .
" ", " " . .
- . " ", "
" " ".
- . "
", " ", "" "".
" " ( )
- . ,
.
" ",
, . 2.2,.
, , ,

. . 2.3 . ,
, -
.

1ITA

------ >

-------------------------

> 34

-------------------------

> 56

. 2 .3 . " "
" " ( )

, .
" "
"" "", . 2.2,6.
(
) (
). " "
. ,
.
,
.

converted to PDF by HupBaH9I

, ,
. 2.4. , - ,
, .
, () . ,
, .

. 2 .4 . " "
,
, (. . 2.4).
, .
" " ( )
.
, ,
.
" ". ,
. 2.2,. . 2.5 ,
. ,
.
.
.
. ,
, ,
.

converted to PDF by HupBaH9I

1 IT

<

>

1 [

. 2 .5 . " "
" "
:
( ).
, . 2.6.

converted to PDF by HupBaH9I

-I

. 2 .6 .


.

. " ", " " "
".
" " ( )
, () ,
.

(, ),
" ". . 2 .7 ,
.
" " ( )
.
, . .
, . "
" ""
"" (. 2 .7 ,).
" " ( )
.
- .

converted to PDF by HupBaH9I

" " " " " ".


(. 2.7,).



60- . 70- .

.
,
, , , (. 2.8).
" ". ,
.
. ,

: ()
() .
. 2.8 .
, .
( ). .
( ) , . .
1

V.
/

'\
V

/" ' \

. 2 .8 .
.
(
" ", - " ").
, .
, .
. 2.9.
, . 2.10.
.
.
( ) - ,
.

.
.

converted to PDF by HupBaH9I

. 2 .9 .

2.2.
- . ?
,

, .
,
.
.
:


;
;
.


- .

.
. , ,
.

:


.
.
,
.

.

.
.
.
.
, ,
.


. 2.11.

converted to PDF by HupBaH9I


.
,

.
.
.

.
,
. ,
.
,
( ).

1.
, , :
1.
2.
3.
4.
5.
6.
7.

;
;
;
;
;
;
.

2.

, .
. 2.12.
. 2.2,
, " ".
, ,
. ,
. 2.12
" ".

. 2 .1 2 .

3. ,

, .
,
. , ,
, ,
. , ,
,

converted to PDF by HupBaH9I

. , ,
. ,

.
, , . 2.1.
. 2.13.

. 2 .1 3 .
2 .1 .



converted to PDF by HupBaH9I


100 /


90 /

120 /


converted to PDF by HupBaH9I

4.


.
,
. ,
, ,
, .

, - , ,
,
. .

, ,
.

,
, . ,
.
, ,
(
, ), .
, .
.

,
, ,
.

,
, , ,
. ,
, ,
.

,
.
.

,
, ,
.

. A, B C C B, B A, , C
A, . 2.14,.
, . 2.14,6.
,
,

converted to PDF by HupBaH9I

, .

. ,
, ,
, .
,

.
,
:
-
.
.
. ,
. " " .
, ,
. - - " ",
. ,
.
- ,
.
- . ,
, .
, -
, .

, , , , ,
(. 2.15).
,
( , .
.).
.
:
,
. ,
.
.
,
, .
,
. .
(, ),
. ,
, , . ,
? ( )
.
, , .
2.2.
2 .2 .





converted to PDF by HupBaH9I


100
/

90
/
120
/


5.
,
. .
2.3.
2 .3 .
Model ( )
+
1
/

1
Key_model

2
Name_model

3
Key_firm

4
Swept_volume
,
3
c3

converted to PDF by HupBaH9I

Quantity_drum

6
7
8

Capacity
Torgue
Key_fuel_oil

Top_speed

10

Starting

11

Key_tyre

12

Key_body

13

Quantity_door

14
15
16
17
18

Quantity_sead
Length
Width
Height
Expense_90

19

Expense_120

20

Expense_town

F irm ( )
/
1
2
3

C oun try
( )
/
1
2

F u e l_o il
( )
/
1
2

, . .

,, /

100 / ,,


,
,
,

90 / ,
/100

120 /,
/100


, /100

+
2

Key_firm

Name_firm

Key_country

Key_country

Name_country

Key_fuel_oil

Name_fuel_oil

converted to PDF by HupBaH9I

T y re ( )
/
1
2

Body ( )
/
1
2

A uto m o bile
p a sse n g e r car
( )
/
1
2
3

C u sto m er
( )
/
1
2
3
4
5
6
7
8
9

10

S a le ( )
/
1
2

+
5

Key_tyre

Name_tyre

+
6

Key_body

Name_body

Key_auto

Key_model

Date_issue

..
Cost
,, $
+

Key_custome

Name_customer

Address

Tel

Fax

Last_name

First_name

Patronymic

Juridical

Comment

+
9

Account

Date_sale

converted to PDF by HupBaH9I

A cco u n t ( )
/
1
2
3
4

6
7

O rd e r_ ( )
/
1
2
3
4

S a le sm a n
( )
/
1
2
3
4

..
, $

Sum _

+
10

Number_record

Account_

Key_customer

Key_auto

Date_write

..
Selled

Sum _
, $
+
11

Key_order

Key_customer

Key_model

Key_salman

12

Key_salman

Last_name

First_name

Patronymic

,
, .
.

,
.

, .
.
, ,
.
.
.
. ,
.

converted to PDF by HupBaH9I

, . ,
: " !"
, .
, .

. .

. ,

. ,

.
.
, , : "
, ".
, ,
,
. ,
.
,
.

- ,
.


. ,
30 . .
: (),
, , . .
:

.
Date ..
. 31,
- 12.
, , .
( ),
- : ( ).
"" ,
- .
,
. ,
: , . .
- .
.

, ,
, .

.

2.3.

().
,
.
.

converted to PDF by HupBaH9I

. , ,
, .
,
.
:

;

;
;
;

.

, ,
,
. ,
, ,
.

.

, , ,
,
, .
, ,
.
,

,
.
.
,
. .
: " !",
, , ,
.
,
, , .
" ",
.
.
, ,
, .
.

. ,
.
, -,
.
.
, ,
.

. , ,
- , - .

. ,
, ,
, , " ", ""
"" .
, ,
.
.

converted to PDF by HupBaH9I

.
"". ?
.
, "".
, ,
: " ", " ",
" " " ". "
" , ,
(
), " " .
"".

.
,
,
,
.

, .
, - ,
.

, , .
"",
: ,
, .

. , " ".
-
, .
.
. ,
. , ,
, ,
. ,
.
.
.

- - ,

. ""

.

, .
,
.
. , ,
.

. .
,
,

.
.
,
. ,
.
.
,
.
, ,
. ,
.

converted to PDF by HupBaH9I

,
.
, ,
, .
.
.
, .
, . ,
.
.
.
,
, .
,
,
,
.
.
,
.
.
, .

AUTO STORE.
,
Auto_Store.
, : , ,
, , , , ,
, NULL, ,
, .
Auto_Store MS SQL Server,
MS SQL Server
Auto_Store , , .
, ""
" ".
. , .
2.16. .
, .
"". ,
(. 2.17). , .

. 2 .1 6 .

converted to PDF by HupBaH9I

_1

*1

I i d

LJ

[id

. 2 .1 7 .
. . " "
" "
"". . 2.18 .
"" .
.
. .
" " " "
"". . 2.19
. ""
.

. 2.18.

converted to PDF by HupBaH9I

. 2 .1 9
. . 2.20 ,
:

key_cu51Qmer
mnns_cuitDme_
sdfress

fci^tustameh _J

hey_ssnm<i
Ij-1^narrit

ktyjnadel

Iirs1_rams

k*y_)rdef
,|

-4 5 "

M fj n w n

k
d

nama_?uE]_inl
indeji&S
ara huv iud

j S Sut

key Jo

body
n-a!ria_body
__ I
indeses-.......

_
.

iisy_fi|(n
na^nejiim
fcfy^Ounlrf
" _

Key_1uel_Dil

| _
_1

1 ^

i j p

;> IfL-y^Mlinin

_1|

v^y_model
nafrie_mudel

* * ,

-h

1
k

hey lyre
namejyre
..... indexes.......
.

s8 ^

"

-J

i.
i

L_

"

. 2 .2 0 .


.

,
, , ,
,
.

(. 2.21).

converted to PDF by HupBaH9I

51

I ;
:
:

|A u to m o b ile _p asse n g e r_ca r

. 2 .2 1 .


.

(. 2.22).
jif

[Model

&

Null

keym odel

Fnteger

n a m e jn o d e l

C h aracter

20

Integer

swnpt volum e

N um eric

1 l*d

quantity _drum

N um eric

swept_vo1ume>1

1-

: 1

. 2 .2 2 .


.

(. 2.23).

.

,
,
, ,
.

2.4.
, , .
,
, .
.

converted to PDF by HupBaH9I

, ,
,
.
, .
,
.

"" .
, .
.
.
.

() ,
.

- "" , "".
.
.
"" ,
, , .
,
.
.
.
, , - , .

, .
.
,
. ,
. ,
,
.
.
,
.
.
. ,
,
.
,
, .
, .
. ,
.

,
. ,
, , ,
.
.

.
, .
. ,
, ,
.
,
.
, .
,
. ,

converted to PDF by HupBaH9I

.
. , ,
, , .

,
. ,
,
, ,
"".
.
,
.
:

;
,
;
;
;
,
(, , );
,
.


,
.
, " " .
, .
, "" ,
.
"" ,
.
, , , -, , .
, ,
.
, ,
.
,
.
, ,
(
) , .
, .
,
, ,
, . ,
,
. ,
, .
Auto_Store,
, : , ,
, , ,
. . 2.24 2.25 ,
.

converted to PDF by HupBaH9I

_U*J

Ga poumh

11V

_of|in name

Log ii pas

11

Laginjev? in a

PilHT HJTCUJfl

Login_lev3 tuv3

Login_lev4 Invi

LoginlevS lov^

Pjfien

Lo g injevl Iowl

Pile r_g roup

I
I ,
| : * H s n q jrw *
I .- pir!& , 1 ? - ir .

^11

. 2 .2 4 .

d e l
4> u i
Country

3>PFuel_oil

>

2
3

Sale cl;

Insert

'O ^ R o r f y

[7 Update

^^Aulomoliili? passRntjer &


Gusto me

1 1^1
!

cG:p^0(1 _

Delete

^ IH lS a le s n ia n

. 2.25.
,
, . 2.26.

converted to PDF by HupBaH9I

. 2 .2 6 . SQL Server

3


3.1.
3.2. Visual FoxPro
Project Manager
Database Designer
Form Designer
Visual Class Designer
Query / View Designer
Connection Designer
Report/Label Designer
Menu Designer

3.3. Access


3.4. Visual Basic
3.5. MS SQL Server
3.6.

, ,
.
.
, , ,
. ,
,

. .

converted to PDF by HupBaH9I

3.1.
, ,
- RAD (Rapid Application Development)
. ? ,
, .
.

.

. ,
. , ,
, .

. ,
, -
.
, RAD.
:

- ,
.
,

.
,
, .
.
-,

.

, .
- . . RAD!
,
RAD, .
- .
, . ,

Microsoft. " Microsoft?" - .
:

Microsoft - -
.
Microsoft .
Microsoft.
Microsoft ,
,
.

,
.
Microsoft.
,
: Access, SQL Server, Visual Basic, Visual C++
Visual FoxPro. -
, ,
.
. 3.1.
3 .1 . Microsoft

converted to PDF by HupBaH9I

Access
.


SQL
Server
.

.

Visual
Basic

.

OLE.

Visual
C+ +

.

.

Visual
FoxPro


.

.


Xbase SQL.

.

.
,

OLE.

Microsoft Office.

,


.

(Windows 3 .x ,,
Windows 95 ,,
Macintosh . .).

. 3.1
Visual C++, , ,
, .
,

converted to PDF by HupBaH9I

? - , OLE, ODBC,
DAO, RDAO, ActiveX ., .
.
, .
, . , OLE Automation,

.
, Visual FoxPro, , Access,
Excel.
,
. . 3.2 ,
.
, .
3 .2 .
Visual Access
MS SQL

FoxPro Visual Basic Server

Binary

dbLongBinary bynary(n) n
Image

Byte

dbByte
tinyint
1
Character C
dbText
char(n),
n
Text
varchar(n)
Count

dbLong

Currency Y
dbCurrency money
Date
D

DateTime T
dbDate
datetime Logical
L
dbBoolean
bit
(Yes/No)
Numeric N

float
n
d

Integer
Integer
Double
Float

I
B
F

General G
(OLE
Object)
Memo
M
Single

Character C
(binary)
Memo
M
(binary)

n
n

d
-

text
real

dbInteger
dbLong
dbDouble

smallint
int
float
float

dbLongBinary

image

dbMemo
dbSingle

1,2
1
4
4
8
8
8
1

1 20

2
4
8
1 20

4
4
1

B in a ry Im a g e . .
, . .
B y te . 0 255.
C h a ra cte r. ( 254
).
Count. ,
. 1.
C u rre n cy. .

.
D ate. , .
D ate Tim e. , , .
Lo g ical. .T. .F..

converted to PDF by HupBaH9I

N um eric. .
In te g e r (d b In te g e r). -32,768 +32,767.
In te g e r (d b Lo n g ). . -2147483647 2147483646.
Double. .
4.94065645841247E-324 1.79769313486232E308.
Flo at. , . .
G e n e ral. OLE.
Memo. .
S in g le . .
-3.402823E38 1.401298E-45 1.401298E-45
3.402823E38.
C h a ra cte r (b in a ry ). ,
.
Memo (b in a ry ). ,
.

, , ,
- ,
, ,
, , ,
.
. 3.1.
, ,
. , Access
, Visual Basic, .

. 3 .1 .

3.2. Visual FoxPro


Visual FoxPro -
. ,
, .
Visual FoxPro . 3.3.

converted to PDF by HupBaH9I

MirmFftFVlliinlI1
gdl

ilffisi

FgrniBi

la d s

tel*

^tfndaw

] ! ---

[ 1

]
d

ggCammfiiiil
1

d_J

11

Command


. 3 .3 .
Visual FoxPro ;
Microsoft, .
Visual FoxPro ,

, .
.
File :

N ew - .
, . 3.4.

converted to PDF by HupBaH9I


Bbltijfj runs

'

File Tvpe

-f* l-Yojg:-:

!'

11 1'


it /1 I

- Ualito^^e
!=!

lie

Qllgiy

B=ild

- jdtiw

(* ro te Vi ev/

Vv^ad

- | Dim
-
I !
-

f Class

- Tod Fib
-' kt

CariLtl

O tm ci 13

. 3 .4 .

Open - .
C lose - . S h ift,
.
S a v e - , .
S a v e A s - .
R e v e rt - ,
.
Im p o rt - Visual FoxPro.
E xp o rt - Visual FoxPro .
Page Setup -
.
P rin t P re v ie w -
.
P rin t - , , , ,
Com m and (Clipboard).
Send -
.
E x it - Visual FoxPro.

Ed it
, , . .

Undo - .
Redo - .
C ut -
.
Copy - .
P a ste -
.
P a ste S p e cial - OLE .
C le a r - .

converted to PDF by HupBaH9I

S e le c t A ll - .
Find - .
R ep lace -
.
Go To Line - .
In s e r t O b ject - ,
General.
O b ject - , (,
General).
L in k s -

V ie w ,
, . -
- T o o lb a rs,
.
Fo rm at , ,
:

Font - .
E n larg e Font - .
R educe Font - .
S in g le Sp ace -
.
1 / S p ace -
.
Double Sp ace -
.
In d e n t -
Command.
Rem ove In d e n t -
Command.

T o o ls :

W iz a rd s - .
S p ellin g -
(
).
M acros - -
.
C la ss B ro w se r - .
T ra c e W in d o w -
.
Debug W in d o w -
.
O p tio ns -
.

Pro g ram , :

Do - .
C an cel -
R esu m e - ,
Susp en d .
Susp en d - ,
R esum e.
Com pile - . W in d o w
:
A rra n g e A ll - , .
Hide - .
C le a r - .

converted to PDF by HupBaH9I

C ircle - .
Com m and W in d o w - Command.
,
Visual FoxPro , ,
.
V ie w W in d o w - View,
.

Help ,
Visual FoxPro.
Visual FoxPro :
1.

2.

3.

4.

5.


, .
- ,
(),
. , Xbase
Visual FoxPro 3.0 , ,
. ,
.
. Xbase

READ- ,
. Windows ,
, , , ,
. Visual FoxPro 3.0 ,
, , .
, ,
Windows (, ,
).
.


ODBC.
- SQL,
, ,
SQL, .

.
Visual FoxPro 3.0
Microsoft.
Microsoft .

.
! ,
,
(push pin), ,
. Visual FoxPro
OLE 2.0,
Windows.
S E T L IB R A R Y
DLL Windows D EC LA RE.
FoxPro.

Visual FoxPro
.
- ,
, DBF-. DBF
"" DBF-. ,
, ,
, ,
.
DBC
. , , .

converted to PDF by HupBaH9I

Visual FoxPro NULL


ANSI.
MS Access SQL,
.
, Visual FoxPro - ,
, ,
:

.
.
.
,
Browse,
Grid.
.

.
.
, .
.
.
.

FoxPro
Browse Edit (Change). Browse
- , Edit - .
, - , .
View
Browse. Browse . 3.5.

__

M&-D0S Z .2 2
MS-DOS S 22 F iu il i - y d e
n ^ R u :: H IP
MS-DOS 6.22 Rur L agrafe iotn -.0 1 odt-k

115'
I

Whc3wt3.11

r iv

li i -

,4 V

!_t'

V/lHOW j. Ijj'jc.

'

_ _

\Vmcpt4iJj.1_p4c. Lp_3fste _

_
_

;.5- j

ff '-^-Jlf. J1
W n c w t k'j'tnti -Jp-'.

"Ta s "

a Hii- 'D-i l~t hi Hr .

F. *"

: 5' 'ii

HcwB_p4."fci

V /iro o s it V/orl- r. c.jp; 3." 1 i-drl-or far


fi_3.' I i.Jdur
"-/rnL i_,r rfv-

i 'J

Tis"
I 3.V K'U iC' 2lT"
-L I

i 5. j

'|


. 3 .5 . Browse
,
, , ,
, .
Edit ,
. 3.6.

converted to PDF by HupBaH9I


ZlJl 22
250-0-'100
H- hsrtran bwer s :;: ; 1,1
R k l 1:1

"

_J3900
npuuiF.id
0-051.-.'-'011
_

HE

20130

' AssBmbler 1


. .

5"
"Li,


O46-0E5W1OO

201 GO

- vltusl [li'j- 1.0 f:i DOG Ciirdare

m\


. 3 .6 .


View. ,
. , , . 3.5 3.6,
, .

.
,
Windows. ,
Edit. T ab E n te r ,
S h ift + T ab . ,
Visual FoxPro
.
Browse Edit .

Table. ?

P ro p e rtie s - ,
, .
Font - Windows,
.
Go to Record - ,
: Top - , Bottom - , Next -
, Previous - , Record# -
. ,
, - . Locate
,
.
Append N ew Record - .
Togg le D eletion M ark - ,
.
Append R eco rd s - ,
.
, .
,
.
D elete R eco rd s - , ,
.
R e call R eco rd s - , ,
.
Rem ove D eleted Record - PA CK
.
R ep lace Field - ,
.

converted to PDF by HupBaH9I

S iz e Field -
. , .
Enter.
, ,
.
Move Field - .
R e siz e P a rtitio n s -
, .
- .
, .
Browse . 3.7.
.
View .
, . 3.8.
Browse
.
Edit, .

Ik lJ ft

>| MS-DOS 6??


MS-[JQ5e 22 Hits Update

|,| [ .

MS-DOS 6 22 R li? MLR

TPltEj 15" mu 5.25'

itniwi

MS-DflE ? j R us Llpiyatp t e n f "

iCItajiS :W4S25"
Windows J .T d s C

'- .'ii

'
3 1 pjc

"I'oet 5 i 5,1^ ' .2 5 t

Upf

1|2.'52?-'
VAido^fOfWcikgiKHjes 5.1 l5bctftj&Kk.|

ii i
__

1 ^ j

i - i ^ 211 Add i i !ij;0 w ijp^

10224115''

1
a m

f
" j '' '

"

H
f ,
-J

"

i0i
cxoj

2s" ~
6 2S

'.;

"irl??cj W

jotf
jsjti
96.00^
sexo7

SSuOfr

^ "


. 3 .7 .

Windows NT Server 3.5 Upgrade

jd

MS Source Profiler 1.0


Fortran 5.1

_ l

Fortran Power Station 1.D

Fortran Power Station 1.0



3.5"
_
499,00

| Macro Assembler 6.1

20122

250-051100

20130

016-051AV611________________

Visual Basic 1.0 for DOS Standard


Visual Basic 1.0 for DOS Pro
Visual Basic 1.0 for DOS Pro Upgratf
Visual Basic 3.0 Pro for Windows
Visual Basic 3.0 Pro for Windows L
Visual C++ 1.0 Pro

iMacro Assembler 6.1



9.5"

109,00
iqnuiyKTa
046-095AV100

20160

Visual Basic 1.0 for DOS Stai T

Vi?l i*al P.4-4- 1 5 ^ rn|

. 3 .8 .

L in k P a rtitio n s -
, .

.
C hange P a rtitio n s -
.
R ebuild In d e x e s -
.

converted to PDF by HupBaH9I

, ,
C trl + PgDn.
Visual FoxPro 3.0
Xbase, "",
-
,
.
, ,
- .
- -
. ,
. , - . Visual FoxPro 3.0
,

.
, . ,
, ,
.
, , ,
, .
, .
,
- .
, ;
.
, FoxPro,
.
Visual FoxPro . 3.3.
3 .3 . Visual FoxPro





APP
,



DBC

DCT

DCX

DBF

IDX

CDX
FPT

ERR

,
EXE

- APP

FKY

FRX

FRT

PRG
FXP

LBX
LBT

MNT

MNX

MPR
MPX

converted to PDF by HupBaH9I


ActiveX

Visual
FoxPro

OCX

PJX
PJT
QPR

QPX

SCX
SCT
TXT
VCX

VCT

FPW


, , .
FoxPro
. Visual FoxPro
Microsoft .
, Visual FoxPro 3.0 -
,
.
, 3.0.

Project Manager
,
. - , ,
FoxPro, PJX.
Project Manager . 3.9.

converted to PDF by HupBaH9I


/1^1 SJIUMtHI lipUztt.lid

y iv e

^^ iitfpeKJitHtHiiH ^ numbii? di/


Me-ietK&oe

: wr. iUUr-^_
11000

All

D o cirre n le

__________
f:=I DnCUnDII<C
Ctecc UbisriDC

0-

Coda

OliH-

-..

M..

Coda

1fy

S' tH Other

Bui d..
A
Drraipliofi
=nr

p^.lFsft.'jT-ilRflHyin

^|:

3anytk - * 1- ( . .),
^, .
ai j w ^! ia i i J L e n i a

. 3 .9 . Project Manager
Project Manager ,
. "+" ,
, . "+",
.
, ,
Visual FoxPro. ,
.
Project Manager , ,
.
, " ",
. 3.10.

converted to PDF by HupBaH9I

P r a ja ii M anager

{ * )

. 3 .1 0 .

Database Designer
Database Designer , , ,
.
Visual FoxPro 3.0 - ,
.
, .
, , , ,
, , .
, . ,
,
, , Database Designer.

Form Designer
,
. , Form Designer -
.
. C Layout
, Form Controls
, Color Palette
. Properties ,
. Visual FoxPro 3.0
Data Environment Designer. Data
Environment Designer
Database Designer.

Data Environment Designer. Form Designer
Visual FoxPro. ,
Form Designer.

Visual Class Designer

converted to PDF by HupBaH9I

-

, . - Visual
FoxPro
. , Visual Class Designer.
Visual FoxPro
, .
- VCX. Visual Class Designer
.
, Propeties. Visual Class
Designer , Form Designer,
.
, F1.

Query / View Designer


,
. FoxPro, SQL Query Designer (R Q BE) SQL
QPR. Browse, , ,
, , .
View Designer
SQL ,
.
.
, .

ODBC.

Connection Designer
( ) ,
, Connection Designer
ODBC.
,
.

Report/Label Designer
.
, , , ,
.

, .
,
.
, Environment Designer.

Menu Designer
Visual FoxPro
MPR.
.


- , " "
. Microsoft,
, Visual FoxPro (W izards),
, , ,
Microsoft Word Excel. . 3.4
, Visual FoxPro.

converted to PDF by HupBaH9I

3 .4 . Visual FoxPro


Table


Query
(Cross Tab)
MS
Graph



Form

" "
Report

" "

Label

Mail
Word
Merge
Pivot
,
Table
MS Excel
Import Visual FoxPro
FoxDoc
Setup


Upsizing FoxPro SQL
Server
Tools,
Project Manager , New.
, ""
(Designer).
, ,
.
. ,
,
(Drag and Drop) .
2.6 -
,
.

:

;
;
( );
;
.

,
.
. 3.11 .

converted to PDF by HupBaH9I

E l

Form Wizard

Step 1 - Field Selection


Which fields do you want in your fo rm ?
1. Select a database or the Free Tables item.
2. Select a table or uiew.
3. Select the fields.

D a ta b a se s / Tables:

A va ila b le Fields:
Key_m odel

| AUTO_STORE
j

MODEL

FIRM
COUNTRY

S elected Fields:

7]Name
"I

Swept_volume

model

Quant ity_drum

Capacity

C ancel

B ad;

--------------- 1---

N ext I
Finish
11-------1
--------------- 1

. 3 .1 1 .
:

;
( );
.

,
.
,
. "" ,
_ W IZ A R D .
( DBF), ,
, , .

3.3. Access
Microsoft Access -
. ,
Microsoft, Microsoft Office.
, .
, , .
Access
, Paradox for Windows Lotus Approach.
.
Access 7.0 Microsoft Jet 3.0,
- .
.
. ,
, Access
. ,
.
, Access
Visual Basic for Application, ,
, DLL-, OLE Automation ,
OLE-.
, .
MS Access , ,
. Access -
, , ,

converted to PDF by HupBaH9I

.
, Access,
, Access Developer Toolkit,
ActiveX.
Access, , -
Microsoft Office. , ,
Microsoft Word ,
.
.
, : , , , ,
, .
ISAM
: DBASE, Paradox, Excel, , FoxPro 2 ., ODBC
- .
Access 7.0 OLE , OLE . ,
Access , ,
OLE .
SQL
.
, , Access
, .
.
,
. , Access - .
10, Access
, , Microsoft
Office. ,
, .
,
, Access. ,
, .
, Access

. ,
. Access,
, ,
Microsoft Windows.
Access
. ,
, .
, .
.
, .
Access ,
, ,
. , .
. ,
. ,
.
, , .
, .
. 3.12. . 3.5 , Access.

converted to PDF by HupBaH9I


Autostore

11 | (3 | 0 | | ] ^

5=5
5 ft
Account |

Cuslomar

. 3 .1 2 . Access
3 .5 . Access 7.0

,
,
.


, .

,

, ,
.

,,


.

,


,
.

,

" Excel"
Microsoft Excel
.


.
,


, , .

, SQL
.

, SQL


.
,
Grid
Browse
.

,


,
.

, .

converted to PDF by HupBaH9I


,

,

,
. Access
, .
Access
.
. (-,
), . 3.13.
,
. ,
, .

/.

2,499

12,499

12,499

12,499

:
|c:\Sport
:
(

"

. 3 .1 3 .
, - .
,
.
. 3.6.
3 .6 . Access

,
. Access
,
. ,
,,

converted to PDF by HupBaH9I

,
.

.

,
,
, ,
, .

6 .

.
,
,
,, ,
,
(. 3.14).

.

.

. ODBC

, ODBC .
8 .

,

,

.

.
& * .
. ,
. .

--.no' itn'iKi i

1
01
ToesptN?

Pol ::11
1

__1


^
S5.L1V1


**. 1
*ili'ijl1",! IL-I '

_ d

Jd

ji-L-n.I'r? |

fjinro

. 3 .1 4 .
, , , , ,
, , , SQL,
. .
, ,
(. 3.1 5 ), , , -.
, , ,
.

converted to PDF by HupBaH9I


b M

b M B J :

I XlfrleM

* [r* ? H

x)|Sl? ~ 3

rv IM

,


. 3 .1 5 .
, ,
- , .
. , ,
.
.

Access
. , -
,
- . ?

, , . Access ,
, - . ,
, Access .
(SQL pass-through), (DDL)
.
Access ,
, .
. , Access
, ,
. . ,
Access -
Access .
. Microsoft
Internet, (
) . ,
,
.
, , ,
. .
. - , ,
.
.
, Access. ,
,
.
, ,
,
Access , Visual FoxPro Excel,
. , , DAO,
.

.
. ,
, , , ,
Access, .
, ,
. .
, .
: , . 3.16, SQL - . 3.17 - . 3.18.
SQL ,
. ,
.
SQL- .

converted to PDF by HupBaH9I

SQL, SQL.
SQL, .
, .
. Microsoft ,
, .
, - Access.
.
. - ,
. ,
-
, . 3.19.
...

. 3 .1 9 .
SQL,
, , - .
, .
. . SQL.
RunSQL. -
.

.
, ,
.
, , .
,
.
.
. ,
, ,
. 3.20. , ,
.

, . 3.21, .
, ,
, :
( ), .
, , ,
.
sbl o i

a ils il

. 3 .2 1 .
, ,
. 3.22, . ,
,
. , ,
.
, , ,

converted to PDF by HupBaH9I

,
, ,
.
. 3.23- 3.27.


.

.

/:
|: automobile passenger - |
:

key_auto

.--------- j

1^ 1

kei)_model
datejssue

_ ^ l

>

. 3 .2 3 .

(*

<

. 3.24.

>

converted to PDF by HupBaH9I

__________________

>

<

. 3 .2 5 .


:
| automobile passenger

'Bcjrjpoaif;

Cjc}'

.
:

.
^ .

I-

<

' :?

^ ^ otobo^ J

. 3 .2 6 .
1 a uto m o b ile p a s s e n g e r

_ m odei
date issu e

*I U * l : 8

. 3 .2 7 .
- -
OLE .
, ,
,

converted to PDF by HupBaH9I

. ,
.
, , ,
.
,
.
, .

. .
, ,
90% , . ,
28 ,
(. 3.28).


,
.
.

>

. 3 .2 8 .
, ,
, , ,
, Access Grid, Visual FoxPro.
.
, .
.
: , .
: , .
, - ,
, .
Access ,
, ,
,
.
, - ,
- . .
, ,
.
,
, ,
.
.
,
.

converted to PDF by HupBaH9I

,
. Microsoft .
. ,
, ,
.
. ,
. , ,
, . ,
, - ,
, ,
.

. -
, .
.
.
,
.
.
, .
.

, , ,
Access, ,
. Access
. ,
, (. 3.29).
, ,
.
.
. .
.
.
!

H T W ? 1 :

1"
frill-.,
*11

-fi'tf irr-.ifcii
*

g f id w M H 'i -v

jmchi .-

!



. 3 .2 9 .
,
, .

converted to PDF by HupBaH9I

, , ,
.
, ( ...)
.
, -
.


Access
. , ,
, . ,
. Access ,
.
. .
, .
Admin,
Security, Access Developer Toolkit.
.

3.4. Visual Basic


Visual Basic , ,
,
.
, Visual Basic ,
. Visual Basic
,
, . 3.30.

converted to PDF by HupBaH9I





^uu hiljV ih iM l U tnjt

J -

F hi Edil VLtht JiiuuiL Rum TulJu Add-liiu HuI^j

~fJ
V

F n n n l Farm

IH | I

^LrfnpEdlHW

1 TO
Fa]ae

BackGohr

B<TOOODODOFB<

jiii


3lpQoieols

? 5 *
hoim 1
T ru e

bntrolEkM
jrmvMsda

TnrB
13-C iip y P *n

Drwijtyld

Dj d NeJ
1

H reuM Jih
Enabled
FillCota

Tn*e

rillStylE.

Font
F tin tT tU ip S fb n

M S Ssn e Serif
T IL *

F o r e C r 'a r

B:hseDDDDDlia

IqiglYl
HelpGsfllexllD

M ftJDClDDDM i

-TrajlE|J04lH

( )
1

JSft

lin k M o *
UnkTopii]

1116
P
Ftjiml

_^ J

cfcopj.i

-t
. 3 .3 0 . Visual Basic 4.0
Visual Basic
.
Visual Basic. F ile Microsoft
, :

N ew P ro je c t - . Visual Basic 4.0


. Visual Basic.
Open P ro je c t - .
S a v e File - .
S a v e File A s - .
S a v e P ro je c t - .
S a v e P ro je c t A s - .
Add File - , ,
.
R em o ve F ile - ,
, .
P rin t Setup - .
P rin t - .
M ake E X E File - ()
EXE.
M ake O LE D L L File - ()
Windows DLL.

converted to PDF by HupBaH9I

Ed it ,
, .
V ie w
.
:

P ro ced u re D efin itio n - ,


.
L a s t Po sition -
. "". Insert
(, , . .).
Run :
S ta rt - .
S ta rt W ith Full C om pile -
.
End - .
R e s ta rt - .
S tep In to - .
S tep O ver - .
S tep To C u rso r - ,
.
Togg le B re a ke p o in t - ,
.
C le a r A ll B re a k e p o in ts - .
S e t N ext S ta te m e n t - ,
.
S h o w N ext S ta te m e n t - ,
.

T o o ls :

Add W atch -
.
Ed it W atch -
.
In s ta n t W atch - ,
.
C a lls - .
M enu Ed ito r - .
C ustom C o n tro ls - VBX ActiveX.
R e fe re n c e s - .
G e t -
(MS Visual SourceSafe 4 .0 )
.
C h e ck Out -
/.
C h e ck In - .
Undo C h e ck Out - C h e ck O ut, .
O p tio ns - .

A d d -In .
:

Data M an an ger - .
A d d -In M anager - .

Help Visual
Basic.

Visual Basic , . 3.7.


3 .7 . Visual Basic

converted to PDF by HupBaH9I


OLE (ActiveX)



EXE

MDB
RPT
OCX (VBX)
VBP
FRM
FRX
BAS
RES
CLS

Visual Basic,
, Data Access Object (DAO), 32- - JET 3.0
.
Visual Basic ,
, . Visual Basic
Access. JET 3.0
. JET 3.0
SQL, , , 100
ANSI.

. ,
DAO, ,
, . Visual Basic
.
,
, ,
.
.
JET 3.0 (
). MakeReplica.
Synchronize
. ,
, ODBC.
, JET 3.0 , ,
.
Visual Basic Enterprice Edition - Remote
Data Object (RDO) - Remote Data Control (RDC).
, JET 3.0,
,
.

3.5. MS SQL Server


Microsoft SQL Server 6.5 - -.
,
, , ,

.
MS SQL Server , ,
.
, .
SQL Server
.
,
- . Microsoft

converted to PDF by HupBaH9I

SQL Server 6.5 Microsoft BackOffice,


,
.
Microsoft SQL Server 6.5 ,
-.
, .
, Microsoft SQL Server 6.0,
6.5 . SQL Server 6.5

,
,
.
SQL Server 6.5 ,
(Dinamic Locking),

.
SQL Server , Oracle, IBM DB2,
Sybase, Microsoft Access ( ODBC ,
).
, OLE Automation,
, OLE,
SQL Server. Visual Basic 4.0 32- DBLibrary (OCX). Transact-SQL
,
. .
Microsoft SQL Server 6.5 .

.
, ( ) ,
, , ,
.
.
Enterprise Manager ,
. ,
:

,
( );
;
;
- ;
, ;
/
;
: ,
, .

, , Microsoft SQL Server 6.5. Microsoft SQL Server 4 .x 6.x Sybase.


SQL Server
.
, .
,
.
.
SQL Server
(. 3.31). . 3.7.

converted to PDF by HupBaH9I


M fcrosott S Q L S erver . [Common|

Ql Eniwpise SQL Service

Manage;

ISQ U w

Manager

SQL S aerify
Mahagsr

S Q L T m cs

SQL Client
Conligualian

Utiftv
MS G jei

>

SQL Server
SQLSetver
Web Assistant Books Online

?
Microsojt
&

ODBC SQL
:- :l V I P i -'

SQL
Pejfatnence
Mptiitpr

.151
SQL
DistifcuJed
ManegelflSnt
Obtecls

Readme.bit

SQL Setup

. 3 .3 1 .
3 .7 . SQL Server 6.5



SQL Setup
,

SQL Server .
Setup

, ,
Master
.
SQL Service

Manager
SQL Server (SQL Server SQL Executive).
ISQL/w

Transact-SQL
.
SQL Security

Manager
SQL.
SQL Enterprise
Manager
.

,
.
SQL Client

Configuration
.
Utility
SQL Transfer

Manager

.
SQL Trace
,


,
Microsoft SQL Server 6.5. SQL Trace


,
,
.

3.6.
, -

, FoxPro. , ,
: " ?"
,
(, , ),
.

converted to PDF by HupBaH9I

, .
,
: " , ?"
.
, ,
. Visual FoxPro.
- Visual FoxPro - Microsoft,
:

-,
,
,
.
,
.

( ).

.

. 3.8.
3 .8 . (C) ()
Visual FoxPro


+ ++

+ ++
, ,

+ + +
Windows + + +
3.1n, Windows NT Windows 95
,
+ ++

,
+

Windows 3.1,
Windows NT Windows 95
(Setup W izard),,
+


Class Browser -
+

+
EXE
OLE,
+


Win32 API,
+

DLL- ( CD-ROM)

"- + + +
"
, , Microsoft SQL Server, ORACLE 6
ORACLE 7, 32- ODBC

converted to PDF by HupBaH9I

2.0

,
Microsoft
SQL Server Visual FoxPro
(Upsizing Wizard)
OLE 2.0
OLE Container,

OLE
OLE Automation,
Visual FoxPro
OLE-,
Visual FoxPro

,

API
,

,,

GENDBC.PRG
,



, Imagedit
Developers Guide, Installation
Guide, Quick Reference Guide Users Guide
Language Reference
Professional Features Guide

+ ++
+

+ ++

+ ++
+ ++

+ +
+
+

+
+
+
+
+ ++
+

Visual FoxPro ,
.

- Mastering Microsoft Visual FoxPro 3.0,
CD-ROM
. ,
. :

, .
Visual FoxPro.
.
, , .
OLE OLE Automation.
"-".
.
.
.
Project Manager, , FoxPro 2.x
3.0, .
Windows.
.

Access , MS Office
for Windows 95 Professional. Access, ,
,
. Access, ,

converted to PDF by HupBaH9I

MS Office.
MS Office for Windows 95 Professional Access
:

MS Excel -
.
MS Word - Windows
.
Power Point - .
Sheduler Plus - .

,
OLE 2.0 ODBC,
- Visual Basic


:

MS Office,

for Application.
Access Developer's Toolkit 95,
-

Access.
,
.
10 32- OLE.
.
Windows 95.
Visual Basic.
.
MS Office.

Visual Basic : ,
(Enterprise Edition):

,
, .

. , ,
.
,
"-" .

. 3.9.
3 .9 . Visual Basic 4.0a -
( ), () ()


+
++ ++
,

++ + +
+
(Add-in)
( CASE)
+
++ ++


(ActiveX, 16- Visual
Basic Custom Controls, OLE- DLL)
++ + +
+
16
32-

++ + +
+
,

converted to PDF by HupBaH9I

+

Windows 95,
,
. .

32


Visual
SourceSafe
(
Visual Basic
, , ,

, )
Microsoft
Access, FoxPro, dBASE, Paradox Btrieve
( 16- )
Microsoft Excel



ODBC 2 .0 ,,
.
Microsoft SQL Server
Data Explorer

(Remote Data Control RDC), ODBC
ORACLE
Server Microsoft SQL Server
OLE 2.0
OLE Automation



,
450

Crystal Reports for


Visual Basic 4.0


Windows 3.1 Windows 95 API
( Win32 API CD-ROM)
250 bmp wmf

++
+

++
++

16 16
32- 32
+
+
+

++

++

++

++

++

++

++

++

++

++

+
+

+
+
+

++
++
++

++
++
++

++

++

++

++

+
+

++
++

Visual FoxPro, Visual Basic CD-ROM


- Mastering Microsoft Visual Basic 4.0.
:

Visual Basic .
.

converted to PDF by HupBaH9I

.
.
.
.
Cristal Reports.
Windows.
OLE OLE-.
.
, .
.

Microsoft SQL Server - "-"


BackOffice. MS SQL Server
:

Microsoft Windows NT Server


Microsoft LAN Manager
Novell NetWare
TCP/IP
IBM LAN Server
Banyan VINES
DEC PATHWORKS
Apple AppleTalk

Microsoft Windows
Microsoft Windows
Microsoft Windows
Microsoft Windows
Microsoft MS-DOS
UNIX
Apple Macintosh
IBM OS/2

3.1
95
for Workgroups
NT Workstation

BackOffice MS SQL Server 4


-:

Microsoft Windows NT Server - ,


, ,
SQL Server,
. ,
32 ,
, Novel NetWare, UNIX . .
Microsoft SNA Server - ()
( ) IBM, SNA (Systems
Network Architecture).
Microsoft Systems Management Server
, .
,
, .
Microsoft Mail Server - ,
.
- Microsoft Electronic Forms Designer.
Visual Basic,
.

, BackOffice
.
2
3.

converted to PDF by HupBaH9I

,

.
. 3.10.
3 .1 0 .

V isu a l A cc e ss
V isu a l SQ L Serve
FoxP ro
7 .0
B a sic
6 .5
3 .0
4 .0

486DX 486DX
386DX
486DX-33

(Intel

Pentium),

PowerPC,
MIPS, R4xx
Alpha
AXP
+
+
+
+

):
+
++
++
Windows 3.1
Windows 95

++

+
Windows NT 3.5

8 (12)

,

++

++

++
12 (16

Windows
NT)
10-40

++
++
6 (16 1 6 (3 2 )
Windows
NT)

15-80
,

, ,


CD-ROM CD-ROM

8-36

80

CD-ROM

CD
ROM

, , ,
.
,
,
.
, .
,
.

4

4.1.
4.2.
4.3.
4.4.



" "

, , ,
. ,
, , ,
, - .
,

converted to PDF by HupBaH9I

, ,
.
Visual FoxPro
,
. , ,

.

4.1.
,
. , , ,
. ,
. ,
.
.
:

.
.
- .
.


.
, ,
, - Microsoft.
, Access Visual Basic,
Visual FoxPro.
, - -
, -
. ,
, . ,
,
.

-, ,
. , Xbase Visual FoxPro
, . Visual Basic
. ,
, .
,
,
. - ,
. :
COPY TO FileName [FIELD S FieldList] [Scope][FOR Expression]
. ,

, . ,
, . , Visual
FoxPro .
- - ,
Visual FoxPro
.
, .
FIELDS ,
.
, Scope, ,
. ,
Scope : ALL - ; NEXT
nRecords - ( ); RECORD nRecordNumber
- ; REST - .

converted to PDF by HupBaH9I

FOR
, , .
,
. ,
, ,
, .
.
4 .1 .

,
()

,


,

,
,

-
, .
:

. ,

, : "".

"" " " Visual FoxPro :


{1 0 /1 0 /9 5 }. Visual Basic
" ". "": #10/10/95#.
- .
.
Visual FoxPro : ".T." - (True),
".F." - (False). Visual Basic
True, 0 - False.

, . 4.2.
, . 3.2.
, !
. 4.2
. .

"$" -
.
.
" ==" , "=".
"",
"". , cName = "",
Visual FoxPro , "",
"", "".
" ==",
"".
, .

, , ,
.
:
1.

converted to PDF by HupBaH9I

2.
3.
4.
5.
6.
7.
8.





NOT
AND
OR

.

.
(private)
(), .
, , .
Visual FoxPro
PRIVATE MemVarList | PRIVATE ALL [LIK E Sceleton | EXCEPT Sceleton]
Visual Basic
Dim VarName [([Subscripts])] [As [New] Type][, VarName [([Subscripts])] [As [New] Type]]...

Static VarName [([Subscripts])] [As [New] 7ype][, VarName [([Subscripts])] [As [New] Typ e]]...

.
,
, (
), "" .
, , - ,
, ,
. Visual
FoxPro ,
, "*" "?"
, (L IK E ),
, (EXCEPT). ,
"?" "*",
- , - . "*"
, "?" .
Visual Basic .

, - .

() .
Visual FoxPro
DIMENSION ArrayName1(nRows1 [, nColumnsl]) [, ArrayName2(nRows2 [, nColumns2])] ...
65000 ,
254x255, 1000x65 . . nRows1 =1000
nColumns1=65, nColumnsl p, p.

.F..
Visual Basic D im ,
Subscripts .
, , Visual FoxPro

STORE Expression TO MemVarList | ArrayList

converted to PDF by HupBaH9I

MemVar | Array = Expression


= p p p Expression
p . :
DIMENSION aMembers(4,2)
STORE 5 TO aMembers
Visual Basic (
, ):
Dim aMembers(4,2), nX As Integer
For nX = 0 To 4
aMembers(nX) = 5
Next nX
Visual FoxPro
, :
STORE CTOD('. .') TO dDate

STORE { } TO dDate

, :
S ET DATE GERMAN
STORE {0 1 .0 1 .9 1 } TO dDate
Visual FoxPro
S E T D A TE.
Visual Basic :
Dim dToday As Date
dToday = #1/11/96#

Format(Expression [, Format [, FirstDayOfWeek [, FirstWeekOfYear]]])


:
dDate = Format(dToday, "dd.mm.yy")
dToday 01.11.96.

(public)
.
Visual FoxPro
PUBLIC MemVarList | [ARRAY] ArrayName1(nRows1 [, nColumnsl]) [, ArrayName2(nRows2 [,
nColum ns2])]...
Visual Basic Dim
Public VarName [([Subscripts])] [As [New] 7ype][, VarName [([Subscripts])] [As [New] Type]]

converted to PDF by HupBaH9I

- .
(local) ,
. ,
. Visual FoxPro
LOCAL MemVarList | [ARRAY] ArrayName1(nRows1 [, nColumns1]) [, ArrayName2(nRows2 [,
nColumns2])] ...
Visual Basic Dim .

. ,
, .
(regional) Visual FoxPro.

REGIONAL MemVarList

#REGION nRegionNumber
nRegionNumber ( 0 31), ,
MemVarList.
.

4.2.
,

Visual FoxPro;
Visual Basic;
Access.

.
Visual FoxPro. .
.
. , " ".
, - Visual FoxPro
Command .
, .
, ,
, .
S PP O S.d B f, , ,
" ", File
Open, SPPOS.DBF. Database
Browse , .
, Command :
USE Sppos
BROWSE
LOCATE FOR Company = " "
,
. . ,
File New, Program.
FoxPro. Command.
,
.
Open
File.

converted to PDF by HupBaH9I

,
Visual FoxPro. .
, ,
, .
- . Options
Tools. Edit.
. 4.1.

-LifiCTM ,

cwm&d\& a

ngpe^i

lexnoitoi
)!

C o x p riH t H H u

mm

rftnl rrii '

Rrn|i4 I.

'
rwfll

tnfcl1||-||
-'

t Jil
1 1iw^bu-iiJ'

P IJrau-aiNJ-LiiHjp
.I- ^UrdW-BFi'

4ehf J4L^L4-| Ipi

" *L M -' W 4 l fcfK '-H- h Iv

I- ..uliiprivEjLhiu

tKl'UIIH.J L- . *

Aliqr4T.*n*

| Ll-^i

. T a b W iihh- ;c fo j-a .i* i i t

^
P

I-T|*T/rr||KfV>p.-.-LBH-J.

I? ^-'TVll L*l-' ''VinJU

P'Prr
F
P

Sut ttLD l^bIi^.

&

*
Tab


. 4 .1 .
, , FoxPro
, "p-",
. "p-"
.
.
, , - ,
. .
, Visual FoxPro
, , ,
Options ,
. ,
, Options , . 4.2. ,
, , .

converted to PDF by HupBaH9I

O p lio n !;

F o rm s

P io ie c t s

0 |> 1

V ie w

G e n E ra J

E d il

D o rn

B e rn a le D t1 o

F ile - L o c a t io n s

E d H ' c o m ni'
17 Q i o g - e n d - D r o p E r J u in g

|7 WordWipp

iwiiplle Selma Saving


Save with jid-o1-Fil9 Marker
i 4 w Jjne- - de

17 Aunomeiic Indent
A lig n m e n t

| L e ft

T obW id in (choredlEri)

[2

. C c

17 SeueEreiernn^es
Seias DetavliSoi Memo^

17 hor* bneyCoiumn F'ofihon

Seifl-oDefault

OK

Cinc.fl

Kelp f

. 4 .2 .
, Edit
Format. ,
. 4.3. .
.

,
.
.

Visual FoxPro Tools.


. 4.3.

Macros
-Individual

ij

12

M
e

f?

...

OK

Record..
w..
E d it.

d ea r

Save,,.

Resjore...

Set fiefault

Clear &JI

. 4 .3 .
,
.

converted to PDF by HupBaH9I

, .
New.
, . 4.4. ,
.

Macro Edit
Defined Key:

|CTRL+F

Macro Name:

|ctrl_f

OK

Cancel

Macro Contents:
FO R{E NTE R]-[E NTE R}E NDFO R

Ctrl+Tab to exit
. 4 .4 .
4 .3 . ,

Ctrl+A
Select All

Ctrl+C

Copy
Ctrl+F
Find

Ctrl+L
Replace

Ctrl+R
Redo

Ctrl+V
Paste

Ctrl+W


Ctrl+X
Cut

Ctrl+Z
Undo


Ctrl+Home

Home

Ctrl+End

End

-
. F O R ...N E X T .
, ,
, .
Ctrl+F. ctrl_f.
,
Visual FoxPro. Macro Contents :
FO R {EN TER }{EN TER }N EXT
,
. Enter

converted to PDF by HupBaH9I

. ,
ON KEY LABEL .
, , Ctrl+F
:
FOR
NEXT
FoxPro - , ,
.
(), ,
.

PROCEDURE ProcedureName
, :

PRO CED U RE.


RETU RN - .
CAN CEL - .
Q U IT - .
DO .
.

FoxPro ,

FUNCTION FunctionName
, .
:
1.

2.

3.
4.

. ,
dToday:
dToday = DATE()
. ,
, G E T D IR ():
S ET DEFAULT TO GETDIR()
:
? TIM E()
- :
SYS(2002)


RETURN [Expression | TO MASTER | TO ProgramName]
,
; TO MASTER,
, TO ProgramName
.
.T ., Expression.
RETRY
R ETU RN ,
.
.
, 1 10.

. , .
*
DIMENSION aSampleArray(10)

converted to PDF by HupBaH9I

FOR nItem = 1 TO 10
aSam pleArray(nItem ) = nItem
= Append_proc()
NEXT
FUNCTION Append_proc
? " "
?? nItem
, .
( ),
.
Visual Basic.
, ,

, Visual FoxPro. .
Options Tools.
Visual Basic Project (. 4 .5 ). Startup
Form , , - Form1, Sub Main.
Form1
. Sub Main
.


E n v iro n m e n t

I n j e c t | E d ito r | A d v a n c e d |

Pnojei :t Name:

S tartup Form :

|Project1

Help File:

[_
_
HelpComtextlD:

-SlartUoda----------------------Standalone

OLE Server

Gomjgaiible OLE Server:

J
A p p lic a tio n D e s c rip tio n :

OK

C a n ce l

H e lp



OLE
. 4 .5 .
Module Insert.
Procedure. ,

converted to PDF by HupBaH9I

. 4 .6 , - Main,
Sub, - Public. OK
, .

Insert Procedure
OK

Name: |Main|
-T y p e -------------------------------------

(* Sub

Function

Cancel

Properly

-Scope-

(* Public

Private

" All Local variables as Statics

. 4 .6 .
, Visual Basic
Visual FoxPro. Visual Basic
, , .
. .
, . 4 .7 ,
Options, Editor.

converted to PDF by HupBaH9I


Environment | Project Editor |A di/aiced|


Fnn1:

Si

I F

^Ariol Cyr

!l

t|

i-Gcide -

rirh p

P Auto Indent

Selectinn TaJt
SynrtsK Error TaMt
reokpont Text
Newt Statement Teri
Comment Terf
KsywordTeod
IdentifiErTeMt
Foreground:
| Autom atic

Toh

" Full Module V Ie u u


PtDcedurE
pSam plE----------------------------

Background:
J

| A ula m nJtic

3
OK

AaBbCcXxYyZz

Cancel

Help




: * '

. 4 .7 .
,
Visual FoxPro. Proc
(declarations), . 4.8.

converted to PDF by HupBaH9I

1 - I* M
Object

[(General)

Dim a S d m p le A r r a y ( 1 0 ) ,

_J

n Ite m

P u b l i c Sub M a in ( )
n It e m = 1 To 1 &
a S a m p le A r r a y ( n I t e m )
A p p e n d _ p ro c
N ext
End Sub

(tfeclflffHions)

As I n t e g e r

= n lt e it

P r i v a t e F u n c t io n A p p e n d _ p r o c ()
D e b u g .P r in t n Ite m
End F u n c t io n

'.WJ* u
. 4 .8 . Visual Basic

:
Dim aSam pleArray(10), nItem As Integer
Proc Main :
Public Sub Main()
For nItem = 1 To 10
aSam pleArray(nItem ) = nItem
Append_proc
Next
End Sub
Procedure Insert
, :
Private Function Append_proc()
Debug.Print nItem
End Function
Start Run.
F5.
Visual FoxPro Visual Basic
. . - ,
, . ,
, (Debug Window).
Print Debug.
, Debug Window View .
, Visual FoxPro Visual Basic ;
Visual Basic , Visual FoxPro, .
,
. - Visual Basic
Visual FoxPro
.
Access, , ,
,
Access .
, , ,
, ,
. ,

converted to PDF by HupBaH9I

, , .
Access
,
, .
Access .
, .
- .
Access Visual Basic, .
. Access
. , ,
, , .

Sub ()
, End Sub,
- Enter .
:
Sub ()
Dim MyDb As DATABASE
Set MyDb = _ DBEngine.Workspaces(0).CreateDatabase("",_ dbLangCyrillic)
End Sub
,
, , -.
, , .

, .
Visual FoxPro ""
* [Comments]

. , , ,
- .

:

&& [Comments]
, END.
Visual Basic :
[Comments]
, .
Visual Basic , Visual
FoxPro - .

4.3. " "


,
. , , ,
, . ,
, , , Access, Visual
Basic Visual FoxPro,
.
, , .
Microsoft
. ,
-
" " - ,
.
10. ,
Visual FoxPro
? | ?? Expression
, ,
. Command.
Expression , - . Visual
Basic

converted to PDF by HupBaH9I

Debug.Print Expression
Expression Debug Window.
9 . Visual FoxPro
Do Program , Command

DO ProgramName1 | ProcedureName [WITH ParameterList] [IN ProgramName2]
ProgramName1 , Visual FoxPro

:

EXE - .
APP - .
FXP - .
PRG - .

WITH ( )
( 27).
, S E T U DFPARM S TO V A LU E.
ProgramName2 , .
Visual Basic
Call Name([ParameterList])
:
Call PrintToDebugWindow(" ")
Sub PrintToDebugWindow(cString)
Debug.Print AnyString
End Sub
8 .
.
.
Visual FoxPro ,
:
STR(nExpression [, nLength [, nDecimalPlaces]])
nExpression .
nLength nDecimalPlaces .
VAL( cExpression )
, .
Visual Basic :

Str(nExpression)
Val( cExpression )
7. ,
- . .
. ,
. .
.
Visual FoxPro :
SU BSTR( cExpression, nStartPosition [, nCharactersReturned])
cExpression,
nStartPosition nCharactersReturned.

LEFT(cExpression, nExpression)
cExpression , nExpression
.
RIGHT( cExpression , nExpression )
cExpression ,
nExpression .
ALLTRIM(cExpression)
.
Visual Basic :

converted to PDF by HupBaH9I

Mid(cExpression, nStartPosition [, nCharactersReturned])


Left(cExpression, nExpression)
Ri ght(cExpression , nExpression )
Trim ( cExpression )
6.
"",
,
.
Visual FoxPro :

DATE()

TIME([nExpression ])

DATETIME()
TIM E() ,
,
S EC O N D S ().
Visual Basic :
Date
Time
Now
5.
, - ,
, , Visual FoxPro

DO WHILE Expression Commands [LOOP] [EXIT]
ENDDO
, DO W H IL E ,
Expression, .T .,
, .F ., , ENDDO. LOOP
DO WHILE, EXIT -
, Expression.
:

DO WHILE .NOT. EOF() - ;


DO WHILE nMin<<10 .AND. nMax>>100 - nMin 10

DO WHILE .T. - ( EXIT).

nMax 100;

, LOOP () EXIT
( IF ...E N D IF ).
.

DO WHILE .T.
CLEAR
WAIT " 1 2" TO cNumber
DO CASE
CASE cNumber = "1"
? " 1"
CASE cNumber = "2"
? " 2"
OTHERWISE
? ": 1 2!"
ENDCASE
WAIT " (Y/N)" TO cYesNo
IF UPPER(cYesNo) <<>> "Y"
EXIT
ENDIF
ENDDO

converted to PDF by HupBaH9I


W A IT ,
- ,
TO.
Visual Basic
:
Do [{W hile | Until} Expression] [Commands] [Exit Do] [Commands]
Loop

Do [Commands] [Exit Do] [Commands]


Loop [{W hile | Until} Expression]
, :
lCheck = True
nCounter = 0
Do ' ()
Do While nCounter << 20 ' ()
nCounter = nCounter + 1
If nCounter = 10 Then
lCheck = False
Exit Do '
End If
Loop
Loop Until lCheck = False '
4.
,
.
,
. .

, Visual FoxPro :
IF Expression

Commands
[ELSE

Commands]
ENDIF
, .
, , I F ( ).
.T ., , IF ELSE. .F .,
, ELSE, , ELSE
, , ENDIF.
Visual Basic :
If Expression Then Commands [Else Commands]
:
If Expression Then
[ Commands]
[Else If Expression_n Then
[ Commands]] ...
[Else
[ Commands]]
End If
Expression True, ,
THEN. ,

converted to PDF by HupBaH9I

Expression_n Expression. ,
, ELSE.
,
Visual
FoxPro, Visual Basic

IIF(lExpression, Expression1, Expression2)


Expression1, Expression = .T ., Expression2,
Expression = .F.; Expression1 Expression2 , :
TITLE = IIF(nSign=0,"","") + cModel
, :
cProc_var = IIF(nVid>> 5,cProc_1,IIF(nVid<< 2,cProc_2,cProc_3))
DO (cProc_var)
, nVid,
, Expression2
- I I F ( ) . ,
,
, IF ...E N D IF .
3.
, ,
, pp , Visual
FoxPro :
DO CASE
CASE lExpression1
Commands
[CASE lExpression2
Commands]
[OTHERWISE

Commands]
ENDCASE
, CASE.
, , (
.T .), CASE,
, ENDCASE. ,
OTHERW ISE, p .
:
nChoice = 3
DO CASE
CASE nChoice =
? "
CASE nChoice = 2
? "
OTHERWISE
? "
RETURN
ENDCASE

1
1"
2"
!"

Visual Basic -:
Select Case Expression
[Case Expression_n
[Commands]] ...
[Case Else
[ Commands]]
End Select
CASE, Expression_n
Expression. , CASE ELSE.
:

converted to PDF by HupBaH9I

Dim nChoice As Integer


Select Case nChoice
Case 1
Debug.Print " 1"
Case 2
Debug.Print " 2"
Case Else
Debug.Print " "
End
End Select
2.
, DO W H IL E ,
.
:
FOR MemVarName = nInitialValue TO nFinalValue [STEP nIncrement]
Commands
[LOOP]
[EXIT]
NEXT
F O R ...N E X T
, , nInitialValue, nFinalValue,
, nIncrement,
1. LOOP ,
EXIT -
.
Visual Basic :
For MemVarName = nInitialValue To nFinalValue [Step nIncrement]
[Commands]
[Exit For]
[Commands]
Next [MemVarName]
Visual FoxPro ""
LOOP.
F O R ...N E X T ,
MemVarName. Visual FoxPro
. MyString
0 9.

MyString = " "


FOR Words = 10 TO 1 Step -1
FOR Chars = 0 To 9
MyString = MyString + STR(Chars)
NEXT
MyString = MyString + " "
NEXT
? MyString
Visual Basic :
Public Sub Main()
For Words = 10 To 1 Step -1
For Chars = 0 To 9
MyString = MyString & Chars
Next
MyString = MyString & " "
Next

converted to PDF by HupBaH9I

Debug.Print MyString
End Sub
Visual Basic :
For Each MemVarName In ArrayName
[Commands]
[Exit For]
[Commands]
Next [MemVarName]
- ,
ArrayName.
, .
1.
,
.
, ,
, . .
, ,
, . Visual FoxPro
:
MESSAGEBOX(cMessageText [, nDialogBoxType [, cTitleBarText]])
. cMessageText
, .
, cMessageText
(C H R (13)). ,
cMessageText .
nDialogBoxType ,
,
.
.

n D ialo g B o xTyp e
0
1
2
3
4
5
16
32
48
64

0
256
512



OK
OK Cancel
Abort, Retry
Ignore
Yes, No Cancel
Yes No
Retry Cancel

""
""
""
"
(i)"



nDialogBoxType 0.
nDialogBoxType -
.
cTitleBarText , .
cTitleBarText, "Microsoft Visual FoxPro".
M ES S A G E B O X () ,

converted to PDF by HupBaH9I

. Cancel Esc
(2 ), Cancel.
M ES S A G E B O X () .


1
2
3
4
5
6
7


OK
Cancel
Abort
Retry
Ignore
Yes
No

Visual Basic -
:

MsgBox(cMessageText [, nDialogBoxType [, cTitleBarText] [, cHelpFileName, nContext])



Visual FoxPro. Visual Basic
. , nDialogBoxType 4096,
,
,
, .
cHelpFileName nContext
, F1.

4.4.
, ,
. ?
, ,
, - . , ,
3.0, Visual FoxPro Visual
Basic.
.
, :
_
:
l
p
r
g
t

(local)
lnCounter
(private)
pnStatus
(region)
rnCounter
(public)
gnOldRecno
(parameter)
tnRecNo

. ,
. ,
, .
:
a
c
y
d
t
b
l
n
o

- aMonths
- cLastName
- yCurrentValue
- dBirthDay
- " "
tLastModified
- bValue
- l Flag
- nCounter
- oEmployee

converted to PDF by HupBaH9I

uReturnValue

, ,
.
. : "
?"

5
-

5.1.
5.2.



-

OLE
5.3.
5.4.
- , .
:
, ,
.
"-
" ().
, RAD,
, ,
, + + .
Visual FoxPro. ,
,
.

5.1.
, ,
,
.
, - Windows 95. ,
, ? , , , .
,
.
:

.
, .
Visual FoxPro.
Visual Basic.

- ,
. , , ,
, . , ,
, . .
, ,
(, ). ,

converted to PDF by HupBaH9I


.
, ,
.
, ,
.
, . .
, ,
.

, ,
.

, , , ,
, .
. ,
, " " ,
.
, . Visual FoxPro
D E F IN E C LA S S
(Class Designer). ,
, ,
.

,
,
,
. .

" ",
.
,
.
,
. .

,
.

,
.
. .
D E F IN E C LA S S
.
Visual FoxPro .
, , ,
.
,
. , , ,
, .
, .
VCX .

() ,
.

converted to PDF by HupBaH9I

, - - ,
, .
C R E A T E O B JE C T ().

- , .
, , , ,
. .

- , .
, .


.
, ,
. ,
, .
, . ,
,
.

- , .
, . .
, O B JEC T.D R A W .

. ,
. , ,
. , ,
.

- ,
.

" " . 5.1. ,


, . ,
. 5.1 , . ,
, ,
. , . 5.1
.
.
. . 5.1
,
.


&

^



. 5 .1 .

converted to PDF by HupBaH9I

, ,
.

, ,
.

Visual FoxPro .
, , , .
" ".
Visual FoxPro, ,
, ,
. 5.1 .
Visual FoxPro 30 .
. 5.2, . 5.1.

V is u a l

3l IESMRHI |(1

K l.i h

Cheek Boy

Container

Combo Boy

Form

Commanc Dutton

Grid

Control

Column

Fdit Row

Tbolftjjr

-I

Header

Option Button Group

Imarje

| Command Rutton Grr>up

F o rm S ftt

Line
List B^ir

L b B o u n d C o n tro l

OLE Container Control

Shape

PageFrame

I?

P ag a

Spinner
Teyt Boy

Custom
Timer

H e . .

. 5 .2 .
5 .1 . Visual FoxPro


CheckBox
,

.
Column
Grid.

converted to PDF by HupBaH9I

,
- .
ComboBox
,
.
ListBox TextBox,
, ,
.
CommandButton .
,
,
,
, . .
CommandGroup .
Container
,
. Container

,
.
Control
,

. Control
,
Container
,

Custom

.
-
,
,
.
EditBox
.
EditBox

.
Form

. -
-,


.
FormSet
-,
.
Grid
Grid. Grid - ,

Browse,
,

Grid .
Header
Grid.
Header
,
.
Image
,
BMP.
Label
, .
Line
,
,
.
ListBox
.
,

converted to PDF by HupBaH9I

OLE Bound
Control

OLE Container
Control

OptionButton

OptionGroup

Page

PageFrame

Shape

Spinner
TextBox

Timer

.
,

.
OLE.
OLE

OLE
Microsoft Word Microsoft
Excel, OLE 2.0.
OLE. OLE
ActiveX ( OCX)
OLE-
Microsoft Word
Microsoft Excel.
ActiveX, OLE
. ,
ActiveX General
FoxPro,
OLE.
.

.
.
- ,
.

,
.
.
Page


,
.
,
.

:
, ,
. .
,

(, ).

.
,
,
.
-


.

,

.

.
-

converted to PDF by HupBaH9I

ToolBar

,
-
.

.
,
.

,
.
,
.

.
, -
, -. -
, .
,
"". - , ,
,
.
,

( 5.2 ).

, ,
, .


, -
.
, . ,
. . 5.1,
,
, , .
,
, .

, .
.
.
,
. :

cClassName:: Method

-
- .

- ,
" ".
, . ,
,
. :

.
,
, -
.
.
,

converted to PDF by HupBaH9I

, , ,
.

.

-
, .

.
, Draw Box1 Box2
, Draw.

.

-
, .

: , , ,
, , .
- (.). ,
- MyList, :
MyList.Enabled = .F.
,
.
:
MyList.Enabled = .T.
-
. :
MyList.Refresh()
.
, ,
, , :
MyForm.MyList.Enabled = .T.
,
.
100
. cmdClose,
, . . :
FormName.cmdClose
,
, , :

T H IS - ;
TH ISFO R M - ;
T H IS F O R M S E T - .

,
- .
, .
5.2.
5 .2 .



M yObject
T H IS .E n a b le d = .T .

, T H IS .M y O b je c t.E n a b le d = .T .

converted to PDF by HupBaH9I

TH IS FO R M .M yO b ject.En a b led
= .T .
M yFo rm .M yO b ject.Enab led =
.T .
,
T H IS F O R M S ET .M yFo rm .
M yO bject.En abled = .T .

M yFo rm Set.M yForm .
M yO bject.En abled = .T.

Visual FoxPro Visual Basic ,


, ,
( ), .
A ctiv e F o rm :
FormSet.ActiveForm.Property [= Setting]

FormSet.ActiveForm. Method
Property
Method . Setting,
, .T. Setting
, Property.
, Fo rm S e t Visual FoxPro
_ S C R E E N .
Visual FoxPro
. Visual FoxPro,
. , Visual FoxPro
Command C LEA R . ,
:
_SCREEN .Cls
Visual Basic Screen. :
Screen.ActiveForm.MousePointer = 4
A ctive C o n tro l ,
. :
Object.ActiveControl.Property [= Setting]
Debug
,
:
_SCREEN.ActiveForm.ActiveControl.Name
, Visual FoxPro ,
.
.
" "
.
Object. BaseClass
, .

Object.Class
.
Object.ClassLibrary
,
, .
Object. ParentClass
, ,
.
Control. Parent
-. ,
-
:
THIS.Parent.BackColor = RG B(192,0,0)
, -
, ,
, .
,
.

Object.Comment [ = cExpression]
,

converted to PDF by HupBaH9I

, .
-
Object.Tag [ = Expression]
, -
, .
Visual FoxPro
, .
,
10.
,
Visual FoxPro,
,
.
ADD CLASS ClassName [OF ClassLibraryName1] TO ClassLibraryName2 [OVERWRITE]
. Class-Name
, ClassLibraryName2.
, Visual FoxPro
.
OF ClassLibraryName1, Visual FoxPro
, S E T C L A S S L IB . Visual FoxPro ,
,
, ClassLibraryName2. OF ClassLibraryName1
, . OVERWRITE
,
.
ADD C LA SS
.
, Visual
FoxPro ( PRG APP).
DEFINE CLASS ClassName1 AS ParentClass
[[PROTECTED Property1, Property2 ...]
Property = Expression ... ]
[ADD OBJECT [PROTECTED] Object AS ClassName2 [NOINIT]
[WITH cPropertylist] ]...
[[PROTECTED] FUNCTION | PROCEDURE Name
[NODEFAULT]

cStatements
[ENDFUNC | ENDPROC]]...
ENDDEFINE
,
. ClassName1 .
AS ParentClass ,
. Visual FoxPro, ,
, Form .

Custom ParentClass.
[PROTECTED Property1, Property2 ...] Property = Expression...
,
. , PropertyName
Expression.
, PROTECTED
.
.
ADD OBJECT
Visual FoxPro, ,
OLE. Object
. ClassName
, , .
NOINIT , Init .
WITH cPropertyList ,
.

converted to PDF by HupBaH9I

FUNCTION Name PROCEDURE Name ,


.
.
NODEFAULT , Visual FoxPro
, , .
,
, Visual FoxPro. NODEFAULT
,
(Form Designer).
cStatements - Visual FoxPro, ,
.

PA R A M ETER S .
,
C R E A T E O B JE C T () .
, D E F IN E C LA S S,
IF ...E N D IF DO
C A S E ...E N D C A S E DO W H ILE ...E N D D O FO R ...EN D FO R .
, .
.
oForm1 = CREATEOBJECT("frmTestForm")
oForm2 = CREATEOBJECT("frmTestForm")
oForm3 = CREATEOBJECT("frmTestForm")
*
oForm1.Caption = " "
oForm2.Caption = " "
oForm3.Caption = " "
* Show
oForm1.Show
*
oForm2.Move(oForm1.Left + 50, oForm1.Top + 50)
oForm2.Show
oForm3.AutoCenter = .T.
oForm3.Show
*
READ EVENTS
*
DEFINE CLASS frmTestForm AS Form
BackColor = RGB(192,192,193)
Caption = "TestForm"
*
*
ADD OBJECT cmdExit AS CommandButton WITH ;
Caption = "\<< ", ;
Left = 150, ;
Top = 100, ;
AutoSize = .T.
PROCEDURE cmdExit.Click
RELEASE THISFORM
* ,
*
IF _SCREEN.FormCount = 1
CLEAR EVENTS
ENDIF
ENDPROC
ENDDEFINE
:
S ET CLASSLIB TO ClassLibraryName [ADDITIVE]
[ALIAS AliasName]
.
ClassLibraryName . ADDITIVE

converted to PDF by HupBaH9I

, . ALIAS AliasName
,
, . S ET
C L A S S L IB TO .
RELEASE CLASSLIB ClassLibraryName
.
.
CREATEOBJECT(ClassName [, Parameter1, Parameter2, ...] )
OLE. ClassName
OLE-, . Visual FoxPro OLE :
1.
2.
3.
4.
5.
6.
7.

Visual FoxPro.
,
.
.
, S E T C L A S S L IB .
, S E T PRO CED U RE.
Visual FoxPro.
Windows ( OLE).

OLE- ClassName:
ApplicationName.Class
, Microsoft Excel OLE
:
oExcelSheet = CREATEOBJECT("Excel.Application")
, Microsoft Excel .
Windows 95.
, C trl+ A lt+ D e l, Excel
. , Excel ,
. OLE Automation
.
Parameter1, Parameter2, ... ,
Init . Init ,
C R E A T E O B JE C T () .
C R E A T E O B JE C T ()
OLE .
,
D E F IN E C LA S S
, S E T C L A S S L IB .
S TO R E .

.
. .
*
S ET CLASSLIB TO Office
*
oTbr1=CREATEOBJECT("Office_Toolbar")
oTbr2=CREATEOBJECT("Office_Toolbar")
oTbr3=CREATEOBJECT("Office_Toolbar")
*
oTbr1.Caption = " "
oTbr2.Caption = " "
oTbr3.Caption = " "
*
oTbr1.BackColor = RGB(0,0,255)
*
oTbr1.Show
oTbr2.Show
oTbr3.Show
* 20 ,
*

converted to PDF by HupBaH9I

READ TIMEOUT 20
,
, .
*
PUBLIC ARRAY aTest(1)
DIMENSION aTest(5)
*
_SCREEN .CLS
*
FOR nCount = 1 TO 5
aTest(nCount) = CREATEOBJECT("frmTestForm")
*
aTest(nCount).AutoCenter = .T.
ENDFOR
*
FOR nCount = 1 TO 5
IF TYPE("aTest(nCount)") = "O"
aTest(nCount).Show
ENDIF
ENDFOR
*
*
DEFINE CLASS frmTestForm AS Form
ADD OBJECT cmdExit As CommandButton WITH ;
Caption = "\<< ", ;
Top = 1 1 1 ,;
Left = 108, ;
Height = 29, ;
Width = 94, ;
Visible = .T.
PROCEDURE cmdExit.Click
RELEASE ThisForm
ENDPROC
ENDDEFINE

AINSTANCE(ArrayName, cClassName)
. ArrayName ,
. , , , Visual
FoxPro . , ,
, Visual FoxPro .
, , Visual FoxPro . ,
A IN S T A N C E () 0 - ,
- . cClassName Visual
FoxPro, Visual FoxPro (Cursor, DataEnvironment, Relation).
A IN S T A N C E () , .
AMEMBERS(ArrayName, Object [, 1 | 2])
,
. ArrayName ,
ObjectName. , , Visual
FoxPro .
, Visual FoxPro . Object ,
, ArrayName. Object
, ,
, . 1 ,
, .
, , ,
. : Property, Event,
Method Object. 2 , ,
, Object. .

. A M E M B E R S () ,
, 0, .

converted to PDF by HupBaH9I

COMPOBJ( oExpression1 , oExpression2 )


"" (.T .) ,
. oExpression1, oExpression2
. oExpression1 oExpression2
, , .
C O M P O B J() "" (.F .) , ,
, ,
.

5.2.
,
,
.
.

;
;
;
- ActiveX.

Visual FoxPro .
,
,
, , .
5.3. , ,
. ,
Visual FoxPro, ,
,
ActiveX. .
Visual FoxPro, Visual Basic ,
. Visual FoxPro
, , . 5.3,
.

. 5 .3 .
. 5.1 , Visual FoxPro
.

Form Control .
. 5.4.

converted to PDF by HupBaH9I

Label
Text Box

EditBox
Command Button Group

Co mm and Button

Option Button Group


CheckBox

I*

ComboBox
Spinner

ListBox
Grid

-H

Image

PageFrame

Timer

OLE Container Control


Line

OLE Bound Control


Shape

Separator

. 5 .4 .
Visual Basic ,
ToolBox. (. 5.5).
, Visual FoxPro ,
, Visual Basic
ToolBox.

jx |

Label

F ram e
CheckBox
ComboBox
HScroolBar

Picture ox

T extBox

17

-I 1=
jU
]

-1

Command Button
Option Button
ListBox
VScroolBar

Timer

|=

DriveListBox

DirLielBox

L]

FileListBox

S h ap e

Line

Image

O LE

Data

;0

. 5 .5 . Visual Basic

, . .
,
.
, .
, - , .
, .
, ,
, -. ,
CommandButtonl.
, CommandButton2 . . ,

converted to PDF by HupBaH9I


Object.Name [ = cName]
.

. . 5.3 ,
Visual Basic. ()
. ,
.

t
d
e

5 .3 .

CheckBox
chk
chkReadOnly
Column
grc
grcCurrentPrice
ComboBox
cbo
cboEnglish
CommandButton
cmd
cmdCancel
CommandGroup
cmg
cmgChoices
Container
cnt
cntMoverList
Control
ctl
ctlFileList
Data Control
dat
datAvto
Drive List Box
drv
drvTarget
EditBox
edtTextArea
File List Box
fil
filSource
Form
frm
frmFileOpen
FormSet
frs
frsDataEntry
Frame
fra
fraControls
Grid
grd
grdPrices
Header
grh
grhTotalInventory
HScrollBar
hsb
hsbVolume
Image
img
imgIcon
Label
lbl
lblHelpMessage
Line
lin
linVertical
ListBox
lst
lstPolicyCodes
OLE
ole
oleObject1
OLEBoundControl
olb
olbObject1
OptionButton
optFrench
OptionGroup
opg
opgType
Page
pag
pagDataUpdate
PageFrame
pgfLeft
Separator
sep
sepToolSection1
Shape
shp
shpCircle
Spinner
spn
spnValues
TextBox
txtGetText
Timer
tmr
tmrAlarm
ToolBar
tbr
tbrEditReport
VScrollBar
vsb
vsbVolume
t
p
o

f
g
p

t
tx

- .

Object.FontName [ = cName]
cName ,
Object. Arial. -
, , ,
.
Object.FontSize [ = nSize]
.
10 . nSize 2048 . ,

converted to PDF by HupBaH9I

1 2,8 .
Object.FontBold [ = Expression]
, .T..
.
Object.FontItalic [ = Expression]
, .T..
.F..
Object.FontStrikeThru [ = Expression]
, .T..
.F..
Object.FontUnderline [ = Expression]
, .T ..
.F..
. ,
, , .
Object.BackColor [ = nColor]
. nColor ,
.

RGB(nRedValue, nGreenValue, nBlueValue)


nColor
nRedValue, nGreenValue nBlueValue .
0 255.
. . 5.4 .
5 .4 .

RGB nColor

255, 255, 255


16777215

0, 0, 0
0

192, 192, 192


12632256
-
128, 128, 128
8421504

255, 0, 0
255
-
128, 0, 0
128

255, 255, 0
65535

128, 128, 0
32896

0, 255, 0
65280
-
0, 128, 0
32768

0, 255, 255
16776960
0, 128, 128
8421376

0, 0, 255
16711680
-
0, 0, 128
8388608

255, 0, 255
16711935
-
128, 0, 128
8388736
Object.ForeColor [ = nColor]
.
Object.BorderColor [ = nColor]
.
Control.BorderWidth[ = nWidth]
. nWidth
0 8192. , nWidth 0,
.
. ,
- ()
, .
, .
,
.
Control.Picture[ = cFileName | GeneralFieldName]
cFileName, General
GeneralFieldName. BMP ICO.
, - ,

converted to PDF by HupBaH9I

, , ,
Object.BackStyle [ = nStyle]
, nStyle 0,
BackColor .
nStyle 1.

- , ( , )
(, ).
, .

Object.Caption [ = cText]
cText .
:
Object.Height [ = nValue]
nValue .
[Object.]Width [ = nValue]
nValue .
Object.Left [ = nValue]
nValue -
.
Object.Top[ = nValue]
nValue -
.
nValue

Object.ScaleMode = nMode
, ,
.
Visual FoxPro nMode 0,
, 3 - ( , ).
- , Visual FoxPro
, .

. ,
,
. ,
,
, . ,

.
. ,
,

.
Visual Basic nMode :

0 - ;
1 - twip - ,
;
2 - ( , );
3 - ;
4 - (120 twip 240 - );
5 - ;
6 - ;
7 - .



. , ,
,
Control.ToolTipText = cText
.

converted to PDF by HupBaH9I

Object.HelpContextID [ = nContextID]
nContextID ,
, F 1 , .
, ,
.
Control.Value [ = nSetting]
.

. -
nSetting, ,
.
Object.Visible [ = Expression]
, Expression
.F ..
.T ., - .F .. ,
,
, Visible .F..
Object.Enabled [ = Expression]
,
Expression .F .. , , TextBox EditBox,
.

Control.TabIndex [ = nOrder]
- (, ),

.
, ,
, T ab

Control.TabStop [ = Expression]
Expression , Control
TabIndex T ab .
Expression .F ., , Tab
.
, ,
.
.


, , T e x t B o x -

. , ,
, .
-
- , .
Visual FoxPro
Object.ControlSource [ = cName]
cName .
Visual Basic , - ,
Data -

Object.DatabaseName [ = cName]
. ,
, FoxPro
2 .x, .
.

Object.RecordsetType [= Value ]
Microsoft Jet :
0
- tables - .
Access , ISAM. , ,
, MS SQL Server.

converted to PDF by HupBaH9I

1 - dynasets - ,

. ,
. ,
.
2 - snapshots - ,
.

Object.RecordSource [= Value ]
Value ,
, SQL, ,
QueryDef, QueryDefs Database (
, Microsoft Jet, . 6).
, TextBox D ataSou rce
,

Object.DataField [ = cName]
cName ,
.
,
, , , Visual FoxPro
- EditBox - .
, , . .
,
.
Visual Basic ,
Multiline. True .
, - ,
ComboBox - ListBox - .
, ,
,
Style 2 (drop-down list).
Style 0 (drop-down combo). Visual Basic
- 1. Simple Combo,
, , .
. Visual Basic
, . Visual FoxPro
RowSourceType.
Control.RowSourceType [ = nSource]
nSource :

0 - ( ) - .
AddItem AddListItem.
1 - . ,
RowSource.
2 - . ,
.
3 - SQL.
4 - . (QPR).
5 - .
6 - . 2,
.
7 - .
8 - .

,
Control.RowSource [ = cList]
cList , RowSourceType,
, , , SQL,
. , .
Visual Basic ,
- FileListBox, DirListBox DriveListBox.
-
.
Path.

converted to PDF by HupBaH9I

, ,
CheckBox - .
Value "" .T. (1)
"" .F. (0 ). ,
, . ,
, ,
. Value NULL 2.
.
, , ,
. - , ,
.
- Grid.
Visual FoxPro Visual Basic "" Grid.
Visual Basic ActiveX. .
Grid -, - Columns,
, , Header. Columns Header
, .
, ,
. , Grid
Grid.
Grid ,

Browse. Grid ,
. Grid
. ,
, .
Grid .
Grid.RecordSourceType [ = nType]
Grid. nType
:

0 - . , RecordSource.
1 - ( ).
2 - .
.
3 - . RecordSource - (QPR).

Grid.RecordSource [ = cName]
. .
,
Grid. :

DynamicAlignment - ;
DynamicCurrentControl - ;
DynamicForeColor - ;
DynamicBackColor - ;
DynamicFontName - ;
DynamicFontSize - ;
DynamicFontBold - ;
DynamicFontItalic - ;
DynamicFontStrikeThru - ;
DynamicFontUnderline - .


,
- .
,
, , ,
, . . - -
. - ,
, ,

converted to PDF by HupBaH9I

.
, ,
CommandButton - .
CommandButton .
, -
, . .
Caption
( Visual FoxPro) P ictu re .
,
, Visual FoxPro A u to size .T..
, , ,
Click.
E n te r, ,
- ,
CommandButton .Default [ = Expression]
Expression .T .,
E n te r .
Expression .F.. ,
Expression, .T..

Esc
CommandButton .Cancel [ = Expression]
-
- O p tio nB u tto n.
,
. ,
Visual FoxPro .
,
, , Alignment 1.
, Visual FoxPro
CommandButtonGroup OptionButtonGroup.

.
Timer - ( ) -
- .
, .

, .
,
( Timer),
Timer.Interval [ = nTime]
nTime 0, .
nTime 2147483647 ,
24 .
:

, 18 ,
, 56 .
,
- , (
, , . .).
Timer .
,
Timer , ,
,
.


R eset.
Visual Basic
HScrollBar VScrollBar.
.

converted to PDF by HupBaH9I

Image BMP.
, .
Visual Basic Image PictureBox,
, , ICO
WMF, .

Control.Picture = cFileName
Visual FoxPro General.
.
Label .
.
Control.Alignment [ = nValue]
nValue 0 ( ),
, 1 - , 2 - .
Label.WordWrap [ = Expression]
,
. Expression .F.
, , ,
,
. Expression .T .,

. A u to S ize .
Object.BorderStyle [ = nStyle]
. nStyle 0
. nStyle 1, .
A u to S ize
, .
Lin e , Shap e - ,
. Visual FoxPro

Shape.Curvature [ = nCurve]
nCurve 0 .
nCurve 1 98,
, 99 - .
Visual Basic

Object.Shape [ = Value]
:

0
1
2
3
4
5

( );
;
;
;
;
.

Visual Basic Line Shape ,


. Shape, , Visual Basic
F ram e ,
.

converted to PDF by HupBaH9I

-
,
, , Form - .
,
- , ,
, . .
(Form Designer), 9 .
,
.
.
Object.ControlBox [ = Expression]
,
. Expression .T. ( ),
, .F ., .
Object.MaxButton [ = Expression]
, Maximize (
). Expression .T. ( ),
Maximize; .F ., . Form
Resize.
Object.MinButton [ = Expression]
, Minimize ( ).
Expression .T. ( ), Minimize; .F .,
.
Resize.

Object.Icon [ = cFileName]
, . ,
cFileName, ICO.
Object.KeyPreview [ = Expression]
, KeyPress KeyPress
. Expression .T ., KeyPress
, ; .F. ( ),
KeyPress , .
,
. ,
, ,
.
Fo rm S et ,
. Visual FoxPro, Visual Basic
Fo rm s. :

- .

.
DataEnvironment
.

, Visual FoxPro ,
(PageFram e), .
, ,
. . , Visual FoxPro

converted to PDF by HupBaH9I

Object.WindowType [ = nType]
, DO FORM.
FormSet Type:
nType

.
, .
FormSet .

. FormSet ,
READ.
Show
DO FORM.
,
.
.

. FormSet ,
READ
MODAL.
Show
DO FORM. FormSet
,
WindowList, ,
.
.

Visual FoxPro
.
Page .
, .
,
.
(PageFrame). ,
-
ControlCount.

Controls.
Object.KeyPreview [ = Expression]
, KeyPress KeyPress
. Expression .T., KeyPress
, ; .F. ( ), KeyPress
, .
,
. ,
, ,
.
Page.PageOrder [ = nOrder]
,
.
P ag eFram e .

, .
A ctiveP ag e.
T o o lB a r Visual FoxPro ,
.
.
, ,

converted to PDF by HupBaH9I

.
.
Object.Movable [ = Expression]
,
. Expression .T. ( ),
. .F.,
.
Object.Sizable = Expression
.

Expression .T., .
Expression .F., .
ToolBar.Docked [=lExpression]
, ,
Visual FoxPro (.T.) (.F.).
Expression,

Expression.
,
Command, ,
, .
?_SCREEN.ActiveForm.Parent.Office_toolbar1.Docked
,
, , Parent.

nPosition = ToolBar.DockPosition
Visual FoxPro. nPosition
: -1 - ; 0 -
; 1 - ; 2 - ; 3 - .
- S e p a ra to r,
.
,
.
Visual FoxPro ,
, Control Con tain er.
.


Custom Visual FoxPro ,
Container Control,
.
,
, .
Custom ,
, .
.
.
, ,
, . , .
"",
, . !
* * * Custom

converted to PDF by HupBaH9I

frmPwdForm = CREATEOBJECT("PwdForm") && .


frmPwdForm.Visible = .T.
READ EVENTS
*
DEFINE CLASS PwdForm AS FORM
Caption = " "
*
ADD OBJECT CustPassword AS Pass_Word
Height = 130
Width = 350
Autocenter = .T.
*
ADD OBJECT txtText1 AS TextBox WITH ;
Height = 25, ;
Left = 25, ;
Top = 20, ;
Width = 125, ;
PasswordChar = "*", ;
Name = "txtText1"
*
*
ADD OBJECT txtText2 AS TextBox WITH ;
Height = 25, ;
Left = 25, ;
Top = 72, ;
Width = 125, ;
Readonly = .T., ;
Name = "txtText2"
*
* ,
* cmdCommand1.Click
ADD OBJECT cmdCommand1 AS CommandButton WITH ;
Top = 20, ;
Left = 200, ;
Height = 29, ;
Width = 125, ;
Caption = "", ;
Name = "cmdCommand1"
*
*
ADD OBJECT txtText3 AS TextBox WITH ;
ControlSource = ; "THISFORM.custPassword.cUnencrypted", ;
Height = 25, ;
Left = 200, ;
ReadOnly = .T., ;
Top = 72, ;
Width = 125, ;
Name = "Text3"
* ,
PROCEDURE txtText1.LostFocus
THISFORM.custPassword.Encrypt_It(TRIM(THIS.Value))
THISFORM.txtText2.Value =;
THISFORM.custPassword.cEncrypted
THISFORM.cmdCommand1.SetFocus
ENDPROC
* ,
* ""
PROCEDURE cmdCommand1.Click
THISFORM.custPassword.Decrypt_It(THISFORM.custPassword.; cEncrypted)
THISFORM.Refresh
THISFORM.txtText1.SetFocus
ENDPROC
* ,
PROCEDURE DESTROY
CLEAR EVENTS
ENDPROC

converted to PDF by HupBaH9I

ENDDEFINE
* Custom
DEFINE CLASS Pass_Word AS Custom
Height = 17
Width = 100
Name = "Password"
*
cUnencrypted = ""
cEncrypted = ""
*
PROCEDURE Encrypt_It
PARAMETERS cPassword
cEncrypted_password = " "
*
*
FOR i = 1 TO LEN(cPassword)
cLetter = SUBSTR(cPassword, i, 1)
cEncrypted_password = cEncrypted_password + ;
CHR((ASC(cLetter)*2)+5) &&
&&
NEXT i
THIS.cEncrypted = cEncrypted_password
ENDPROC
*
PROCEDURE Decrypt_It
PARAMETERS cPassword
cUnencrypted_password = " "
FOR i = 1 TO LEN(cPassword)
cLetter = SUBSTR(cPassword, i, 1)
cUnencrypted_password = cUnencrypted_password + ;
CHR((ASC(cLetter)-5)/2)
NEXT i
THIS.cUnencrypted = cUnencrypted_password
ENDPROC
ENDDEFINE
Visual Basic
. ,
.
App , ,
, . .
, .
ClassM odule , ,
.
,
. ClassModule ,
.
Clipboard .
, ,
,
.
Collection - - ,
.
( ), ,
. , .

, Collection.
, , :^>
Dim oCollect1 As New Collection
Add
Remove.

OLE

converted to PDF by HupBaH9I

OLE - ,
.
OLE OLE 2.0
(Object Linking and Embending) - , Microsoft,
Windows.
?

. , Word for Windows.
OLE-. OLE,
- OLE. OLE
OLE. ,
. Windows 95 OLE -
OLE. ,
OLE, ,
.
OLE 2.0 ActiveX
(OLE Custom Controls - OCX). ActiveX -
OLE, , .

,
.
O LE Bound OLE-,
General Visual FoxPro. OLE- .
OLE- ,
.
O LE C o n tain er OLE
Visual FoxPro. OLE
OCX. ,
Word for Windows Excel.
Visual Basic
OLE.
OLE- .

Control.AutoActivate [ = nValue ]
, OLE. nValue
0,
. ,
DoVerb. nValue = 1, , ,
. nValue = 2 ( ),
OLE Enter
, . nValue = 2 , OLE
(
).
Control.HostName [ = cExpression]
,
OLE-.
Visual FoxPro
ActiveX . MSCOMM32.OCX, MSMAPI32.OCX, MSOUTL32.OCX PICCLIP32.OCX, -
Visual FoxPro SYSTEM Windows.
Visual Basic.
?
MSCOMM32.OCX
(C o m m u nication s control).
:

OnComm
(Carrier Detect)
(Request To Send). OnComm
.

converted to PDF by HupBaH9I


C om m Even t , ,
OK .

, ,
.
MSMAPI32.OCX -
(M icrosoft M API C on tro ls).
:

(M A PI Se ssio n Control)
.
(M A PI M essages Control)
.

,
. .
MSOUTL32.OCX -
(O u tline C on tro l), ,
. , , ,
, .
Windows 95 , Visual FoxPro
, .
PICCLP32.OCX -
(P ictu re Clip C o n tro ls),
. .
BMP ICO ,
.
,
, .
.
Access 7.0
- (C a len d ar Control).
MSACAL70.OCX
. ,
- ,
.
Visual
Basic, .
.
COMCTL32.OCX Windows 95.
ListV ie w ,
:

();
;
;
.

, ,
.
Im a g e L ist ListIm a g e ,
.
ImageList ,
.
T re e V ie w
Node, , , .
- ,
. . Outline Control,

, ,
. ,
. TreeView ImageList
, Node (

converted to PDF by HupBaH9I

).
P ro g re ssB a r
-
.
- .
S ta tu s B a r - - ,
,
. 16 Panel,
P an els. Panel
() .
Style , , ,
. .
S lid e r - - , .
, ,
, . Slider -
- .
, .
T a b S trip
. PageFrame Visual FoxPro,
, .
, TabStrip T ab T ab s. Tab
, . ,
TabStrip ImageList
, Tab. TabStrip
.
Too lb ar - - Button,
.
Windows
.
, , ImageList.
Toolbar ,
. Button
, ,
, PlaceHolder
.
Windows 95 RICHTX32.OCX
- R ich TextB o x.
TextBox, RichTextBox ,
: ,
.
. RTF, ASCII .
LoadFile SaveFile RichTextBox
.
, Windows 95 Explorer.
Microsoft Word ,
RichTextBox. SelPrint
.
, RichTextBox ,
Data .
RichTextBox , ,
TextBox,
.
COMDLG16.OCX COMDLG32.OCX 16- 32-
Com m onDialog Control,
, , , .

, Microsoft Windows COMMDLG.DLL.

CommonDialog .

.
.
ActiveX .
DBGRID32.OCX DBGrid,
Recordset.
DBGrid Data

converted to PDF by HupBaH9I

Recordset. DBGrid
Colum ns . DBGrid
, , .
, ,
. DBGrid
. Text Value Colum n
. , ,
, .
GRID32.OCX GRID16.OCX 32- 16-
Grid - M icrosoft Grid Control.
- DBGrid.
DBLIST32.OCX D B List DBCom bo.
Data
Data, , . DBList DBCombo
ListBox ComboBox ,
AddItem ,
.
MSMASK16.OCX MSMASK32.OCX
- M asked Edit Control.

TextBox. , Mask,
;
, , :
(812). , ,
, . ,
, ValidationError. ,
"?# # # " "A12.", "B" "A"
"A" ,
(), ValidationError.
SPIN16.OCX SPIN32.OCX Sp inButto n - .
Visual FoxPro - Spinner.
TabStrip 16- 32-
S S T a b , TABCTL32.OCX TABCTL16.OCX.
.
SSTab , , , . ,
:

;
;
;
;
.


C trl+ Tab.

ActiveX.
GAUGE16.OCX GAUGE32.OCX 16- 32-
G auge,
"". ,
-
Progress-Bar. Gauge ,
.
Visual Basic
- M icrosoft Rem ote Data Control (MSRDC),
ODBC.
- Remote Data Objects (RDO)
, .
MSRDC :

, MSRDC;
;

converted to PDF by HupBaH9I

;
;
.


8.
Visual FoxPro ActiveX
, OLE Container Control,
Insert Object Insert Control.
, . 5.6.

In-sort O bject

Contrd JypBj

OK

nil ititwn Contra

Creale Ngw

Creeie (ram Ejte


Insert Contra I

Apex Data Bound Grid Control


Calender Control
Common Dialogs Control
CtysteJ Report Control
Data Outline Coniroi 1 1
FMfflb Control

Cancel

Add Coniroi..

r RssyH-------Inserts a new Wubuiton Confraf control into your

L k bfc

document

. 5.6.
Visual Basic
. Tools Custom Controls,
(. 5.7).
, ToolBox. . 5.8
.

Custom CorvtroJs

6 vatlnbl0 Controls:

OK

Bemud
, Data
______
___ Gnd
____ ____________

Cancel

Crystal Report Control


Desaware Animated Button Control

gnowse..

FOXHWJD OLE Control module


Medisview .41 OLE Control
0M icroH elp Gauge Control
D MicroHelp Key Slate Control
0 Microsoft Access Cetendar Control 7.0
13 Micro sott Comm Control
0 Micro salt Common Dialog Control
0 Microsoft Data Bound List Controls
Microsoft Date Oultine Co ntro 11.1
Micro Soft Grid Control
0 Microsoft MAPI Controls
1 Micro soft Masked Edit Control

Help

Show-------------------

1senable Objects
F ontrals
^elected items On^

Apex Data Bourtd Grid-----------------------------------------Location:

C:\WI NDOWS\SYSTEMtf)BGRlD3. OCX

I__________________________________________________________
. 5.7.

converted to PDF by HupBaH9I

CommonDialog
T ab Slrip

TreeView
DBList
PictineClip
MSComm

Tool Bar
ImageList

SHQG


1
eiEI
, ,,

DBCombo
Outline

Calendar-

SSTab

Status Bar

LislView

R ich T ex tB o x

ProgressBar

Slider
Control
MARI Sessioni
MAPI Messages
Grid
MaskEditBox
D BG rid

D iS 3

SpinButton---- 1

G a jg e

. 5 .8 . Visual Basic
ActiveX
OLE OCX
Control Development Kit Microsoft Visual C++
. OLE, , REGSVR32.EXE.
SAMPLES\OLE Visual FoxPro.
REGSVR32 OCX .

5.3.
, , ,

.
, , ,
.
,
.
- ,
,
.

. , - ,
. ,
, .
- , ,
, ,
Click , .
- :

- ,
.
,
.
, .
Visual FoxPro "::",
.

- ,
,
. .
, .
PROCEDURE Object.Init
[LPARAMETERS Param1, Param 2,...]

converted to PDF by HupBaH9I

. Init
Param1, Param2,
. .
,
. Visual FoxPro Init,
Visual Basic In itia liz e .
, , Visual Basic
:
Private Sub ObjectName_EventName(<<>>)
<< >>
<<>>
End Sub
, ,
. :
Private Sub Object_Initialize()
Visual Basic ClassModule.
Init , -,
-. Init .F.,
. , ,
- , , ,
Visual FoxPro, , .
oFrm = CREATEOBJECT("frmLook") &&
IF type("oFrm") != "O"
RETURN
ENDIF
oFrm.Show &&
READ EVENTS &&
*
DEFINE CLASS frmLook AS Form
ScaleMode = 3 &&
Width = 320 &&
Heigth = 200 &&
Closable = .F. &&
* Grid,
ADD OBJECT grdCustomer AS Grid WITH ;
RecordSource = "Customer", ;
RecordSourceType = 1
*
ADD OBJECT cmdExit AS CommandButton WITH ;
Caption = "", ;
Top = 2 2 0 ,;
Left = 100
* Grid -
PROCEDURE grdCustomer.Init
IF !FILE("CUSTOMER.DBF")
= MESSAGEBOX(" !")
RETURN .F.
ELSE
IF USED("CUSTOMER")
SELECT CUSTOMER
ELSE
USE CUSTOMER IN 0
ENDIF
ENDIF
ENDPROC
*
PROCEDURE cmdExit.Click
CLEAR EVENT &&
ENDPROC
ENDDEFINE

converted to PDF by HupBaH9I

D estroy.
, ,
. .
Init Visual Basic - Initialize,
Destroy Visual Basic - Term in a te.

Click. , :

CheckBox, CommandButton
Optionbutton,
Spinner.
Combobox ListBox.
S p ace (), CheckBox,
CommandButton OptionButton.
En te r, CommandButton
Default, .T.
" ", - .

Click , :

Value CommandButton Optionbutton


.T. 1 OptionButton.
Value CheckBox.
MOUSE.

D blC lick ,
- . ComboBox ListBox
- Enter.
- DblClick ,

, .
, ,
G o tFo cu s.
SetFocus. , , Enabled
Visible .T..
,
Lo stFo cus.
,
(Page), .
PROCEDURE Object.UIEnable
LPARAMETERS Enabled
Enabled .T. .F., ,
, , .
, - ,
, .

Value In te ra c tiv e C h a n g e
. ,
Pro g ram m aticC hang e.
Visual Basic - Change. :
Private Sub Object_Change([Index As Integer])
Index ,
.
, ,
K eyP ress. Visual FoxPro :
PROCEDURE Object.KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl

converted to PDF by HupBaH9I

nKeyCode , ,
IN K E Y (). nShiftAltCtrl
. S h ift 1, Ctrl - 2, A lt - 4. ,
1 - S h ift, 6 - Ctrl Alt.
Visual Basic :
Private Sub Form_KeyPress(Keyasc// As Integer)
Keyascii A S C II-, .
:
Private Sub Text1_KeyPress (KeyAscii As Integer)
Char = Chr(KeyAscii)
KeyAscii = Asc(UCase(Char))
End Sub
Visual Basic ,
. KeyD ow n -
KeyUp - .
KeyPress Visual FoxPro,
.
Visual FoxPro
W hen.
.T. ( ),
GotFocus. When .F.,
. List When ,
.
,
Visual FoxPro V alid . .T.,
. .F., .
, Valid ,
.
, ,
.
A ctiv ate ,
( )
Show.
D eactivate , ,
.
, Activate, Deactivate
. Deactivate
.
( ) Activate SetFocus
Load.
UnLoad.
P aint , .
, , , .
Paint
. , Paint
:

.
, ,
BackColor.
Refresh.


.
Visual FoxPro. Visual Basic, , , , ,
,
.
(
) :

converted to PDF by HupBaH9I

FormSet.DataEnvironment.BeforeOpenTables ( AutoOpenTables = .T.)


FormSet.Load
FormSet. Form1.Load
FormSet. Form2.Load
FormSet.DataEnvironment.<< Data Environment>>.Init
FormSet.DataEnvironment.Init
FormSet.Form1.<< Form1>>.Init
FormSet.Form1.Init
FormSet.Form2.<< Form2>>.Init
FormSet.Form2.Init
FormSet.Init
FormSet.Activate
FormSet.Form2.Activate
FormSet. Form2.Deactivate
FormSet.Activate
FormSet. Form 1.Activate
FormSet.Form1.<< >>.When
FormSet.Form1.GotFocus
FormSet.Form1. << >>.GotFocus

:
FormSet.Activate
FormSet. Form2.Destroy
FormSet.Form2.<< Form2>>.Destroy
FormSet.Form2.Unload
FormSet. Form1.Destroy
FormSet.Form1.<< Form1>>.Destroy
FormSet.Form1.Unload
FormSet.Unload
FormSet.DataEnvironment.AfterCloseTables
FormSet. DataEnvironment. Destroy
FormSet.DataEnvironment.<< Data Environment>>.Destroy
Grid
:
Form.Grid.When
Form.GotFocus
Form.Grid.AfterRowColChange
A fterR o w C o lC hang e ,
, .
Grid, ,
:
Form.Grid.BeforeRowColChange
Form.Grid.AfterRowColChange
BeforeR ow C o lC h an ge ,
.

D E LE T E , Grid D eleted,
.

S cro lled ,
:

0
1
2
3

.
.
.
.

converted to PDF by HupBaH9I

4 - .
5 - .
6 -
.
7 -
.

Grid
:
Form.Grid.Valid
Form.<< >>.When
Form.Grid.BeforeRowColChange
.
,
, ,
, :
Form1.Combo1.When
Form1.GotFocus
Form1.Combo1.GotFocus
Form1.Combo1.MouseDown,1,0,108,48
Form1.Combo1.DropDown &&
Form1.Combo1.MouseUp,1,0,108,48
Form1.Combo1.MouseDown,1,0,88,117
Form1.Combo1.MouseUp,1,0,88,117
Form1.Combo1.DownClick &&
Form1.Combo1.MouseDown,1,0,92,11
Form1.Combo1.MouseUp,1,0,92,11
Form1.Combo1.UpClick <|>&&
Form1.Combo1.MouseDown,1,0,79,11
Form1.Combo1.MouseUp,1,0,29,27
Form1.Combo1.InteractiveChange &&
Form1.Combo1.Click
Form1.Combo1.Valid
Form1.Combo1.When
Form1.Combo1.Valid
Form1.<< >>.When
Form1.Combo1.LostFocus

.
. Text1 Form1,
, Rus,
E n te r, :
Form1.Text1.When
&&
Form1.Text1.Gotfocus
Form1.Text1.MouseDown, 1, 0, 25, 76
Form1.Text1.MouseUp, 1, 0, 25, 76
Form1.Text1.Click
Form1.Text1.KeyPress, 82,1 && R
Form1.Text1.InteractiveChange
Form1.Text1.KeyPress, 117,0 && u
Form1.Text1.InteractiveChange
Form1.Text1.KeyPress, 115,0 && s
Form1.Text1.InteractiveChange
Form1.Text1.KeyPress, 13,0 && Enter
Form1.Text1.Valid
Form 1.Text1. LostFocus

5.4.

converted to PDF by HupBaH9I

,
.
Visual FoxPro - -,
, C R E A T E O B JE C T (),
-,

Object.AddObject(cName, cClass [, cOLEClass]


[, aInit1, aInit2 ...])
cName , cClass
, -,
Object. , , ,
,
S E T C L A S S L IB . OLE-, , ,
cOLEClass. aInit1, aIn it2...
Init .
Visual Basic Add,
.
Visual FoxPro R em oveO bject,
Visual Basic - Rem ove.
, ,

Object. Refresh
. ,
,
, PageFrame,
Page.
Control.SetFocus
.

[Object.]ZOrder([nValue])
.

nValue 0, 2. nValue 0 ( ),
, 2 - .
( ,
. .), - . , ,
.

Object.Move(nLeft [, nTop [, nWidth


[, nHeight]]])
,

nLeft nTop .
nWidth nHeight. nLeft,
, ,
.
-,
-, 0, 0. ,
, ,
, :
ThisForm.Move(20, 5)

Object.Hide
Visible .F..
, , ,
.

converted to PDF by HupBaH9I

Object. Show([nStyle])
, nStyle, .
nStyle 1 (0 Visual Basic), ,
, Show. nStyle
2 (1 Visual Basic), ,
.
. nStyle ,
WindowType.
OLE-

Object. DoVerb[ Verb]


OLE. Verb - ,
-.
, ,
. ObjectVerbs.
:

-1

-2

-3

-4

, .

(on-place editing)

-5


, -
OLE

-6

(
UNDO) ,

AutoActivate 2, - OLE
,
.
(E D IT , O PEN , P LA Y . .) Verb
, .
Visual FoxPro ,
.
Container.SetAll(cProperty, Value [, cClass])
- Value cProperty
cClass (
Visual FoxPro!).
Grid :
Gr/'d.ActivateCeN(nRow, nColumn)
nRow nColumn.
Grid.AddColumn(nIndex)
Grid. nIndex ,
1.
Grid.DeleteColumn[(nIndex)]
nIndex Grid.

converted to PDF by HupBaH9I

Grid. DoScroll(nDirection)
nDirection :

0
1
2
3
4
5
6
7

.
.
.
.
.
.
.
.

6

6.1. Visual FoxPro



6.2. Access
6.3. Visual Basic
6.4. MS SQL Server

,
, Microsoft.
,
, .

6.1. Visual FoxPro


Visual FoxPro
.
, ,
, , .
.

.
:

;
FoxPro ;
.


, , ,
Visual FoxPro C R EA TE D ATABASE.
, ,
Project Manager.
Project Manager Data, Databases.
New. , . 6.1.
.

converted to PDF by HupBaH9I

Vfciim *

*
wic ;plH Vi qih | >

El* *w loci* eaww1 * ______________


p|t|u|||;>|
^1-1 t [ l b . W j |! ;|*1 *|
^ t>esEgner Am a.ilore

N c 4 |- s h k .

N m Remote Y l*
N ew LoralViBW,,.

Aid ..

BtoiH FuseeSurai...
F M sm n llbl Ifflh'^hV-..

Hefp...

2fi
,


Bnow&e



&

&
1'>
. 6 .1 . Visual FoxPro
.
. 6.1 ,
.
6 .1 . ,
ADATABASE()
CREATE VIEW
MODIFY
CONNECTION
ADBOBJECTS()

DBC()

MODIFY
DATABASE

ADD TABLE

DBGETPROP()

MODIFY
PROCEDURE

ALTER TABLE

DBSETPROP()

MODIFY
STRUCTURE

APPEND
PROCEDURES

DELETE
CONNECTION

MODIFY VIEW

CLOSE DATABASE DELETE


DATABASE

OPEN DATABASE

COPY
PROCEDURES

DELETE VIEW

PACK DATABASE

CREATE
CONNECTION

DISPLAY
DATABASE

REMOVE TABLE

CREATE
DATABASE

INDBC()

SET DATABASE

CREATE SQL VIEW LIST DATABASE

VALIDATE

converted to PDF by HupBaH9I

DATABASE
CREATE TABLE
, Visual FoxPro
, :
, DBF,
, - DBF, - .
, . ,
, ,
. , ,
.
,
.
? Project Manager Tables
Data, Add.
, :
OPEN DATABASE auto_store && && AUTO_STORE
ADD TABLE salesman && SALESMAN
, .
,
M O D IFY STRU CTU R E.
, .
- ,
- ,
. DBF ,
. ,
.
?
, .
U SE "!". "!"
, , . ,
Salesman Auto_Store, :
USE Auto_Store!Salesman
BROWSE
Auto_Store
U SE, Visual FoxPro Auto_Store
. ,
, .
, Visual FoxPro ,
.
,
.
Visual FoxPro,
, .
REMOVE
TA B LE .
. Project Manager Remove.
, Rem ove
D atab ase.
Salesman Auto_Store
:
OPEN DATABASE Auto_Store
REMOVE TABLE Salesman
.
DBF- , DELETE
REMOVE TABLE.
Project Manager D ELETE

converted to PDF by HupBaH9I

DATABASE.
.
D ELET E DATABASE
.
- , , ,
, .
D ELET E DATABASE ,
. ,
DELETE TABLES D ELET E DATABASE.
Visual FoxPro .
,
, . ,

.
? Project Manager
Modify Open, .
OPEN DATABASE.
, .
, .
, ,
. , ADD T A B LE D B C (),
, .

Visual FoxPro S E T DATABASE.
, ,
D B C ():
OPEN DATABASE Auto_Store
OPEN DATABASE Connect_Data
OPEN DATABASE Count_Data
SET DATABASE TO Auto_Store
? DBC()
Visual FoxPro
, .
, .
? U SE "?"
Use . ,
, Use Other.
Project Manager C LO SE D ATABASE. Project
Manager Close.
Auto_Store:
SET DATABASE Auto_Store
CLOSE DATABASE
.
- ALL C LO SE.
C LO SE DATABASE Command
, :

Project Manager .
, Data Session.

, Project Manager
.
Visual FoxPro
. ,
, , .
, .
, Model Auto_Store,
Model .
OPEN DATABASE Auto_Store

converted to PDF by HupBaH9I

ADD TABLE C:\MYPROJECT\MODEL.DBF


USE Model
Body :
USE Body
Body ,
.
,
- , ,
.
, Visual FoxPro
, .
, Visual FoxPro
D (DataBase Container).
, ,
. DBC .
.
, ,
, D.
-
.
.
Database
, ,
, .
.
, , ,
, , ;
, .
, .
,
.
, U SE DBC .
,
Auto_Store .
CLOSE DATABASE Auto_Store
USE AUTO_STORE. DBC EXCLUSIVE
BROWSE
BRO W SE ,
DBC. DBC
.
D User,
. D,
, .
DBC .
D?
1.
2.

D USE.
M O D IFY STRU CTU R E.

,
AUTO_STORE .DBC:
USE AUTO_STORE. DBC EXCLUSIVE
MODIFY STRUCTURE
"U_"
.
DBC.
DBC.

converted to PDF by HupBaH9I

.
V A L ID A T E DATABASE.
Auto_Store :
OPEN DATABASE Auto_Store EXCLUSIVE
VALIDATE DATABASE
,
.


Visual FoxPro ,


. Visual FoxPro
:

.
, .
.
, .
.
- .
.
.
.
.
.
.

, , , , , ,
DBC, .
.
Visual FoxPro, DBC.
.
,
.
, Project Manager
, Stored Procedures, :
New, Modify Remove.
Database Edit Stored

Procedures.
Visual FoxPro,
.
, , ,
.
, DBC ,
.
,
.

.

:

,
.
,
("") .

converted to PDF by HupBaH9I

,
.


. Visual FoxPro
, ,
, ,
.
,
.
.
D atab ase R eferen tial In te g rity .
, Visual FoxPro
, .
,
, ,
. , ?
, ,
, ,
, .

. , ,

.
.
- , .
:


.
.
(Data Environment Designer)
.
.

, S E T R ELA TIO N ,
.
Visual FoxPro .
, ,
.
?
, ,
, FOREIGN KEY CR EA TE
T A B LE A L T E R TA B LE.
, ,
.
.
- ""
" "; ""
.

, . ,
. Del.
Visual FoxPro Comment Version.
D B G ET P R O P ().
Auto_Store:
? DBGETPROP('Auto_Store', 'DATABASE', 'VERSION')
DBC .
D B S ET P R O P ().
COMMENT D B S E T P R O P ().
Auto_Store:

converted to PDF by HupBaH9I

? DBSETPROP('Auto_Store', 'DATABASE', 'COMMENT',


' ')
D B G ET P R O P () D B S E T P R O P ()
, .



, .
, , , , ,
.

, Project Manager File;
.
, ,
. 6.2.
6 .2 .
ALTER TABLE
CLOSE TABLES
CREATE TABLE
DELETE FILE
REMOVE TABLE
Project Manager ,
Tables New, .
. 6.2.
C R EA T E TA B LE.

converted to PDF by HupBaH9I

. 6 .2 .
Salesman
key_salman, last_name, first_name, patronymic:
OPEN DATABASE Auto_Store
CREATE TABLE Salesman (key_salmen I, ;
last_name C(17), ;
first_name C(17), ;
patronymic C(17))
, Visual FoxPro "I" Integer,
, . "C(17)"
Character 17 .
,
.
,
.
, .
128
. Visual FoxPro (
) , ,
, , ,
Browse.

Table Name (. 6.2). NAME CR EA TE

converted to PDF by HupBaH9I

T A B LE . Automobil
Automobile_Passenger_Car:
CREATE TABLE Automobil NAME Automobile_Passenger_Car ; (key_auto I, ; key_model I, date_issue
D, cost N(10,2))
,
, . ,
,
. , ,
.
.
C R EA T E T A B LE DBF-, Visual FoxPro
. ,
, .
, .
, NULL .

10 ; ,
, 128 .
, 10 .

, Visual FoxPro
DBC. 10 DBF
.
, 10
, Visual FoxPro , n
,
10 . ,
10-:

automobile_passenger_car_key_auto


automobile

automobile_passenger_car_key_model automobil1
automobile_passenger_car_date_issue

automobil2

automobile_passenger_car_cost

automobi11

,
. 10-
. ,
10- , DBF.
.
, , ,
, .
, .
, Visual
FoxPro, 128 .

, . Visual FoxPro
Project Manager.

Field Comment D B S ET P R O P ().
, , key_model Model,
" ":
?DBSETPROP('Model.key_model', 'FIELD', 'COMMENT', ;
' ')
. Visual FoxPro
Browse
Grid .

converted to PDF by HupBaH9I


Caption Field Properties D B S E T P R O P ().
, " " name_model
Model :
?DBSETPROP('Model.name_model', 'FIELD', 'CAPTION',; ' ')
,
. :

(,
).
, Visual FoxPro (,
Currency 8 ).
. ,
Visual FoxPro Numeric Currency,
Character General.
FoxPro
(
General).

, ,
, Character,
Numeric. ,
Integer.
,
NULL. NULL ,
, ,
.
NULL ?
Null . Null ,
NULL (. . 6.2).
NULL NOT NULL C R EA TE TA B LE.
, ,
NULL key_body, NULL name_body:
CREATE TABLE body (key_body i NOT NULL, name_body c(20); NULL)
NULL S E T NULL.
NULL
, Null
C R EA T E T A B LE S E T NULL ON.
S E T NULL ON Visual FoxPro NULL
, . S E T NULL
C R EA T E T A B LE , NULL NOT NULL.
, , NULL
:
S NULL ON
CREATE TABLE Fuel_oil (key_fuel_oil I, name_fuel_oil C(20))
NULL . ,
APPEN D FROM ,
NULL, , , NULL
, , .
,
, .

- ,
, .

converted to PDF by HupBaH9I

,
,
.
.
, General.
, ,
Default Value, Field
Properties (. 6.3), DEFAULT C R EA TE TA B LE.

able D esicjner
Jable Name:
| customer

Database:________________________
"

| cApro|ect_book\auto store dbc


Table

Table Properties...
Index

Name

Type

Width DecimalNULL

kei)_customer

Integer

name customer

Character

30

address

| Character

~3

tel

Character

12

fax

Character

12

last_name

Character

17

first name

Character

17

Cancel

insert

_d.

Delete

[-Field Properties ( address ]


Validation Rule:
Validation T ext:
Default Value:
Caption:

-"
|

cAproject_book\custonner.dbf

Records:

5 Fields:

10 Length:

145

. 6 .3 .
,
"-".
address "-":
CREATE TABLE Customer (key_customer I, name_customer C(30), ;
address C(30) DEFAULT "-", ;
tel C(12), fax C(12), last_name C(17), first_name C(17),;
patronymic C(17), juridical L, comment M)
Customer address,
:
ALTER TABLE Customer ALTER COLUMN address SET DEFAULT ;
"-"
,
, , .
-
,
.

. , ,
.
,
, . ., , .

converted to PDF by HupBaH9I

.
.
Visual FoxPro
.
, .
,
.
- ,
,
.


. , .

, .

, .
,
VALID
. , ,
, .
, ,
, -
.
,
. ,
, ,
.
.
,
.
-,
. , ,
, key_body, ,
, .
?
Validation Rule Field Properties (.6.4) CHECK
C R EA T E T A B LE A L T E R TA B LE.

converted to PDF by HupBaH9I

j j ' T able D esicjner


Jable Name:

Database:________________________

| model

| cApro|ect_book\auto store dbc


Table

Table Properties..
Index

Name

Type

Width DecimalNULL

key_model

Integer

name_model

Character

20

keyjirnn

Integer

swept_volume

Numeric

quantity_drunr]

Numeric

capacity

Numeric

|2
5

torgue

Numeric

OK
d
Cancel

insert

T|

Delete
D'

-Field Properties ( quan%_drum ]


Validation Rule:

quantity_drunri=>1

...

Validation T ext:

"

...

Default Value:
Caption:

Field Comment:

_
-

cAproject_book\model.dbf

...

Records:

37 Fields:

20 Length:

35

. 6 .4 .
Model , ,
, quantity_drum, :
ALTER TABLE Model ;
ALTER COLUMN quantity_drum SET CHECK quantity_drum >>= 1
, Visual FoxPro
, , .
, ,
.
.

Validation Text Field Properties (.6.4)
ERROR CHECK C R EA TE T A B LE A LT ER
T A B LE.
Model , ,
, quantity_drum, ,
:
ALTER TABLE Model ;
ALTER COLUMN quantity_drum SET CHECK quantity_drum >>= 1 ;
ERROR " 1"
1, Visual FoxPro
(. 6.5).
, SET CHECK
A L T E R T A B LE ERROR.

converted to PDF by HupBaH9I

jJ E

\ [ )| ^ | [ )[
Grand Pbix 14
33501
213, Of

^ITuiJboiGBoxa

; ; n PHip

Flange ftoyer 4.
Safrane 3.0
F^irg Spur 6.75
Cordoba 2.0

|'

OK

kejJ_3wto

Hf!p

. 6.5 .
,
, ,
. ,
S E E K , LO CA TE, S K IP , A PP EN D , APPEN D BLA N K, IN S E R T , A V ER A G E, COUNT, BRO W SE
R EP LA C E FO R, ,
. .
Visual FoxPro .
, .
, ,
, .
, .
C R EA TE T R IG G E R .
: INSERT, UPDATE
DELETE. .
(..) (.F.).
Table Properties
- INSERT, UPDATE DELETE Trigger -
, .
CHECK C R EA TE T R IG G E R .
, 27
. ,
Insert Sale.
INSERT ( DELETE UPDATE), ,
. ___ri_insert_sale()
Sale (. 6.6).
:
\'y T a b le Properties'
Validation Rule:
Validation T ext:

IN S E R T T rigger:

__ ri_insert_sale()

UPDATE Trigger:

__ ri_update_sale()

D E LE T E T rigger: | __ ri_delete_sale()

. 6 .6 .
PROCEDURE _ _ ri_insert_sale
IF DAY(DATE()) = 27
WAIT WINDOW ' ' NOWAIT
SELECT * ;
FROM Sale ;
WHERE MONTH(Sale.date_sale) = MONTH(DATE());
INTO CURSOR Sale_Month_Current
ENDIF
ENDPROC

J
J
J
J
J

m
.

converted to PDF by HupBaH9I

UPDATE DELETE .
.
, , , ,
, , .
,
A L T E R TA B LE.
, Sale
:
OPEN DATABASE Auto_Store
USE Sale EXCLUSIVE
MODIFY STRUCTURE
.
Project Manager Free Tables,
New, .
C R EA TE T A B LE .
Order_,
key_order, key_customer, key_model, key_salman:
CLOSE DATABASES
CREATE TABLE Order_ (key_order I, ;
key_customer I, ;
key_model I, ;
key_salman I)
,
.
,
, .
Visual FoxPro ,
.
(DBF-) .
, DBF-.
, ,
, .
Visual FoxPro DBF
General, FPT-.
. .
, .
. , ,

. ,

.
.
? Index
. Regular
IN D EX .
, Model
key_body. TAG "key_body"
.
USE Model
INDEX ON key_body TAG key_body
, .
, .
IN D E X Visual FoxPro
, . ,
,
key_body.
Visual FoxPro
- MODEL.CDX, .

converted to PDF by HupBaH9I

CDX-, ,
Visual FoxPro.

CDX-:

.

.
,
.

Visual FoxPro : D - IDX-. D-,


, .
.
Visual FoxPro : , ,
. ,
.

(Primary) - ,
.

, .
.
, , Visual FoxPro
.

- (Candidate) - ,
, .

.
"" :
, .
- ,
, Visual FoxPro .
- C R EA T E T A B LE
A L T E R T A B LE. " " "
" "" , -.
- Index
Primary Candidate (. 6.7)
A L T E R TA B LE.

converted to PDF by HupBaH9I

\.J T able D esicjner


Jable Name:

Database:________________________

| model

| cAproject_book\auto store dbc

~
Table
Name

MODEL

Index

Type

Expression

Primary

key_model

KEY..FUEL

Regular

key_fuel_oil

KEY..TY RE

Regular

keyjyre

Regular

key_body

KEY..FIRM

Regular

key_firm

t
t
t

.BODY

Table Properties..

Filter
OK
Cancel

Insert
Delete

cAproject_book\nnodel.dbf

Records:

37 Fields:

20 Length:

35

. 6.7 .
, key_model
Model:
ALTER TABLE Model ADD PRIMARY KEY key_model TAG key_mode
ALTER TABLE Model ALTER COLUMN key_model I PRIMARY KEY
- D-
, , "Primary" "Candidate".
D-, -.
, , ,
, .
, ,
, ,
, .

Visual FoxPro (Unique) ,


.

"" ,
; ,
- .
, .

.

(Regular) - , ,
-.

,
.

converted to PDF by HupBaH9I

" " .
Model key_model, key_firm,
key_fuil_oil, key_tyre key_body ,
. S E T O RD ER
, .
, Browse
Model, key_model:
SET ORDER key_model
BROWSE
. 6.3 .
6 .3 . Visual FoxPro

CDX


CDX

;
,

IDX

240

240

100

.IDX

D- ,
- ,
. ,
, ,
D- ,
, D-.
IN D E X TAG
OF.
OF IN D E X , -
, D- .
, name_firm Firm
D- NSTRFIRM.CDX:
USE Firm
INDEX ON name_firm TO TAG name_firm OF NSTRFIRM
, ,
. D-,
, -
.
,
.
-.
,
.

converted to PDF by HupBaH9I

,
. -
.
- ,
. ,
Customer Auto_Store :
last_name + first_name + patronymic
Customer, ,
, last_name, first_name
patronymic.
:
INDEX ON last_name + first_name + patronymic TAG ; LasFirPat
.
Visual FoxPro Visual FoxPro,
.
100
( ) 240 D-.
,
.
Visual FoxPro. ,
, d T o S ( ) ,
- S T R ().
Account, date_write
( ) sum _ ( ),
:
INDEX ON DTOS(date_write) + STR(sum _) TAG DatSum
,
.
, ,
, .
, ,
, ,
, . D B ^
Visual FoxPro.

, , .
,
,
Visual FoxPro.

, .
,
.
? Index
Name , ,
DESCENDING IN D E X ON.
.
. ,
, Account
sum _,
:
USE Account
INDEX ON sum _ TAG sum _ DESCENDING
BROWSE

converted to PDF by HupBaH9I


, . ,
Account sum _, :
USE Account
INDEX ON sum _ TAG sum _
.
:
USE Account
SET ORDER sum _ DESCENDING
BROWSE

. - S E T O RD ER IN D E X - ASCENDING.
,
. , ASCENDING
DESCENDING , , SET
O R D ER .
,
. ,
, .
? Index
Filter (. 6.8) FOR
IN D EX .

;if- able Designer


Table Name:

Database:________________________

account

| cApro|ect_book\auto ?tore dbc


Table

Index

Name

Type

t ACCOUNT

Regular

account

t KEY_CU ST0
t KEY_AUT0
t number_rec

Regular

key_customer

Regular

key_auto

Primary

nunber recorc

il

Table Properties..

Expression

SUM

Filter
OK
Cancel

sum>30000

Insert
Delete

cAproject_book\account.dbf

Records:

7 Fields:

7 Length:

36

. 6.8 .
IN D E X FOR,
, .
, .
:
USE Account
INDEX ON sum _ FOR sum_>>30000 TAG sum _

converted to PDF by HupBaH9I

BROWSE

, S E T F IL T E R . ,
, ,
. , Account ,
30000, :
USE Account
SET FILTER sum _ >> 30000
BROWSE
S E T F IL T E R
Visual FoxPro. S E T F IL T E R ,
, .
S E T F IL T E R .
.
,
( )
.
,
.
,
, Visual FoxPro.
, R EIN D EX .
? Table Rebuild Indexes
R EIN D EX .
, Account:
USE Account REINDEX
R E IN D E X , .
Visual FoxPro ( D-, D -) . D D-, .
, .
.
, , ( 1.2)
( 2.2).
Auto_Store. ,
, :
WAIT WINDOW " ..." NOWAIT
*
* "Auto_Store" ( Add,
* Databases Data)
CREATE DATABASE auto_store && Auto_Store
? DBSETPROP('auto_store', 'database', 'comment', ;
' .') &&

* Model
CREATE TABLE Model (key_model i, name_model c(20), key_firm i DEFAULT 1, ;
swept_volume n(5) NULL, quantity_drum n(2) NULL, ;
capacity n(5,1) NULL, torgue n(5,1) NULL, ;
key_fuel_oil i DEFAULT 1, top_speed n(5,1) NULL, ;
starting n(4,1) NULL, key_tyre i DEFAULT 1, ;
key_body i DEFAULT 1, quantity_door n(1) NULL, ;
quantity_sead n(2) NULL, length n(5)<|>NULL, width n(4) ;
NULL, ;
height n(4) NULL, expense_90 n(4,1) NULL, ;
expense_120 n(4,1) NULL, expense_town n(4,1) NULL)
* ( model)
? DBSETPROP ('Model.key_model', 'field', 'caption', ; ' ')
? DBSETPROP ('Model.name_model', 'field', 'caption', ; ' ')

converted to PDF by HupBaH9I

? DBSETPROP ('Model.key_firm', 'field', 'caption', ;


' ')
* ( Model)
? DBSETPROP ('Model.key_firm', 'field', 'comment', ;
' ; Firm')
* ( Model)
ALTER TABLE Model ADD PRIMARY KEY key_model TAG key_model
*
* ( Model)
ALTER TABLE Model ALTER COLUMN swept_volume SET CHECK ; swept_volume>>0 ;
ERROR " ; "
ALTER TABLE Model ALTER COLUMN quantity_drum SET CHECK ; quantity_drum >>= 1 ;
ERROR " 1"
* Firm
CREATE TABLE Firm (key_firm i, name_firm c(20), ; key_country i)
* ( Firm)
? DBSETPROP ('Firm.key_firm', 'field', 'caption', ;
' ')
? DBSETPROP ('Firm.name_firm', 'field', 'caption', ;
' ')
? DBSETPROP ('Firm.key_country', 'field', 'caption', ;
' ')
* ( Firm)
ALTER TABLE Firm ADD PRIMARY KEY key_firm TAG key_firm
* Automobile_Passenger_Car
CREATE TABLE Automobile_Passenger_Car (key_auto i, ; key_model i, date_issue d, cost n(10,2))
*
* ( Automobile_Passenger_Car)
? DBSETPROP ('Automobile_Passenger_Car.key_auto', ; 'field', 'caption', '
')
*
* ( Automobile_Passenger_Car)
ALTER TABLE Automobile_Passenger_Car ADD PRIMARY KEY ; key_auto TAG key_auto
*
ALTER TABLE Automobile_Passenger_Car ;
ADD FOREIGN KEY key_model TAG key_model REFERENCES Model
ALTER TABLE Model ;
ADD FOREIGN KEY key_firm TAG key_firm REFERENCES Firm
ALTER TABLE Model ;
ADD FOREIGN KEY key_fuel_oil TAG key_fiuel REFERENCES ; Fuel_Oil

6.2. Access
, Microsoft Access
, .
,
. - "", . ,
, , Access .
MS Access.
.
, : Excel,
, . ,
, Excel,

Microsoft Excel. ,
,
. ,
, , - . - ,
, , , , ,
, ODBC.
Access 90 % "",

converted to PDF by HupBaH9I

, .
- " ". , ,
Delphi, . EXE-. , ?
, " ", .
- . - ,
Access .
Access - Microsoft Office . -
. Excel. -
. , :
First

Second

Third

12.03.96

56

12.04.96

34

17.12.96

78

14.09.23

.
Access, . , ,
. ,
Microsoft " ". ,
, ,
.
. ,
. , .
, , -
255 .
Excel Access,
, Access Microsoft Office.
, - . , ,
. "" -
. .
, , ,
, . ,
.
, ,
. ,
. Access, , , FoxPro.
FoxPro 2.6.
. ,
- - .
,
.
,
. .
, . 6.9.
, .
] Inmin

- :I

.J|:.

:? -.

rcfinI'M

- &

-.IU Q h -M

. 6.9 .

,
. 6.10.

converted to PDF by HupBaH9I

1
L_L

1
L-_
i

_1
i
Li
.... ..
j H ! 1J

_______
J_JH.fr.*] x v i

>

. 6 .1 0 .
, .
6.11. , 3,
. , ,
, .
, .
,
, - .
, .
, , 64.
F1, , ,
. , .
!Ac?airtt:Tiiljfirtii

KEV^jccaurfr

KEY CUSTOMER

KY_AimO

SEU.ED

SUM

QftTQ/bptr'iP

QiJWNtTiV

DATEJfcWTE

Jj

| * |
nonq
?

0 1


ytnowie
& oft

& (& )

'

6-4
' '

1'

L
|'


- . ^ L i lu .

'

. 6 .1 1 .
.
.
,
.
/, ,
. 6.12. ,
,
, " " . ,
, - , ,
" " . .
MDB , , ,
.
. ,
. . . -
. .
, ,

converted to PDF by HupBaH9I

. ,
, ,
, .
, ,
.


- ----

/:

|;;;

(*

1
1

11

11|||!*!

. 6 .1 2 . Access
- - .
, , :
(812)259-4277, , .
:
(000)00-00000
, ,
-.
. - .
,
8125250495. .
, . Access ,
:
\(0\-000\)000\-00\-00
,
, -
.
.
.
" ".
- , Caption, ,
. - .

converted to PDF by HupBaH9I

, 2048 (
, - "-"
80 ). ,
, , ,
.
. ,
.
N o w (). ,
.
,
.
:
<< = Now() And >>Now()-1
, , .
, , .
,
, ""
.
,
Microsoft Access. ,
. , ,
. ,
- , , .
, - .
.
"", NULL,
- .
, OLE, ,
, .
, , ,
, ,
.
, .
, .
, ,
(. 6.13).
i-Ui&KLCui autQtabJ^

fompl


First
Second
Third

. 6 .1 3 . Access
,
. ,
.
,
, ,

converted to PDF by HupBaH9I

, .
, .

.
, . 6.14,
. .
. ,

, . ,
,
.

. 6 .1 4 . Access
,
. ,
, Microsoft Visual
Basic.
, , ,
, -, ,
, . , ,
,
.
, ,
, . Access
, , -
, . ,
, .
Excel
Access.

6.3. Visual Basic


Visual Basic, ,
.
, , Access ,
, , Access Visual Basic.
ODBC.
Visual Basic,
, - DAO.
Visual Basic :

converted to PDF by HupBaH9I

;
(DAO - Data Access Objects).



,
,
. ,
. ,
, .

, . ,
-, ,
8 .

, DAO,
, .

,
, , ,
, , , .
.
.
Visual Basic
:

2.5 , 16-
(Windows 3. Windows for Work-groups);
3.0 - 32- (Microsoft Windows 95 Windows NT).

Visual Basic
, , , Database, TableDef, Field Index,
,
. ,
.
,
.

, ,
.
, ,
.
(,
Visual FoxPro SQL Server),
. ,
.
Visual Basic , :

Visual Basic, , Microsoft Access.


Visual Basic,
.
, Btrieve, dBASE
III, dBASE IV, Microsoft FoxPro Paradox,
(ISAM - Indexed Sequential Access Method).
ODBC, 8 .

Microsoft Excel Lotus 1-2-3.
, ,
ODBC.
-,
SQL, , ,
8.

converted to PDF by HupBaH9I

,
, , ,
. . 6.15.

. 6 .1 5 . Visual Basic
, "
". ,
. ,
. , ,
. , Indexes Index.
, DAO .
, - , -
, .
, . ,
:
Dim oWksp As Workspace
Workspace,
oWksp.
,
, ""
, "". , , ,
" Database" " Database".
. 6.15,

converted to PDF by HupBaH9I

, . - ,
DBEngine. ,
- . DBEngine Workspaces
( ),
, Workspace.
Workspace Databases,
Database . .
.
. , TableDef
MyDatabase MyDatabase.TableDefs(0). TableDef
MyDatabase.TableDefs(1) . .
""
, :
DBEngine.Workspaces(0).Databases(0).TableDefs(0).Fields_ "Customer")
, , ,
. ,
Fields Name Field.
, , ,
! ( ). ,
:
MyTableDef.Fields("Customer")
MyTableDef.Fields!Customer
.
,
. ,
Recordset Fields.
Customer :
Cust = MyRecordset!Customer
,
Cust = MyRecordset.Fields!Customer
,

"" .
- ,
, , .
Visual Basic, - , ,
( ), ,
, - ,
.
,
, ,

.
:
*
Dim MyDB As Database, MyWS As Workspace, MyRS A s_ Recordset
* Clients ACCOUNTS.MDB
Set MyWS = DBEngine.Workspaces(0)
Set MyDB = MyWS.OpenDatabase("ACCOUNTS.MDB")
Set MyRS = MyDB.OpenRecordSet("Clients")
*
MyRS.Index = "ClientID"
OpenDatabase Work-space
MyDB .
Clients OpenRecordset.
Index, ,
- ClientID.

converted to PDF by HupBaH9I

,
.
,
.
,
,
. . 6.4 , . 6.5 -
, . ,
,
, , ,
,
.

D B E n g in e
.

Workspace 0.
Workspaces.

W o rk sp a ce
,
. Workspaces Workspaces(0) ,
.
Username Password DBEngine.
Databases.

D a ta b a s e
Visual Basic,
ODBC. , ,
Recordset. TableDefs.

T a b le D e f
TableDef TableDefs
.
.
Fields.

Q u e ry D e f
,
SQL.
, ,
. Fields.

R e co rd se t
,
.
Move, Seek Find,
, , .
, , ,
. Fields.

F ie ld

converted to PDF by HupBaH9I

, .
Field Recordset.
Value Field.
, Field
.

In d e x
, TableDef Recordset,
. Index.

P a ra m e te r
. Parameters
QueryDef .

U ser
,
. DBEngine .
Users .
User . , TableDef
QueryDef,
.

G ro u p
.
DBEngine .
, .
.

R e la t io n

TableDef. Database Relation.

.

P ro p e rty
- .
, .
:

Database
TableDef
QueryDef
TableDef.Index
TableDef.Field
QueryDef.Field

C o n t a in e r
Document ,
, , - .
Database Container.

converted to PDF by HupBaH9I

D ocum ent
Container. ,

.
6.4 6.5 :

1
3
5
7
9
11
13
15

2
4
6
8
10
12
14

DBEngine
Database
QueryDef
Field
Parameter
Group
Property

Workspace
TableDef
Recordset
Index
User
Relation
Container

Document

6 .4 .

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
AllowZeroLength

AllPermissions

Attributes

BOF

Bookmark

Bookmarkable

CacheSize

CacheStart

Clustered

CollatingOrder

ConflictTable

+
+

Connect

+ +

Container

CreateGroup
CreateUser
CurrentUsers

DateCreated

+ ++

DataUpdatable

+
+

Default User

Default Password

DefaultValue

DesignMaster

EOF

Fields

Filter

Foreign

ForeignName

ForeignTable

IgnoreNull

Index

Inherited
IniPath

+
+

LastModified

LastUpdated

LockEdits
LoginTimeout

+ ++
+

converted to PDF by HupBaH9I

Name

+ + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +

NewPassword
NoMatch

OrdinalPosition

Owner

Password

+ +

++

PercentPosition

Permissions

PID

Primary

Owner
QueryTimeout

RecordCount

+
+

ReplicaDescription

ReplicaID

ReplicaSetDescription

Required

Restartable

ReturnsRecords

Signature

Size

Sort

SourceField

SourceTable

SourceTableName

SQL

SystemDbPath

Table

Transactions

Type

+ ++

++

++

Unique
Updatable

+ + ++ ++

UserName

ValidateOnSet

ValidationRule

+ ++

ValidationText

+ ++

Value

++

Version

+
+
6 .5 .

1 2 3 4
5 6
7 8 9 10 11 12 13 14 15

AddNew

AppendChunk
BeginTrans

+
+

Clone

Close

+ ++

CommitTrans

++

CompactDatabase +
CopyFields
CreateDatabase

+
+

CreateField
CreateGroup
CreateInde+

+
+

++

++
+

++

converted to PDF by HupBaH9I

CreateProperty

+ ++ ++

CreateQueryDef

CreateRelation

CreateReplica

CreateTabledef

CreateUser
CreateWorkspace

++ + +

++

Delete

Edit

Execute

++

FieldSize

FillCache

FindFirst

FindLast

FindNext

FindPrevious

GetChunk

GetRows
Idle

+
+

Move

MoveFirst

MoveLast

MoveNext

MovePrevious

MoveReplica

NewPassword
OpenDatabase
OpenRecordset

+ ++ ++ + +

RefreshLink

RegisterDatabase

RepairDatabase

Requery
Rollback

+
+

Seek
Synchronize
Update

+
+
+

,
, ,
.
Visual Basic .
-
Data Manager. Visual Basic Add-Ins Data
Manager. File New Database.
, . Data Manager
, . 6.16.
, .

converted to PDF by HupBaH9I

f j f Date Man ago - D:\My DocumcrHo\DOC\Ncw 8ook\aulostore.mdb

OIb

iiyidow tldp

nl-cibose: Doc(imenls\DCC\Newr BttDk\aulo(stare mdti

. 6 .1 6 . Data Manager
Visual Basic
Microsoft Access. , Access 7.0,
"" , Visual Basic.
, ODBC ,
Visual Basic ,
.
, , ,
.

.
, ,
. Tools References
Microsoft DAO 3.0 Object Library.
File Visual Basic New P ro ject.
Create_DB. Module
In s e rt. Procedure.
- Main, Sub,
- Public. OK ,
, . 6.17.
.

1. Dim ,
, .
DBEngine Workspace, , :

Database.
TableDef .
Field .
Index .

converted to PDF by HupBaH9I

, Autostore,
Customer Account, :
Public Sub Main()
'
Dim oAutoDB As Database, oAutoWs As Workspace
Dim oCustomerTd As TableDef, oAccountTd As TableDef
Dim oCustomerFlds(8) As Field, oAccountFlds(7) As Field
Dim oCustomerIdx As Index, oAccountIdx(2) As Index
Dim oAutoRel As Relation
Dim oIndexFld(3), oRelFld As Field
CreateDatabase Workspace:
Set oDBVar = [oWSVar .]CreateDatabase(cDataBaseName ,
Locale [, Options])

o D BV ar - ;
oW SV ar - Workspace;
cD ataB aseN am e - ,
;
Lo cale -
.
, ,
dbLangGeneral, ,
.
dbLangCyrillic.
O ptions - . ,
dbEncrypt .

Autostore :
Set oAutoWs = DBEngine.Workspaces(0)
Set oAutoDB = oAutoWs.CreateDatabase("AUTOSTORE.MDB",_ dbLangGeneral)
,
C hD rive ChDir.
3. CreateTableDef Database :
Set oTDVar = oDBVar .CreateTableDef([cName
[, Attributes [, Source [,]]]])

oTD V ar - TableDef.
o D BV ar - Database.
cN am e - . 40
. .
A ttrib u te s - ,
.
S o u rce - ,
.
C onnect -
.

Auto_Store, :
Set oCustomerTd = oAutoDB.CreateTableDef("Customer")

converted to PDF by HupBaH9I

Set oAccountTd = oAutoDB.CreateTableDef("Account")


4. CreateField TableDef:
Set oFVar = oTDVar.CreateField([cName [, Type [, Size]]])

o FV ar - Field.
oTD V ar - TableDef.
cN am e - . ,
.
T yp e - . Visual Basic
:
o
dbDate - ;
o
dbText - ;
o
dbMemo - ;
o
dbBoolean - ( Yes/No);
o
dbInteger - (2 );
o
dbLong - (4 );
o
dbCurrency - ;
o
dbSingle - ;
o
dbDouble - ;
o
dbByte - ;
o
dbLongBinary - OLE-.
S iz e - .
(1 - 255).


Customer:
Set oCustomerFlds(0) = oCustomerTd.CreateField("KEY_CUSTOMER", dbLong)
'
' Attributes Field
oCustomerFlds(0).Attributes = dbAutoIncrField
Set oCustomerFlds(1) = _ oCustomerTd.CreateField("NAME_CUSTOMER", dbText, 100)

5. CreateIndex TableDef:
Set oIVar = oTDVar .CreateIndex([cName])

o lV ar - Index.
oTD V ar - TableDef.
cN am e - . , .


Index (. . 6.4). Customer
:
Set oCustomerIdx = oCustomerTd.CreateIndex("CUSTOMER_ID")
oCustomerIdx.Primary = True
oCustomerIdx.Unique = True
CreateField , ,
, :
Set oIndexFld(0) = _ oCustomerIdx.CreateField("KEY_CUSTOMER")

converted to PDF by HupBaH9I

6. . CreateRelation
Database:
Set oRelVar = oDBVar.CreateRelation([cName
[, cParentTable [, cChildTable
[, Attributes]]]])

o R e lV a r - Relation.
o D BV ar - Database.
cN am e - . , .
cP a re n tT a b le - .
cC hild T ab le - .
A ttrib u te s -
:
o
dbRelationUnique - " ".
o
dbRelationDontEnforce - .
o
dbRelationInherited -
.
o
dbRelationLeft - ,
.
o
dbRelationRight - ,
.
o
dbRelationUpdateCascade -
.
o
dbRelationDeleteCascade -
.


, :
' " "
Set oAutoRel = oAutoDB.CreateRelation("CustToAcc",_ "Customer", "Account")
Set oRelFld = oAutoRel.CreateField("KEY_CUSTOMER")
oRelFld.ForeignName = "KEY_CU STOMER"
7. , Append. ,
.

Delete,
.

Collection .Append oVar

Collection - , ;
o V ar - .

, ,
:
'
oCustomerTd.Fields.Append oCustomerFlds(0)
oCustomerTd.Fields.Append oCustomerFlds(1)
'
oCustomerIdx.Fields.Append oIndexFld(0)
oAccountIdx(0).Fields.Append oIndexFld(1)
oAccountIdx(1).Fields.Append oIndexFld(2)

converted to PDF by HupBaH9I

'
oAutoRel.Fields.Append oRelFld
'
oCustomerTd.Indexes.Append oCustomerIdx
oAccountTd.Indexes.Append oAccountIdx(0)
oAccountTd.Indexes.Append oAccountIdx(1)
'
oAutoDB.TableDefs.Append oCustomerTd
oAutoDB.TableDefs.Append oAccountTd
'
oAutoDB.Relations.Append oAutoRel

.
, -
.

. ,
.
Create Append. ,
TableDef , Field Index
. SQL,
.

DAO:
Dim oDB As Database
' TableDef
Dim oNewTd As TableDef
Dim oNewFld As Field' Field
'
Set oDB = _ DBEngine.Workspaces(0).OpenDatabase("AUTOSTORE.MDB")
Set oNewTd = oDB.CreateTableDef(" ")
Set oNewFld = oNewTd.CreateField(" ", dbInteger)
'
oNewTd.Fields.Append oNewFld
oDB.TableDefs.Append oNewTd'
oDB.Close '
, .
Delete , :
oDB.TableDefs.Delete " "
,
Relation. Field
TableDef, .
Auto_Store
Visual Basic.

6.4. MS SQL Server


MS SQL Server : ,
Microsoft SQL Enterprise Manager, , Microsoft ISQL/w,
SQL pass-through
(upsizing) .
,
.
MS SQL Server Microsoft ISQL/w - ,
. ISQL/w ,
, . 6.18.
,
. Results ,

converted to PDF by HupBaH9I

(. 6.19).
.
, . 6.20 6.21.
Microsoft ISQUw
F rlc

F flil

O iir iy

W in d o w

H e lp

Query - RUBEN21auto_slore\sa

tl Oueiies1
Queiy

5"'_EIT-i.i/uti

" l|l^'|Sloshes yO

. I'lj J 'j . 7 r.rv[^- 1. 11.-1 -:


m an *o d *i
n n
H CPE a s e l e i r Uo s f f i
N [ m o [ f s l -

:-.!h

Hl i n i r
.100 Of

.**- t 1 Fi

[SI I^

Sha^prjEl

.-

Li i i

L t U ................................................................

ConnecliQns T

0 &

30.

E>ei:uie Hie current Queiyietf

. 6 .1 8 . SQL Server
M,. ii.-.nll I5QI {w
F_itc

L riil

Q uery

W indo w

Help

Query I:I.11 N !",.111111 :,11Ifr'i-,,I

HEHESm
[i=^t? f i n

model
J i u y

A }


'iltOriO' n 6
12 6 ii
:'n1 \n--*-hI J i
00

i bOOl

J-snqe
J
r i y in g ip 'ir 6 ?S

Ihc^roloT
F o rd O S i

11

L in c o ln

tl-?II.riJti-r-E*rN
Itel t& i-Pd ri1:
Bmi
R o l i - f b y r a

A 300

1to:
'.44j
Ji.NL
1

4?S?

155;?
67F.fi

::: n v C &) AJIk Ih I)

0 &

C o n n e c ts 11

1 l^/H

. 6 .1 9 . SQL Server

converted to PDF by HupBaH9I

MiacktDfi \
file

Edit

Q u ery

W in J ew

IHie'lp

-RUBEMP\*iiln_ElDfB\fla
jg jr s

ij ; ^

S E L E C T m odal _

QlMiy

1
St ewelflu
S con CehmiI
I

sj R e d d s

4-lfv ' H

-.
I'

j '.liii..---||.
: 1
. 6 .2 0 . SQL Server
M IcrotoftlSQUw
| N il*

E d it

Q u e ry

W im ir jw

H e lp
Q u ery

!!"
u.. ijn

Quary
SM |

R U B E M \ s u i a js I q \

R ssuN T I

'.jl

Rhnwplun

ELECT

.....

i
. 6 .2 1 . SQL Server
, , - Device , .

Device - , MS SQL Server


, .

Device . ,
, Device
. :
DISK INIT
NAME = cLogicalName,
PHYSNAME = cPhysicalName,
VDEVNO = nValuel,
S IZ E = nValue2
[, VSTART = Adress]
:

converted to PDF by HupBaH9I


NAME

,
SQL
.
30 .

PHYSNAME

,
.

.

VDEVNO


1 255.

SIZE

2- .
- 500
1 M.

VSTART

,

. 0.

Rdev_lib, SAMP_LIB.DAT - ,
:
DISK INIT
NAME = 'Rdev_lib',
PHYSNAME = 'C:\SQL_60\DATA\SAMP_LIB.DAT',
VDEVNO=1,
S IZ E = 5120
. 6.22 , File
Manager Windows NT.

C:\SQL_BD\DATA\*.*- [RUBIC]
4,,

_ Q Progiam Files
^ainple
tl :l: U L_L.n

D MASTER.[i AT
Q

M'jDE.OAT

D MSDELOG.DA"

h D E IN
& BINN
E

D SAMP_LIB.DAT
SAM Pjni^ DAI

Cj DLL
Q INSTA.I.
- Q REFLOAT A
L SAMPL
P i lj=imp
Cn OGLT.
- 7] u;=n

- Q vpp

. 6.22.
Rdev_log :
DISK INIT

converted to PDF by HupBaH9I

NAME = 'Rdev_log',
PHYSNAME = 'C:\SQL_60\DATA\SAMP_LOG.DAT',
VDEVNO=2,
S IZ E = 2048
. 6.23 6.24 , . 6.25 -
Server Manager.
Auto_Store,
: Rdev_lib Rdev_log, 10 4
. , :

Edit Database Devices - Rdev lib

. 6 .2 3 .
t ( lit D a la b a s e D e v ic e s - H d e v jn g
Name

Jog

OK:
Mirro' dig

_| [lefadt Oenc

S ire | M61:

Hep

Device Space Usage

auto store
IP MB

. 6 .2 4.

converted to PDF by HupBaH9I

S e rv e r M a n a g e r
Server:

RU BEN 2
Microsoft S Q L Servers

= fj Mygroup

EI-aR RUBEN2 (SQL Server G.O)


\-

S Q L EH8CLjtiV8

} 0 3 D atabase D ev ice s
^ = j master
M S D B D a ta

M SD BLog

g B y
^

R d e v jo g

Ej3--(^J Dump D e v ice s

D a tab a se s

i -

auto_slQre

! -

master

! - B

model

! -

msdb

I f i- B

termpdb

___ | Login?

S Q L G.O

. 6 .2 5 .
CREATE DATABASE DatabaseName
[ON {D EFA U LT | DatabaseDevice} [= Size ]
[, DatabaseDevice [= S iz e ]]...]
[LOG ON DatabaseDevice [= Size]
[, DatabaseDevice [= S iz e ]]...]
[FO R LOAD]
D atab aseN am e .
,
, .
DEFAULT, ,
Sysdevices, : ON DEFAULT = 5.
, ,
LOG ON. , .
FOR LOAD .
FOR LOAD, ,
.
CREATE DATABASE A uto_Store ON Rdev_lib = 10 LOG ON Rdev_log = 4
A uto_Store , .
: Country Firm, key_country.
U SE Auto_Store
Country:
CREATE TABLE Country (key_country smallint ID EN TITY(1,1) ;
PRIMARY KEY CLU STER ED , nam e_country varchar(20) NOT NULL, tim e s_ tim estam p)

converted to PDF by HupBaH9I


Firm:

CREATE TABLE firm (key_firm smallint ID EN TITY(1,1)


PRIMARY KEY CLUSTERED, name_firm varchar(20) NOT NULL,
key_country smallint REFERENCES country(key_country),
tim es_ timestamp)
. 6.26 C R EA TE T A B L E A L T E R T A B L E
Model, . 6.27 - Server Manager.
Manage Tables RUDCN^juta_sEoTC

20
2

numeric

5.0

numeric

20

|4 1.

numeric

5.1

y"

Lonjjc

numeric-

5.1

Kw_lucLoil

:;1

11II1 III

. n:
kej_lyne
ktv_badj^

v''

i4ifK

5.

numeric

1.1

:m sllril

Jif

111

I I i ,_d

numeric

1.0

quwlity^eed
1*

IKifmtrx

;.o
5.0

v''

numeric-

1.0

1.1'

-- ----

111

[II

<L-

. 6 .2 6 . Model Manage Tables

converted to PDF by HupBaH9I

S e r v e i M anager

ZR

5. |ftuaEN2~
(^

Microsoft SQL 5erveis

1=

Mygrcup
L-i

R L I0 E N 2 [SO L S e rve r .0]


!^ = ; SQ L E x e c u tiv e

L+i _ J Database Devices

D u m p D e v ic e t

0 Datsba:*:
4 ^ ^utD_at>ofe

*1 U Publics iOrlF
i!

G ro u p s /U s e rs

Objects

id

-1
[TTj] (dbo)

au(omobJe_paMen5ei_car(dbo)
:

[dbDj

country (db&l
I7T5 customer (cto)

[dboj

fiiel_oil Idbo]
fiT^ model (dba)

c/deL [dba[

sa1e ]

| tjne ldbo|

wlesman [cJboJ

|j C_| Views
T1 : "~l Stored Piocedmes_________________

. 6 .2 7 .
SQL Server :
1.
2.

3.
4.
5.
6.

1 30 .
"_", "@", "#". ,
"@", , ,
"# ", .
, , "#" "$".
.

.
.


. , ,
Windows 95, . ,
, SQL Server,
, , .
(upsizing) . :
CREATE TABLE ___ ( smallint ID EN TITY(1,1)
PRIMARY KEY CLUSTERED, varchar(20) NOT NULL, timestamp)
. 6.28 .

.
GRAN T R EV O KE. ,

converted to PDF by HupBaH9I

, ( -
).
Manage Tables RUBENZ^utn

. 6 .2 8 .
:

SELECT - ;
IN SERT - ;
DELETE - ;
UPDATE - ( ,
);
REFERENCES - ,
( ).

, , Karina Lena,
Piter_group, , . 6.6.
6 .6 .

S E L E C T IN S E R T D E LE T E U PDATE
Country
key_country
Karina Karina

Firm

name_country Karina,
Lena
tim es_
key_firm
name_firm
Karina,
Lena
key_country
tim es_

Karina

Karina

Lena

Karina
Lena
Lena
Lena
Lena

Karina
Lena
Karina
Lena
Karina
Lena
Lena
Lena

Piter_group:
sp_addgroup piter_group
login_lev1, login_lev2
lev1, lev2 Auto_Store:
sp_addlogin login_lev1, lev1, auto_store
sp_addlogin login_lev2, lev2, auto_store
, Server
Manager, . 6.29.

converted to PDF by HupBaH9I

Server Manager

ID

Seiran RUGEN2
^
0

Miciosdi SQL Seivers


Wygioup
3

RU BEN 2 |SQ L Servef ]

= r SOL EKSCutive
if'
Database devices
;i' | _ j Dump Devices
!Databases
+: ^

aulslone

;
+!

master

:+]
modd
?! ^ nnEdb
+i

E; ' J

lernpdb

Logins

\*mxm

' f j j Iggintev?

( J j login Iev3
login_Sev4
login_lev5

5 3 pobe

repLpuMshei
feDL^ubicnber

i^) SQL )

. 6 .2 9 . Logins - sp_addlogin
Karina Lena Piter_group:
sp_adduser login_lev1, karina, piter_group
sp_adduser login_lev2, lena, piter_group
Server Manager,
. 6.30. ,
sp_addgroup, sp_adduser.

converted to PDF by HupBaH9I

S erver M a n a g e r

U |b J

RUBEM2
Mtcrosoft SQL Serveis

Mygioup
0 .RLJBENZfSQLSerwH SQ1
' i==t SQL xecuhve
l+f L J D atabase D eeres
l+i L J Dump Devices
1=1 ^ Databases
j :- ^ auto_siare

ti _ J Publication?
0 ^

Gioups/Usefs

-: ffcpiter_group
Elena
lid
Karins
Lena
Ruben

SfcDubyo
Obiecte
T .sbtei

LJ
ir j
Stored Piocedures
|__J Rules

DefauJs

i ~l Us* Defmed Datatypes


: .t. IT masbef
. 6 .3 0 .
GRAN T R EV O KE :
GRANT insert, delete ON firm TO Lena
GRANT insert, delete ON country TO Karina
REVOKE insert, delete ON firm FROM Karina
REVOKE insert, delete ON country FROM Lena
GRANT update, select ON country (name_country) TO Karina, Lena
GRANT update, select ON firm (nam e_firm ) TO Karina, Lena
REVOKE update,select ON country (key_country, tim es_) FROM Karina, Lena
REVOKE update,select ON firm (key_firm , key_country, tim es_) FROM Karina, Lena
,
. 6.31, , .
6.32.

converted to PDF by HupBaH9I

Object Permissions - fUJBENftauti store


By User
User/Group:

Ey Qbiett

ut|eet
Object rm s

Lei4

l 5 bles +

^ Views ^

Member of:

Set

A | Object

D^eclsGra^ d

G rani All

to
Revoke All

Skiied Pdocedu;

Column L e v d Permissions:

Object
account
autor..iobile_
body
coimlr})
Icuittxnsr
firm
fueLoil
model
ordei_

OiNFier Tvpt SiJectl


dbo
m lJ _
dbo

dbo
m
.
dbo
HE
w
m
dbo

dbo
ffl
dbo
dbo

rtf
dbo

vT

se

Insert Updatt

Ek k j I
+

&

V*

;,

u
J

_____
....
u
J

V ff

Colirtfin Seleit Uptat*


Co^.innnsl
dddre-;i 1 , 1
com
m
ent J
tan
lirst_nem
e V
jufidical V*
tre^m
stom
e V
last name
V!
n am s_cysl(* M v+
(All

Help

. 6 .3 1 .

Object Permissions - fUJ6EN\eut_store


By Object

by Utet
Object

E 3 cusitofner )
Group

Sei

User Name

Selecl

pitei_group

Elena

Inseal Update Delete Ex


_J
J

Grant All

_4

Revoke All

Ira
Kaina

Lena
Rub^n

_____

public
dbo

____

Cfllumrs Level Permissions;


Si

____

Column

fftll Co^.irmns]

S e JK t I Updat;

kjei)_HJ-itorrie j f c
n ame custon

address

lax
la stjiam *
lifst_name
patronymic

s f
V T

Help

. 6 .3 2 .


(upsizing) - ,
, , ,
, , Visual FoxPro.

converted to PDF by HupBaH9I

,
-, , .
, ,
,
.
, Visual FoxPro.
, .

,
Visual FoxPro.


MS SQL Server -
(Upsizing Wizard).
SQL Server, , ,
Visual FoxPro.
Visual FoxPro, ,
.
:

.

.
-.

SQL Server,
- ODBC. , SQL
Server, SQL ,
Visual FoxPro ,
.
,
, ,
. ,
, .
, .
, ,
, .
,
SQL Server.
,
SQL Server, .
:

, CREATE
TABLE CREATE DEFAULT.
, CREATE DATABASE SELECT
Master.
, .

,
. .
SQL Server ,
.
. ,
, .
SQL Server .
, , DBF Visual FoxPro
, , ,
SQL Server. , Visual FoxPro ,
, 1,3 - 1,5 SQL Server.

converted to PDF by HupBaH9I

, Visual FoxPro .
,
.
,
.
SQL Server . -
, ,
. , SQL Server ,
.
,
SQL Server. ,
, .

, .
, ,
. , ,
,
.
. ,
.
SQL
Server . ,
,
.
,
, - .
,
.
,
- , Master.
, ,
, .
.
SQL Server .

.
, (
) , .
Default .
SQL Server
, , SQL Server ,
.
ODBC
Visual FoxPro,
SQL Server.

( DBC, DCT DCX). DBF,
DBC , ,
.
, , ,
DBC, DCT DCX
.

, - ,
.

. -
, .
ODBC
, .
1.
2.

T o o ls Wizards, Upsizing.
, ,
Visual FoxPro. . 6.33 -
. Cancel .
, Finish.

converted to PDF by HupBaH9I

. Upsizing Wizard
11

-Local Database Selection

Which local database do you want to upsize?

[Database to Upsiie: auto_stGre

Cancel

Next

Finish

j
1

. 6 .3 3 .
3.

Finish,
.

Finish ,
. Finish , ,
, .
, ,
, .
. , , ,
, 8 . ,
, ,
, C trl+ A lt+ D el.
,
General.
3 .
.
-
, , .
- .

,
, . ,
.
,
:

, , Visual FoxPro,
.
,
.
,
.

Visual FoxPro, .
,
, . , ,
Visual FoxPro, .
SQL Server ,
. ,

converted to PDF by HupBaH9I

.
, ,
.
, SQL
Server Security Manager s_adduser sp_addgroup.
, ,
.
, SQL Object
Manager GRANT R EV O KE.
SQL Server ,
Master . Master,
, .
,
.

SQL Server . ,
, .

,
. ,
, ,
.

SQL .
- :

.
SQL.

-
.
,
Visual FoxPro .
.
SQL SQL
. SQL ,
. . 6.7
SQL.
6 .7 . SQL

SQ L
SQL
SQL,
SELECT




SQL
SQL




SQL,

converted to PDF by HupBaH9I



SQL

, SQL
:

,
, .
SQL, ,
, .
Update, Delete Insert
SQL.
. Visual FoxPro
SQL,
.

SQL . :

SQL
"" , .
,
C U R S O R S E T P R O P (). ,
.
SQL ,
.

, -
SQL, . ,
, SQL.

SQ L (SQ L pass-through)
SQL.

,
. , , ,
.
SQL ,
, SQL.
, SQ L
S E L E C T , SQL ,
S Q L E X E C () Visual FoxPro. . 8 .
SQL pass-through Visual
FoxPro.
SQL .
SQL ,
, .
, , SQL,
.
SQL
ODBC, Visual FoxPro S Q LC O N N EC T(), .
SQL Visual FoxPro
.
SQL,
.
SQL Visual FoxPro?
1.
2.

.
Test ODBC ODBC .
SQ LC O N N EC T()
S Q LS T R IN G C O N N EC T ().

converted to PDF by HupBaH9I

, Visual FoxPro m aster SQ L


Server, (
"sa") "", :
lhandle=SQLCONNECT('m aster','sa','')
3.

SQ L Visual FoxPro
Visual FoxPro
Visual FoxPro. ,
Custom er :
? SQ LEX EC (lhandle, "select * from customer" , ; "m y_cursor")
BROW SE

4.

S Q L D IS C O N N E C T ().
=SQ LD ISCON N ECT(lhandle)

SQ L pass-through Visual FoxPro


S E T CO NSOLE OFF
*
lhandle=SQ LCO NNECT('m aster','sa','')
IF lhandle>>0 && SQ L Server
*
* Rdev_lib Rdev_log,
*
*
u se_m = SQ LEX EC (lh an d le,"U SE master")
m libr= SQ LEXEC(lhandle,"sp_dropdevice Rdev_lib, delfile")
m logr=SQ LEXEC(lhandle,"sp_dropdevice Rdev_log, delfile")
*
m lib= SQ LEXEC(lhandle,"D ISK IN IT ;
NAME = 'Rdev_lib', ;
PHYSNAME = 'C:\SQ L_60\D ATA\SAM P_LIB.D A T', ;
VD EVN O =1, ;
S IZ E = 5120")
*
m log= SQ LEXEC(lhandle,"D ISK IN IT ; &
NAME = 'Rdev_log', ;
PHYSNAME = 'C:\SQ L_60\D ATA\SAM P_LO G .DA T', ;
VD EVN O =2, ;
S IZ E = 2048")
*
*
* auto_store
* , , ,
*
IF m lib>>0 AND mlog>>0
= SQ LEX EC(lhand le,"IF EX IS T S ( S E L E C T name FROM ; sysdatab ases ;
W HERE name IN ('auto_store') );
BEGIN DROP DATABASE auto_store END")
* au to_store,
*
* Rdev_lib
* Rdev_log
creat_d ata= SQ LEX EC (lhan d le,"CR EA TE DATABASE auto_store ;
ON Rdev_lib = 10 LOG ON Rdev_log = 4")
*
IF creat_d ata> > 0
= SQ LEXEC(lhandle,"U SE auto_store")
* country , ,
* ,
=SQ LEX EC(lhand le,"IF EX IS T S (S E L E C T nam e FROM sysobjects;

converted to PDF by HupBaH9I

WHERE type = 'U' AND name = 'country');


DROP TABLE country")
* ^ u n try
cr_country=SQLEXEC(lhandle, ;
"CREATE TABLE country (key_country smallint ; ID EN TITY(1,1) ;
PRIMARY KEY CLUSTERED, name_country varchar(20) ;
NOT NULL, tim es_ timestamp)")
* Firm , ,
*
=SQLEXEC(lhandle,"IF EXISTS (SELEC T name ;
FROM sysobjects WHERE type = 'U' AND name = 'firm') ;
DROP TABLE firm")
* Firm
cr_firm =SQLEXEC(lhandle, ;
"CREATE TABLE firm (key_firm smallint ID EN TITY(1,1) ;
PRIMARY KEY CLUSTERED, name_firm varchar(20) NOT NULL, ;
key_country smallint REFERENCES country(key_country), ;
tim es_ timestamp)")
* Fuel_oil ,
* , ,
=SQLEXEC(lhandle,"IF EXISTS (SELEC T name ;
FROM sysobjects WHERE type = 'U' AND name = 'fuel_oil') ;
DROP TABLE fuel_oil")
* fuel_oil
cr_fuel=SQLEXEC(lhandle, ;
"CREATE TABLE fuel_oil (key_fuel_oil smallint ; IDEN TITY(1,1) ;
PRIMARY KEY CLUSTERED, name_fuel_oil varchar(20) NOT NULL,;
tim es_ timestamp)")
* Tyre , ,
* ,
=SQLEXEC(lhandle,"IF EXISTS (SELEC T name ;
FROM sysobjects WHERE type = 'U' AND name = 'tyre') ;
DROP TABLE tyre")
* Tyre
cr_tyre=SQLEXEC(lhandle, ;
"CREATE TABLE tyre (key_tyre smallint ID EN TITY(1,1) ;
PRIMARY KEY CLUSTERED, nam e_tyre varchar(20) NOT NULL, ;
tim es_ timestamp)")
* Body , ,
* ,
=SQLEXEC(lhandle,"IF EXISTS (SELEC T name ;
FROM sysobjects WHERE type = 'U' AND name = 'body') ;
DROP TABLE body")
* body
cr_body=SQLEXEC(lhandle,;
"CREATE TABLE body (key_body smallint IDEN TITY(1,1) ;
PRIMARY KEY CLUSTERED, name_body varchar(20) NOT NULL, ;
tim es_ timestamp)")
* Model , ,
* ,
=SQLEXEC(lhandle,"IF EXISTS (SELEC T name ;
FROM sysobjects WHERE type = 'U' AND name = 'model') ;
DROP TABLE model")
* Model
cr_model1=SQLEXEC(lhandle, ;
"CREATE TABLE model (key_model smallint ID EN TITY(1,1) ;
PRIMARY KEY CLUSTERED, name_model varchar(20) NOT NULL, ;
key_firm smallint DEFAULT 1 REFERENCES firm (key_firm ), ;
swept_volume numeric(5) DEFAULT 1 CHECK ;
(swept_volum e>>1) NULL)")
cr_model2=SQLEXEC(lhandle, ;
"ALTER TABLE model ADD quantity_drum numeric(2) ;
DEFAULT 1 ;
CHECK (quantity_drum>> = 1) NULL, capacity num eric(5,1) NULL, torgue num eric(5,1) NULL,
key_fuel_oil ;
smallint DEFAULT 1 ;

converted to PDF by HupBaH9I

REFERENCES fuel_oil(key_fuel_oil), top_speed num eric(5,1) NULL") cr_model3=SQLEXEC(lhandle, ;


"ALTER TABLE model ADD starting num eric(4,1) NULL, ;
key_tyre smallint DEFAULT 1 REFERENCES tyre(key_tyre), ;
key_body smallint DEFAULT 1 REFERENCES body(key_body), ;
quantity_door numeric(1) NULL, ;
quantity_sead numeric(2) NULL")
cr_model4=SQLEXEC(lhandle, ;
"ALTER TABLE model ADD length numeric(5) NULL, ;
width numeric(4) NULL, height numeric(4) NULL, ; expense_90 ;
num eric(4,1) NULL, expense_120 num eric(4,1) NULL, ;
expense_town num eric(4,1) NULL, tim es_ timestamp")
* Automobile_passenger_car
* , , ,
=SQLEXEC(lhandle,"IF EXISTS (SELEC T name ;
FROM sysobjects ;
WHERE type = 'U' AND name = 'automobile_passenger_car') ;
DROP TABLE automobile_passenger_car")
* Automobile_passenger_car
cr_auto=SQLEXEC(lhandle, ;
"CREATE TABLE automobile_passenger_car ;
(key_auto smallint IDEN TITY(1,1) PRIMARY KEY CLUSTERED, ;
key_model smallint REFERENCES model(key_model), ;
date_issue datetime, cost num eric(10,2), tim es_ ; timestamp)")
* Customer , ,
* ,
=SQLEXEC(lhandle,"IF EXISTS (SELEC T name ;
FROM sysobjects WHERE type = 'U' AND name = 'customer') ;
DROP TABLE customer")
* customer
cr_customer1=SQLEXEC(lhandle, ;
"CREATE TABLE customer (key_custom er smallint ID EN TITY(1,1) ;
PRIMARY KEY CLUSTERED, name_customer varchar(30) ;
NOT NULL, address varchar(30), tel varchar(12), ; fax varchar(12), ;
last_name varchar(17), first_name varchar(17))") ;
cr_customer2=SQLEXEC(lhandle, ;
"ALTER TABLE customer ADD patronymic varchar(17), juridical bit, comment text, tim es_ timestamp")
* Sale , ,
* ,
=SQLEXEC(lhandle,"IF EXISTS (SELEC T name ;
FROM sysobjects WHERE type = 'U' AND name = 'sale') ;
DROP TABLE sale")
&& sale
cr_sale=SQLEXEC(lhandle,;
"CREATE TABLE sale (account_ smallint ;
PRIMARY KEY CLUSTERED, date_sale datetime, ;
sum _ num eric(10,2), tim es_ timestamp)")
* Account , ,
* ,
=SQLEXEC(lhandle,"IF EXISTS (SELEC T name ;
FROM sysobjects WHERE type = 'U' AND name = 'account') ;
DROP TABLE account")
* Account
cr_account1=SQLEXEC(lhandle, ;
"CREATE TABLE account (number_record smallint ; ID EN TITY(1,1) ;
PRIMARY KEY CLUSTERED, account_ smallint REFERENCES ;
sale(account_), key_customer smallint REFERENCES ;
custom er(key_custom er), key_auto smallint REFERENCES ;
autom obile_passenger_car(key_auto))")
cr_account2=SQLEXEC(lhandle, ;
"ALTER TABLE account ADD date_write datetime, selled ;
bit, sum _ num eric(10,2), tim es_ timestamp")
* Salesman , ,
* ,
=SQLEXEC(lhandle,"IF EXISTS (SELEC T name ;
FROM sysobjects WHERE type = 'U' AND name = 'salesman') ;
DROP TABLE salesman")

converted to PDF by HupBaH9I

* Salesman
cr_salesm an=SQLEXEC(lhandle, ;
"CREATE TABLE salesman (key_salm an smallint ; ID EN TITY(1,1) ;
PRIMARY KEY CLUSTERED, last_name varchar(17), ;
first_name varchar(17), patronymic varchar(17), ; tim es_ timestamp)")
* Order_ , ,
* ,
=SQLEXEC(lhandle,"IF EXISTS (SELEC T name ;
FROM sysobjects WHERE type = 'U' AND name = 'order') ;
DROP TABLE order_")
* Order_
cr_order=SQLEXEC(lhandle, ;
"CREATE TABLE order_ (key_order smallint IDEN TITY(1,1) ;
PRIMARY KEY CLUSTERED, key_customer smallint REFERENCES ;
custom er(key_custom er), key_model smallint REFERENCES ;
model(key_model), key_salman smallint REFERENCES ;
salesm an(key_salm an), tim es_ timestamp)")
ELSE
WAIT WIND " !"
ENDIF
ELSE
WAIT WIND " !" + CHR(13)+ ;
" :" +CHR(13)+" - "+CHR(13)+ ;
" - "+CHR(13)+ ;
" - "
ENDIF
*
=SQLEXEC(lhandle,"USE auto_store")
* Piter_group , ,
* ,
=SQLEXEC(lhandle,"sp_dropgroup piter_group")
* piter_group
addg=SQLEXEC(lhandle,"sp_addgroup piter_group")
*
IF addg>>0
*
* login_lev1, * login_lev2,
* login_lev3, login_lev4, login_lev5
* lev1,
* lev2, lev3, lev4, lev5 Auto_store
=SQLEXEC(lhandle,"sp_addlogin login_lev1, lev1, ; auto_store")
=SQLEXEC(lhandle,"sp_addlogin login_lev2, lev2, ; auto_store")
=SQLEXEC(lhandle,"sp_addlogin login_lev3, lev3, ; auto_store")
=SQLEXEC(lhandle,"sp_addlogin login_lev4, lev4, ; auto_store")
=SQLEXEC(lhandle,"sp_addlogin login_lev5, lev5, ; auto_store")
* Ruben, Karina, Lena, Elena Ira
Piter_group
=SQLEXEC(lhandle,"sp_adduser login_lev1, Ruben, ; piter_group")
=SQLEXEC(lhandle,"sp_adduser login_lev2, Karina, ; piter_group")
=SQLEXEC(lhandle,"sp_adduser login_lev3, Lena, ; piter_group")
=SQLEXEC(lhandle,"sp_adduser login_lev4, Elena, ; piter_group")
=SQLEXEC(lhandle,"sp_adduser login_lev5, Ira , ; piter_group")
ELSE
WAIT WIND ' PITER_GROUP '
ENDIF
*
=SQLEXEC(lhandle,"USE auto_store")
* Country
=SQLEXEC(lhandle,"INSERT country (name_country) VALUES ; ('')")
=SQLEXEC(lhandle,"INSERT country (name_country) VALUES ; ('')")
* Firm
=SQLEXEC(lhandle,"INSERT firm (nam e_firm ,key_country) ; VALUES ('Alfa Romeo',1)")
&& Fuel_oil

converted to PDF by HupBaH9I

=SQLEXEC(lhandle,"INSERT fuel_oil (nam e_fuel_oil) ;


VALUES (' ')")
&& Tyre
=SQLEXEC(lhandle,"INSERT tyre (nam e_tyre) VALUES ('4.5 ; J')")
* Body
=SQLEXEC(lhandle,"INSERT body (name_body) VALUES ; ('')")
* Model
=SQLEXEC(lhandle,"INSERT model ; (nam e_m odel,key_firm ,swept_volum e, ;
quantity_drum ,key_fuel_oil,key_tyre,key_body) VALUES ; ('145 1 .4 ',1 ,1 3 5 1 ,4 ,3 ,3 ,1 )")
* Automobile_passenger_car
=SQLEXEC(lhandle,"INSERT automobile_passenger_car ; (key_m odel,date_issue,cost);
VALUES (1,'7/7/94',10000)")
* Customer
=SQLEXEC(lhandle,"INSERT customer ; (name_custom er,address,tel, ;
first_nam e,juridical) ;
VALUES (' '/ ; ','77710',' ',1)")
* Sale
=SQLEXEC(lhandle,"INSERT sale
(account_,date_sale,sum _) ;
VALUES (101,'5/1/96',10000)")
* Account
=SQLEXEC(lhandle,"INSERT account ; (account_,key_custom er,key_auto, ;
date_write,selled,sum _) VALUES ; (101,1,1,'1/1/96',1,10000)")
* Salesman
=SQLEXEC(lhandle,"INSERT salesman ; (last_nam e,first_nam e,patronym ic) ;
VALUES ('','','')")
* Order_
=SQLEXEC(lhandle,"INSERT order_ ; (key_custom er,key_m odel,key_salm an) ;
VALUES (1 ,1 ,1 )")
* ()
=SQLEXEC(lhandle,"USE auto_store")
=SQLEXEC(lhandle,"GRANT insert, delete ON model ; TO ruben")
=SQLEXEC(lhandle,"GRANT update,select ON model ;
TO ruben, karina, lena, elena, ira")
=SQLEXEC(lhandle,"REVOKE update,select ON customer ; (comment) ;
FROM karina, lena")
* ODBC
=SQLDISCONNECT(lhandle)
ELSE
WAIT WIND " !"
ENDIF

7

7.1. ,
Visual FoxPro
Microsoft Access
7.2. SQL-

converted to PDF by HupBaH9I

7.3.
7.4.
7.5.

7.6.




SQL
Microsoft Visual FoxPro
Microsoft Access

-




Visual FoxPro

MicroxPro
Microsoft Access

, ,
, , .
, , , ! ,
, , , .
, - .
? ,
, ,
.
, . ,

, . ,
, .

7.1. ,

, , ,
.
- . , 9 .
:

;
;
, ;
DAO.

Visual FoxPro
, , . -
, , Browse Grid.
, , .
, ,
. , .
.
, .
- LO CATE - .
, , ,
. Visual FoxPro
Rushmore. ,
. ,
.
:
* Customer
* key_customer.

converted to PDF by HupBaH9I

*
*
*
*

,
Rushmore,
150 ,
100000 .
SELECT Customer
SET ORDER TO
nPeriod = SECONDS()
LOCATE FOR key_customer = 45004
nPeriod_1 = SECONDS()
? nPeriod_1 - nPeriod


.
LO CATE :
LOCATE FOR lExpressionl
[Scope]

[W HILE lExpression2 ]
[NOOPTIMIZE]
LO CATE C O N TIN U E,
,
.
- ,
S E T F IL T E R .
.
S E E K ,
. ,
,
.
, .
.
SELECT Customer
S ET ORDER TO key_customer
t=SECONDS()
S EEK 45004
t1=SECONDS()
? t1-t
-
, LOOKUP()
LOOKUP(ReturnField, eSearchExpression , SearchedField

[, cTagName])
:

ReturnField - , LO O K U P ();
eSearchExpression - , ;
SearchedField - , ;
cTagName - , .

LO O K U P () S E E K .
Rushmore.
,
.
LO O K U P ():
CLEAR
t=SECONDS()
S ET ORDER TO
mlook=LOOKUP(lastname,45004,Key_customer)

converted to PDF by HupBaH9I

t1=SECONDS()
? t1-t
? Mlook
, , ,
, Browse.
, ,
R EPLA C E.
- .
, , .
, :
REPLACE ALL citizenship WITH ""
, SQL, , :
UPDATE kadry SET citizenship = ""
.
,
. :
SELE kadry
S ET ORDER TO rabId
FOR I = 1 TO 100000
SEEK I
REPLACE citizenship WITH ""
NEXT
, ,
R EP LA C E ALL. -
.
, ,
. ,
R E C N O (), , .
,
.
, ,
.
, .
.
.
- ,
.
K e y _a u to k e y_m o d e l
1
1
2
3
4
4
5
6

5
99
..
80
..
0

100001
100002
100003
100004
100005
100006
100007
100008

d a te _
issu e
07.07.94
06.06.95
05.10.95
10.12.95
02.01.96
10.10.95
12.06.96

c o st s w e p t_ q u a n tity _ c a p a city
vo lu m e
drum
10000 1351
4
90
10500 1351
4
90
10500 1929
4
90
25000 3982
4
286
30000 3982
8
286
30000 3982
8
286
37000 3201
6
321
26000 4300
6
193

.
swept_volume, quantity_drum, capacity ; ,
, ,
. ,
, ,

converted to PDF by HupBaH9I

- . Automobil_passenger_car
:
k e y _ a u to
100001
100002
100003
100004
100005
100006
100007
100008

k e y_m o d e l
1
1
2
3
4
4
5
6

d a te _ is s u e
07.07.94
06.06.95
05.10.95
08.09.95
10.12.95
02.01.96
10.10.95
12.06.96

co st
10000
10500
10500
25000
30000
30000
37000
26000

- MODEL - :
k e y_m o d e l n am e_m o d el k e y _ firm s w e p t_v o lu m e q u a n tity _d ru m ca p a c ity
1
145 1.4
1
1351
4
90
2
146 1.9
1
1929
4
90
3
740I 4.0
2
3982
4
286
4
840Ci 4.0
2
3982
8
286
5
M3 3.0
2
3201
6
321
6
GMC Jimmy
3
4300
6
193
4.3
key_model.
, .
Model.
, - Automobil_passenger_car?
R EP LA C E,
.
Model.
, Automobil_passenger_car.
, ,
, .
, Visual FoxPro
, Referential Integrity,
Database.

Microsoft Access
Microsoft Access ,
, . , ,
, ,
, . ,
. ,
.
,
.
,
. ,
, .
, , . ,
,
, , "" .
,
.
" ", Click.
:

converted to PDF by HupBaH9I

Sub 40_Click()
On Error GoTo Err_40_Click
Screen .PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, ,_ acMenuVer70
Exit_40_Click:
Exit Sub
Err_40_Click:
MsgBox Err.Description
Resume Exit_40_Click
End Sub
, Click .
,
:

-
-
-


, , , ,
, " ", .
, , :
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
, , , ,
DoCmd DoMenuItem .
.
, ,
, . , ,
"", . ,
, , ,
.
,
Access: " ' Microsoft Access' . "

, ,
.
"" AUTOSTORE.MDB,
, . "AUTOMOBIL_PASSENGER_CAR"
.
"".
Bookmodule : LastForm Form lastcntr
Control:
Dim LastForm As Form
Dim lastcntr As Control
,
"".
Click "AUTOMOBIL_PASSENGER_CAR"
:
Sub 40_Click()
Set LastForm = Screen.ActiveForm
Set lastcntr = Screen.PreviousControl
mybook=LastForm.Bookmark
PoiskSub
End Sub
PoiskSub " ". ,
, ,

converted to PDF by HupBaH9I

- " ".
, ,
:
Public Sub PoiskSub()
DoCm d.OpenForm ""
Select C ase lastcntr.ControlType
C ase 109, 106, 110, 111
If Not IsN ull(lastcntr.ControlSource) Then
Form s![ ].[Flag3] = True
Else
Form s![ ].[Flag2] = False
Form s![ ].[Flag3] = False
End If
C ase Else
Form s![ ].[Flag2] = False
Form s![ ].[Flag3] = False
End Select
End Sub
Click
,
.
Find RecordSet FindRecord
DoCmd.
RecordSource.
, SQ L. RecordsetClone
Recordset, RecordSource.
"AUTOMOBILE PA SSEN GER CAR" - , RecordsetClone
, :
Dim myDb As D ataBase, rst As Recordset
Set Mydb = dbEngine.W orkspaces(0).D atabases(0)
S et rst = MyDb.OpenRecordset("AUTOMOBIL PASSEN GER CAR", _ dbOpenDynaset)
, Recordset ,
Move Find .
Bookmark,
. Bookmark ,
Bookmark Recordset,
RecordsetClone .
"AUTOMOBIL PASSEN GER CAR" :
m ybook=LastForm .Bookm ark
"" Bookmark
:
LastForm .RecordsetClone.Bookm ark=m ybook
, , Bookmark Recordset
Bookmark .
, ,
.
(DAO).
, A ccess ,
, , .
, A ccess .
,
DoCmd .
, " ", ,
, .
:

converted to PDF by HupBaH9I

1.
2.
3.
4.

.
.

.
.

" ".
OpenForm OpenForm DoCmd:
DoCmd.OpenForm "automobile passenger car",,,"key_m odel = 1"
, ,
,
.
DAO ,
.
. , .
:
Public Sub findexp()
* * * ,
* * *
* * *
* * *
* * *
* * * 1000,
* * * WINAPI
* * *
Dim myDb As DATABASE
Dim myRst As Recordset
Dim t1 As Double
Dim t2 As Double
Set myDb = DBEngine.Workspaces(0).Databases(0)
* * *
Set myRst = myDb.OpenRecordset("first", _ dbOpenDynaset)
t1 = Now()
* * *
* * *
m yRst.FindFirst "first like '*'"
t2 = Now()
If Not myRst.NoMatch Then
Debug.Print m yRst!First, myRst!Third
Else
Debug.Print ""
End If
* * *
* * *
Debug.Print DateDiff("s", t1, t2)
End Sub
:
Public Sub findexpFilt()
Dim myDb As DATABASE
Dim myRst As Recordset, NmyRst As Recordset
Dim t1 As Double
Dim t2 As Double
Dim i As Long
Set myDb = DBEngine.Workspaces(0).Databases(0)
Set myRst = myDb.OpenRecordset("first",_ dbOpenDynaset)
m yRst.Filter = "third >> 56700 and third << 58000"
Set NmyRst = myRst.OpenRecordset()
t1 = Now()
NmyRst.FindFirst "first like '*'"

converted to PDF by HupBaH9I

t2 = Now()
If Not NmyRst.NoMatch Then
Debug.Print Nm yRst!First, NmyRst!Third
Else
Debug.Print ""
End If
Debug.Print DateDiff("s", t1, t2)
End Sub

7.2. SQL-
, , ,
SQ L, , , .
:

SQ L
;
, ;
SQ L;
SQ L .

( ),
. , SQ L,
, , A N SI- . , -
,
. , , ,
. ,
, , ,
ANSI SQL.
,
. .
, . - ,
. : Lotus Approach, Microsoft
A ccess, Borland Dbase Paradox .
, .
.
, - . ,
,
.
. ,
. , .
. . ,
, , ?
. , ,
. , ,
, 100000,
. , , -
, , , .
, ,
. ,
, - O LE 2.0. OLE 2.0 OLE
Automation. , , .
DOS. , OLE
Automation .
. ,
. ,
, .
- . .
, , , . ,
. , , .
, , ,
. , ,
,
- . ,

converted to PDF by HupBaH9I

O LE , , . OLE Automation
-
. , .
. ODBC (Open Database
Connectivity), . ,
. ,
SQ L pass-through ,
. ,
SQ L pass-through .
, .
, ,
. , .
.
. , - .
.
SQ L .
ODBC. ,
O LE 2.0. ? .
SQ L .
. ,
, .
, ,
. , . ,
( - ,
), , "
6000 7000 ?", -
, ( ) . ?
. -
. , . 9 0 % ,
.
, , SQ L,
, ,
. ,
, C
Visual Basic SQ L .
SQ L . , FoxPro,
SQ L Paradox, ODBC SQ L p ass
through. , ,
.
, ,
:
S E L E C T m ytable.* FROM mytable
, :
S E L E C T * FROM mytable
, Mytable.
, SQ L,
.
.


Visual FoxPro. SQ L:
1.
2.

3.

Com m and.
, . ,

.
, , -
R elatio n Q u ery B y E xa m p le (RQ BE) - .

converted to PDF by HupBaH9I

RQBE, New File,


- Query. RQBE - ,
,
.
, QPR.
DO. SQL
FoxPro, , RQBE,
, .
,
.
Microsoft Access ,
Visual FoxPro. , ,
. .
SQL
.
Microsoft Access
.
, , , , .
.
Visual Basic Microsoft Jet, ,
Access. , Visual Basic ,
, Microsoft
Access. , DAO - -
Visual Basic, , Access.
, .
, Microsoft SQL Server , SQL,
iSQLW.
. Query Results .
SQL,
Microsoft Excel. ,
,
Excel. Microsoft Query,
Excel
, .
, SQL. - , -
.
, .
SQL, :
SELECT * FROM mytable
Mytable .
Model, ,
. ,
. , :
SELECT name_model, swept_volume, quantity_drum FROM model
,
.
AS . :
SELECT name_model AS , ;
swept_volume AS _, ;
quantity_drum AS _ ;
FROM model
Visual FoxPro Microsoft Access. Microsoft SQL Server
-:
SELECT ''= name_model, :
'_'= swept_volume,;
'_'= quantity_drum ;
FROM model

converted to PDF by HupBaH9I

.
, S E L E C T DISTIN CT:
S E L E C T D ISTIN CT ''= nam e_m odel, :
'_'= sw ept_volum e,;
'_'= quantity_drum ;
FROM model
D ISTIN CT ALL, ,
.
.
"" .
, , ,
.
,
:
S E L E C T nam e_m odel, quantity_drum ,sw ept_volum e FROM model

.
, , ,
. , ,
:
S E L E C T IIF(M O D (R ECN O (),3) = 0,"Y","N"),RECNO (),cost;
FROM "automobile passenger car"

"Y".

. , : ,
, .
.
. , .
, ,
,
.
, - ,
, :
S E L E C T Custom er.nam e_custom er, Country.country_nam e, ;
M odel.nam e_m odel,;
Firm .nam e_firm ;
FROM "auto store!custom er", "auto store!account",;
"auto store!automobile passenger car" A utom obile_passenger_car,;
"auto store!m odel", "auto store!firm ",; "auto store!country";
W HERE Custom er.key_custo m er = A ccount.key_custom er;
AND A utom ob ile_passenger_car.key_auto = Account.key_auto;
AND Model.key_model = ;
A utom ob ile_passenger_car.key_m odel;
AND Firm .key_firm = M odel.key_firm ;
AND Country.key_country = Firm .key_country
:

NAME
_C U ST O M ER

CO UN TRY

NAME
_M O D EL

NAME
_ F IR M

145 1.4

Alfa Romeo

145 1.4

Alfa Romeo

146 1.9

Alfa Romeo

M3 3.0

BMW

converted to PDF by HupBaH9I

740i 4.0 BMW


840Ci 4.0 BMW
840Ci 4.0 BMW

WHERE, .
, , ,
, , ,
. ,
,
.
,
Automobile_passenger_car.key_auto = Account.key_auto
,
Automobile_passenger_car, Account key_auto.
, ,
.
SQL, .
. . :
SELECT model.name_model,firm.name_firm ;
FROM model,firm ;
WHERE model.key_firm = firm.key_firm
, ,
Microsoft Access.
SELECT DISTINCTROW firm .nam e_firm , model.name_model
FROM firm INNER JOIN model ON firm .key_firm = model.key_firm;
FROM :
firm INNER JOIN model ON firm .key_firm = model.key_firm
: Firm Model
key_firm . ,
WHERE? . ,
,
.
Microsoft Jet -
SQL , . ,
, WHERE, Microsoft
Jet SQL JOIN, ,
, ,
, ,
.
, , :
SELECT DISTINCTROW firm .nam e_firm , model.name_model, country.country_name
FROM model INNER JOIN (firm INNER JOIN country ON firm .key_country = country.key_country) ON
model.key_firm = firm .key_firm ;
- - .
(INNER JOIN) ,
, : LEFT JOIN
RIGHT JOIN. ,
,
.
SELECT DISTINCTROW [automobile passenger car].date_issue, account.account

converted to PDF by HupBaH9I

FROM [automobile passenger car] LEFT JOIN account ON [automobile passenger car].k ey_au to =
account.key_auto;
, ,
.
.
:
S E L E C T DISTINCTROW [automobile passenger car].d ate _issu e , account.account
FROM account LEFT JOIN [automobile passenger car] ON account.key_auto = [automobile passenger
c ar].key_au to ;
Microsoft Jet NULL
, .
NULL
. NULL,
, , ,
, .
, , , ,
- .
,
, , ,
W HERE,
, .
,
, :
S E L E C T DISTINCTROW firm .nam e_firm , m odel.nam e_m odel, country.country_nam e
FROM model INNER JOIN (firm INNER JOIN country ON firm .key_country = country.key_country) ON
m odel.key_firm = firm .key_firm
W HERE country.country_nam e="" ;
SQ L AND, OR NOT.
NOT
country.country_nam e = ""
,
, .
S E L E C T DISTINCTROW firm .nam e_firm , m odel.nam e_m odel, country.country_nam e
FROM model INNER JOIN (firm INNER JOIN country ON firm .key_country = country.key_country) ON
m odel.key_firm = firm .key_firm
W HERE NOT country.country_nam e=""
OR.
, :
S E L E C T DISTINCTROW firm .nam e_firm , m odel.nam e_m odel, country.country_nam e
FROM model INNER JOIN (firm INNER JOIN country ON firm .key_country = country.key_country) ON
m odel.key_firm = firm .key_firm
W HERE NOT (country.country_nam e=" " OR country.country_nam e = "")
, NOT
.
- (= ), -
:

>> << >>=


<<=

;
;
- ;
- ;

converted to PDF by HupBaH9I

<<>> - .

, -
, :
SELECT DISTINCTROW firm .nam e_firm , model.name_model, country.country_name
FROM model INNER JOIN (firm INNER JOIN country ON firm .key_country = country.key_country) ON
model.key_firm = firm.key_firm
WHERE country.country_name<<>>"" AND country.country_name <<>> ""
, AND OR,
.
, .
A S C II- . ,
, ""
, :
SELECT DISTINCTROW firm .nam e_firm , model.name_model, country.country_name
FROM model INNER JOIN (firm INNER JOIN country ON firm .key_country = country.key_country) ON
model.key_firm = firm.key_firm
WHERE country.country_nam e>>='W
, WHERE,
, : IN, BETWEEN,
LIKE IS NULL.
IN -
. , ,
. IN
SELECT DISTINCTROW firm .nam e_firm , model.name_model, country.country_name
FROM model INNER JOIN (firm INNER JOIN country ON firm .key_country = country.key_country) ON
model.key_firm = firm.key_firm
WHERE country.country_name NOT IN ("", "");
BETWEEN, ,
, .
,
, , .
SELECT DISTINCTROW firm .nam e_firm , model.name_model, country.country_name
FROM model INNER JOIN (firm INNER JOIN country ON firm .key_country = country.key_country) ON
model.key_firm = firm.key_firm
WHERE country.country_name BETWEEN "" AND ""
,
. ,
WHERE
.
SELECT DISTINCTROW firm .nam e_firm , model.name_model, country.country_name
FROM model INNER JOIN (firm INNER JOIN country ON firm .key_country = country.key_country) ON
model.key_firm = firm.key_firm
WHERE country.country_name NOT IN ("", "") AND (country.country_name BETWEEN
"" AND "")
LIKE .
, "",
:
SELECT DISTINCTROW firm .nam e_firm , model.name_model, country.country_name
FROM model INNER JOIN (firm INNER JOIN country ON firm .key_country = country.key_country) ON
model.key_firm = firm.key_firm
WHERE country.country_name LIKE "*'"

converted to PDF by HupBaH9I

, IS NULL NULL
, .
IS NULL Visual FoxPro Microsoft Access.
IS N U L L (). :
SELECT DISTINCTROW firm .nam e_firm , model.name_model, country.country_name
FROM model INNER JOIN (firm INNER JOIN country ON firm .key_country = country.key_country) ON
model.key_firm = firm.key_firm
WHERE NOT isnull(country.country_name)
- ,
ORDER BY. ,
.
SELECT DISTINCTROW firm .nam e_firm , model.name_model, country.country_name
FROM model INNER JOIN (firm INNER JOIN country ON firm .key_country = country.key_country) ON
model.key_firm = firm.key_firm
WHERE NOT isnull(country.country_name)
ORDER BY firm.name_firm
.
,
DESC, :
ORDER BY firm.name_firm DESC
SQL- , ,
, .
.
. ANSI SQL
:

C O U N T (*) - ;
C O U N T(A LL E x p re s s io n ) - ;
C O U N T (D IS T IN C T E x p re s s io n ) -
Expression ;
M A X (E x p re ssio n ) - ;
M IN (E x p re s sio n ) - ;
S U M (A L L /D IS T IN C T E x p re s s io n ) -
;
A V G (A L L / D IS T IN C T E x p re s s io n ) -
.

Microsoft Access Visual FoxPro, ,


, . .

:
SELECT DISTINCTROW Sum(account.sum) AS Sum _sum , model.name_model
FROM model INNER JOIN (account INNER JOIN [automobile passenger car] ON account.key_auto =
[automobile passenger car].key_auto) ON model.key_model = [automobile passenger car].key_model
GROUP BY model.name_model
:

20500
145 1.4
10500
146 1.9
25000
740i 4.0
60000
840Ci 4.0
37000
M3 3.0

converted to PDF by HupBaH9I

,
GROUP BY. SQL
, .
Microsoft Access. Visual
FoxPro Microsoft SQL Server ,
.

- . , M3 3.0. ,
, WHERE:
WHERE model.name_model = "M3 3.0"
SQL.
:
SELECT DISTINCTROW Sum(account.sum) AS , model.name_model
FROM model INNER JOIN (account INNER JOIN [automobile passenger car] ON account.key_auto =
[automobile passenger car].key_auto) ON model.key_model = [automobile passenger car].key_model
GROUP BY model.name_model
HAVING model.name_model = "M3 3.0"
:

37000
M3 3.0
, , WHERE, ,
, HAVING .
, .

. , ,
.
.
IN, EXIST, SOME, ANY, ALL.
IN. ,
. ,
kto .
SELECT kto, skolko FROM first WHERE kto NOT IN ;
(SELEC T DISTINCT kto FROM second)
EXIST. EXIST - ,
WHERE .
, .
. , 25000
. FoxPro.
SELECT DISTINCT Model.name_model,; Automobile_passenger_car.cost;
FROM "auto store!model",;
"auto store!automobile passenger car" ; Automobile_passenger_car ;
WHERE Model.key_model = ; Automobile_passenger_car.key_model AND ;
Automobile_passenger_car.cost >>=25000 AND Exist ;
(SELEC T * FROM account,;
"auto store!automobile passenger car" Automobile_passenger_car ;
WHERE account.key_auto = ; Automobile_passenger_car.key_auto)
SELECT DISTINCT Model.name_model, ; Automobile_passenger_car.cost ;
FROM "auto store!model",;
"auto store!automobile passenger car" ; Automobile_passenger_car;
WHERE Model.key_model = Automobile_passenger_car.key_model AND ;
Automobile_passenger_car.cost >>=25000 ;
And Automobile_passenger_car.key_auto NOT IN;
(SELEC T DISTINCT account.key_auto FROM account)

converted to PDF by HupBaH9I

, , ,
.
E X IS T Account .
, ,
key_auto.
, . ?
. ,
, . ,
E X IS T . ? .
, ,
,
, .
A utom ob ile_passenger_car.key_auto
.
E X IS T :
S E L E C T M odel.name_m odel, ; A utom obile_passenger_car.cost, ;
A utom o b ile_passen ger_car.key_au to ;
FROM "auto store!m odel",;
"auto store!automobile passenger car" A utom obile_passenger_car;
W HERE M odel.key_model = A utom obile_passenger_car.key_m odel AND ;
A utom ob ile_passenger_car.cost > > = 25000 And Exist ;
(S E L E C T * FROM account W HERE ;
A utom obile_passenger_car. key_auto= account.key_auto)

EX IST .
, ,
.
ANY SOME. ANY SOME
.
:
S E L E C T M odel.name_m odel, A utom obile_passenger_car.cost;
FROM "auto store!m odel",;
"auto store!automobile passenger car" A utom obile_passenger_car;
W HERE M odel.key_model = A utom obile_passenger_car.key_m odel AND ;
A utom obile_passenger_car.cost > > = 25000 And A utom ob ile_passenger_car.key_auto= ;
ANY (S E L E C T D ISTIN CT account.key_auto FROM account);
ALL. ALL
>> << . ALL >> ,
, .
- .
S E L E C T M odel.name_m odel, A utom obile_passenger_car.cost;
FROM "auto store!m odel",;
"auto store!automobile passenger car" A utom obile_passenger_car ;
W HERE M odel.key_model = A utom obile_passenger_car.key_m odel and ;
A utom obile_passenger_car.cost >>= ALL ;
(S E L E C T D ISTIN CT sum m a FROM account ;
W HERE su m m a> > = 30000)



. ,
. SQ L IN S E R T .
.
. ,
. ,
Visual FoxPro 3.0. .
.
Account :

converted to PDF by HupBaH9I

IN SER T INTO account VALUES (1 0 6 ,6 ,1 0 0 0 0 7 ,{1 2 .0 7 .9 6 },.T .,2 6 0 0 0 )


, . , SQ L ,
. , VA LU ES
,
, , .
, , ,
.
IN SER T INTO Account (acco un t,key_cu sto m er,key_auto ,date_w rite)
VA LUES (1 0 6 ,6 ,1 0 0 0 0 7 ,{1 2 .0 7 .9 6 })
,
, , , .
, NULL
0 . , ,
,
.
IN S E R T
. ,
.
IN SER T INTO mytable ( kto, skolko )
S E L E C T DISTINCTROW acm ytable.kto, acm ytable.kto
FROM Acmytable
W HERE (((acm ytable.kto)="cd"))
,
.


, UPDATE,
, .
, .
, .
, .
Microsoft SQ L Server
UPDATE [[database.]owner.]{table_name | view_nam e}
S E T [[[database.]owner.]{table_nam e. | view_nam e.}]
column_name1 = {expression1 | NULL | (select_statem ent)}
[, column_name2 = {expression2 | NULL | (select_statem ent)}...]
[FROM [[database.]owner.]{table_name | view_nam e}
[, [[database.]owner.]{table_nam e | v/ew _n a m e }]...]
[W HERE search_conditions]
,
. ,
FROM. ,
UPDATE Account S E T su m m a= sum m a*1.25
FROM Account, sale
W HERE Account.account=Sale.account AND S a le .d a te _ sa le > > {1 0 .0 1 .9 6 }
Microsoft A ccess, FROM,

.
UPDATE DISTINCTROW account
INNER JOIN sale ON account.account = sale.account
S E T account.sum m a = su m m a*1.25

converted to PDF by HupBaH9I

W HERE (((sa le .su m m a )> > 2 0 0 0 0 ));

Visual FoxPro W HERE


.
UPDATE Account ;
S E T Su m m a= su m m a*1 .2 5
W HERE Account.account=sale.account AND A ccount.date_sale


.
. ,
.
D ELETE FROM Account W HERE Account.key_auto = 100008
, , .

7.3. SQL
SQ L
,
.
:

;
;
.

Data Definition Language (DDL) - SQ L, ,


. . ,
,
, SQ L.
SQ L .
.
SQ L
,
, -,
-.
,
Visual FoxPro Microsoft A ccess.
, . - ,
, -
. . SQ L Data Definition
Language A ccess FoxPro.
, -
SQ L pass-through,
SQ L .
C R EA TE T A B L E . :
1.

Visual FoxPro
CREATE TABLE | DBF TableName1 [NAME LongTableName] [FREE]
(FieldName1 FieldType [(nFieldWidth [, nPrecision])]
[NULL | NOT NULL]
[CH ECK lExpression1 [ERRO R cMessageText1]]
[DEFAULT eExpression1]
[PRIMARY KEY | UNIQUE]
[R EFER EN C ES TableName2 [TAG TagName1]]
[NOCPTRANS]
[, FieldName2 ... ]

converted to PDF by HupBaH9I

[, 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
2.

MS Access
CREATE TABLE
(1 [()] [1] [, 2 [()]
[2] [, ...] ] [, _ [, ...] ] )

3.

MS SQL Server
CREATE TABLE [[database.]owner.]table_name
(column_name datatype [NOT NULL | NULL]
[, column_name datatype [NOT NULL | N U LL]]...)
[ON segm ent_nam e ]

, ,
,
. C R EA TE T A B L E ,
.
SQL Microsoft Access Microsoft SQL Server, Visual FoxPro
. ,
Access, MS SQL Server.
.
ALTER TABLE. ,
, .
, A L T E R T A B LE
, , , , ,
. ODBC (
). , , ,
, Visual FoxPro, () ,
MS SQL Server.
Visual FoxPro:
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]

ALTER TABLE TableName1


ALTER [COLUMN] FieldName2
[NULL | NOT NULL]
[S ET DEFAULT eExpression2]
[S ET CHECK lExpression2 [ERROR cMessageText2]]
[DROP DEFAULT]
[DROP CHECK]

ALTER TABLE TableName1


[DROP [COLUMN] FieldName3]
[S ET CHECK lExpression3 [ERROR cMessageText3]]
[DROP CHECK]
[ADD PRIMARY KEY eExpression3 TAG TagName2]
[DROP PRIMARY KEY]
[ADD UNIQUE eExpression4 [TAG TagName3]]
[DROP UNIQUE TAG TagName4]

converted to PDF by HupBaH9I

[ADD FOREIGN KEY [eExpression5] TAG TagName4


REFERENCES TableName2 [TAG TagName5]]
[DROP FOREIGN KEY TAG TagName6 [SAVE]]
[RENAME COLUMN FieldName4 TO FieldName5 ]
[NOVALIDATE]
Microsoft Access:
ALTER TABLE {ADD {COLUMN [()] [CONSTRAINT ] I
CONSTRAINT _} |
DROP {COLUMN I CONSTRAINT _} }
, MS SQL Server :
ALTER TABLE [[database.]owner.]table_name ADD column_name datatype NULL [, column_name
datatype NULL... ]
SQL, .
, , .
SQL 6
.

7.4. Microsoft
Visual FoxPro

Visual FoxPro.
xBase SQL, , FoxPro 2.0,
, , .
, ,
Rushmore SQL . ,
. , ,
IN S E R T -S Q L ,
APPEND BLANK
REPLACE <<>> WITH <<>>
, SQL :

S ELE C T -S Q L
IN S E R T -S Q L
C R EA TE T A B LE

, , ,
, , ,
. ,
S E L E C T .
- R E C N O (),
S E LE C T -S Q L .
-
. R EC N O ()
.
,
SQL .
Visual FoxPro SQL,
, .
, - (View),
. .
,
. ,
, . ,
, . , ,
,
. . Visual
FoxPro ,

. , ,
.

converted to PDF by HupBaH9I

, .
.
Project Manager,
, Local Views
New. ,
. -
, .
New ,
Local View.
,
,
,
.
, , ,
, Add Table,
. 7.1.

' Add T ab le or View


D atabase
| Auto Store

OK

Ta b les in D atabase:
C ancel

account
automobile passenger car

Other..

body
country______________________
customer

S e le ct

firm

(*

Tab les

fuel_oil

V iew s

model
mytable
sale
tyre

. 7 .1 .
. , ,
,
. ,
, ,
(. 7.2). , , ,
,
.

converted to PDF by HupBaH9I

- V p f!w D b W e r i i f .(:n ittit 11i r.n I _ -jifiw

Jk.

Ir

ar.g tu jn f
k e y _ t u : iGrtiel

kflJ_CUI*taflief
rw m t1 tu s titn c r

-_(0

tel

dafe_wnle
:dlcd

S-eJeciion Criteria j

Fiefds

TabJe:

Older by

.8 Field Njfue

IjC W n w

D l

<J

sddieji

UpdateAt
" '

ISO

Llpda*e Ci^ei^a j

SQL WHERE clause includes.


f Key FieJdj Only
Kej and UpffaUtto Field!
Kej and Modified Fields
f* Rqt andjitiwtlaiiip

nanrre_cuntomer

Re-iEt

by

Update using'
SQL DELETE ihen INSERT
<*SOL UPDATE

. 7 .2 .
, Selection
Criteria, Fields, Order By, Group By Update Criteria (. 7.3). ,
. ,
-
.
V lfiW

D i I

?f

uni _ I D C

| *i
w u n l
k u L C V D lw w r

d s i e rtii-'e
. -_ j
: SKu

lL L

SebdfenCriteria

Fitfck

Gby

fct'-i-jv.uetauii!
nF;jsnSwwr
_

zi

i |

Gmety

) LIpdatBUbH

SabdaiOUDt*

Aeau*lr(y_mirtMi

4 o C .ip k ,V i:

[ffl [[

J
. 7 .3 .

Selection Criteria
. WHERE.
SQL, .
,
Query, View Designer SQL
. , , ,
SELECT (. 7 .4 ). , ,
, - C R EA TE
SQ L V IE W . .

converted to PDF by HupBaH9I

Fields ,
. , ,
, ,
Selected Output,
Fields Selection Criteria. . ,
, , , ,
Functions/Expressions.
, AS.
SQL , , SELE C T SQ L ORDER BY,
. Order by .
Group by
.
Update Criteria.
,
. Field Name ,
.
, ,
Table (. . 7.2).
. ,
, Field Name, ,
, .
. .
, Reset.
, Update All. ,
, .
SendUpdates, .
SQL WHERE clause includes
WhereType. ,
:

Key Fields only


. ,
,
.
Key And Updatable Fields ,
.
Key And Modified Fields
.
Key and Timestamp .

converted to PDF by HupBaH9I

,
: .
, .
WhereType UpdateType Visual FoxPro,
Options Remote Data.
, SQL Updates, - Criteria Method,
. 7.5.

V Options
File Locations

Forms

Projects

Cortrols

View

General

Edit

Data

ln:erna:iGnal
|

Remote Data

-Remote V iew Defaults-------------

" Sh ars Connection


17 Fetch Memo

Records to Fetch at a Time:

poo"

MaHimuin Records to Fetch:

Use M em o for F ie d s

| 5

R t u u id i tu E d lu h U p d a te .

p~~~

SQ L Updates:
Criteria: | K eu and M o d ried Fi
M e t h o d :^ L Update

jjJ

~n

-C on neclion f e f a u t f f

I Asijnnhrr nnus

- yen jl nn

D isplaiA/arnings

E a tc T Pr K e s s n g

C onn ection "im eoLit (sec):

Show Lo^in:

Se : as Defa Jt

Qcer}) Timeout (sec):

F
F

W ait Time (ms):

foo"

Idle Tinreout (min)

Automati| ; Trarsactim
Only W h e l N=

OK

F- 3

Cancel

"U

Help

----------
Lb date Type

WheneType

. 7 .5 .
,
C R EA TE SQ L V IE W . , ,
D B S E T P R O P ()
C U R S O R S E T P R O P ().
: D B G E T P R O P () C U R S O R G E T P R O P (). ,
C U R S O R G E T P R O P () C U R S O R S E T P R O P () ,
- . D B G E T P R O P ()
D B S E T P R O P () ,
. . 7.1 ,
. , .
7.1, . D b S E T P R O P ()
D B G E T P R O P () " F IE L D " . :
DBSETPROP("account_and_customer.account",''FIELDY'com ment",; "
")

converted to PDF by HupBaH9I

,
"account_and_customer.account". Visual FoxPro .
7 .1


Caption
C .
.
Comment
.
.
DataType

.
-

.
Default value
.
.
KeyField
L .T .,,

.


Update Criteria.
.
RuleExpression C
.
.
RuleText
C ,

.
.
Updatable
L (.T .) ,,
.



Update Criteria.
.
UpdateName
C ,
,

.

.
.
,
, .
D B G E T P R O P () D B S E T P R O P () VIEW.
Comment ,
:
= DBSETPROP("account_and_customer","view", "Comment",
" ")
? DBGETPROP("account_and_customer","view", "Comment")
7 .2 .


Comment
C .
.
FetchMemo
L .T .,
General
.

converted to PDF by HupBaH9I

MaxRecords

RuleExpression

RuleText

SendUpdates

SourceType

SQL

Tables

UpdateType

WhereType

.F.

.
.T .. .
,
.
1, .
0,
.
.

. .
,
.
.
.T .,
.
.
1,
. 2,
.
.
,
.
.
,

.
1,
, 2 -
, .
.
,

.
1 - .
DB_KEY Foxpro.h
2 - ,
.
DB_KEYANDUPDATABLE Foxpro.h
3 - .
DB_KEYANDMODIFIED Foxpro.h
4 -
.
TIMESTAMP,
.


C U R S O R S E T P R O P (). , , C U R S O R G E T P R O P ()
. ,
, .
, . ,
.
D B S E T P R O P (), C U R S O R S E T P R O P (). ,
, Database,
, ,
.
, . ,

C U R S O R G E T P R O P () :
USE Account_and_customer
If LEN(ALLT(CURSORGETPROP("keyfieldlist"))) = 0
=CURSORSETPROP("keyfieldlist",;

converted to PDF by HupBaH9I

"account.account,custom er.nam e_custom er")


ENDIF
,
, ,
, .
:
U SE A ccount_and_custom er
IF LEN (ALLT(CURSORGETPROP("keyfieldlist")))=0
=CURSORSETPROP("keyfieldlist",;
"account,nam e_custom er")
ELS E
IF LEN(ALLT(CURSORGETPROP("updatablefieldlist")=0
=CURSORSETPROP("updatablefieldlist",;
"key_custom er,selled,sum m a,;
nam e_custom er,address")
ENDIF
ENDIF
, Updatenam eList,
.
SendUpdates.
:
U SE A ccount_and_custom er
IF LEN (A LLT(CU RS0RG ETPR0P("keyfieldlist")))=0
=CURSORSETPROP("keyfieldlist",;
"account,nam e_custom er")
ELS E
IF LEN (ALLT(CURS0RGETPR0P("updatablefieldlist")=0
=CURSORSETPROP("updatablefieldlist",;
"key_custom er,selled,sum m a,;
nam e_custom er,address")
=CURSORSETPROP("updatenam elist",;
"key_custom er account.key_custom er,;
selled account.selled,sum m a account.sum m a,;
n am e_custom er custom er.nam e_custom er,;
address custom er.address" )
ENDIF
ENDIF
=CURSO RSETPRO P("SendUpdates",.T.)
c
: Account Custom er. C D B S E T P R O P ()
,
.
IF NOT DBUSED("auto_store")
OPEN DATABASE "auto store"
ENDIF
CREATE SQ L VIEW A ccount_and_custom er ;
A S S E L E C T A cco unt.*, C u stom er.nam e_custom er, ; Custom er.address;
FROM "auto storelaccount", "auto storelcustom er";
W HERE Custo m er.key_custom er = Account.key_custom er;
AND Account.selled = .f.
= DBSETPRO P("account_and_custom er.account",;
"FIELD","KeyField",.T.)
= D BSETPRO P("account_and_custom er.nam e_custom er",;
"FIELD","KeyField",.T.)
= D BSETPRO P("account_and_custom er.date_w rite",;
"FIELD","Updatable",.T.)
= DBSETPRO P("account_and_custom er.selled",;
"FIELD","Updatable",.T.)
= D BSETPRO P("account_and_custom er.sum m a",;
"FIELD","Updatable",.T.)

converted to PDF by HupBaH9I

= DBSETPROP("account_and_customer.address",;
"FIELD","Updatable",.T.)
USE Account_and_customer
=CURSORSETPROP("SendUpdates",.T.)
=CURSORSETPROP("WhereType",3)
GO 3
REPLACE selled WITH .T.
SKIP -1
SELECT Account
BROWSE
Visual FoxPro ,
Buffering. C U R S O R S E T P R O P ()
C U R S O R G E T P R O P ().
Buffering :
1.
2.

3.

4.

5.

- - .
- .
. , ,
.

T A B L E U P D A T E ().
- . ,
.
.
- . ,
.
T A B L E U P D A T E () .
- .
.
T A B L E U P D A T E (), .

7.5. Microsoft Access


Access.

DAO.
, , Access.
, ,
, . ,
, .
, ,
. .
Access . . ,
, Access
. SQL
, . SQL
.
" ".
, .
, ,
SQL.
-
(DAO). QueryDef, SQL
.
-
DoCmd.RunSQL. ,
, ,
. ,
Recordset. ,
(Update, Delete, Insert),
. ,
, ,

converted to PDF by HupBaH9I

. .

:
1.
2.
3.
4.

.
.
.
, , ,
.

1.

2.

. , Access
, . ,
, ,
.
3 4 .

. ,
, ,
, . 7.6.
. ,
.
. .!

. !i_i!.:____

; ;-[jj

'
. 7 .6 .
, ,
. ,
.
: , .
, , ,
, , (. 7.7).

converted to PDF by HupBaH9I

|ipl

ip ]

I !

Mil QD1
MyT able
T a b le l

. 7 .7 .
Visual FoxPro, .
,
. .
,
. ,
. ,
,
. .
:
1.
2.
3.
4.


.
.
.
, .7.8.
|

eaa~i :: L*. ^ 11 34 1

1
*
fcrv a in
iH f .n ic
. |
4
1

<

2

I vs.n - 1 * '
XCOLTti

'I.C-5H hep.cuttaaet

--------------------

uftid

A
1

. 7 .8 .
. , ,
, . ,
, .
, - .
.
, , ,
. ,
, .
, ,

converted to PDF by HupBaH9I

.
, ,
, .
, .
. ,
" " "", OR.
AND,
,
, " ", . 7.9.
Q C C B e a q u a iy tc n c c n u n l:

:#
-ipqWn
ijfiflcwe :
IW

-*
account
>101

if(c uita
*
Bcof-fcf

<

2J

. 7 .9 . AND. ,
AND, Account
, . 7.3, SQL
. ,
.
, .
, " ".

, , .
:
. ,
, Access,
. - ,
, WHERE,
, , HAVING.
7 .3 . MS Access

Avg()
Count()


First()
Last()

Min()

Max()

Sum ()

StD ev()

StDevP()

Var()

VarP()

.
, ,
"". . 7.10

converted to PDF by HupBaH9I

. , ,
, HAVING.

1 : ()

kei> customer ^ 1
key_auto
date write
selled
summa

AJ

:
:
:

account
account

: Sum ffsum m all/Cc

:
:
:
:

. 7 .1 0 .
,
,
.
, . 7.11. ,
, Access
.

Custpar

. 7 .1 1 .
. 7.12 ,
IKNOWWHATIWANTIWANTITNOW ,
. , ,

Forms! [IknowwhatIwantIwantitnow]. [account]
, ,
. SKOLKO
,
- , .

converted to PDF by HupBaH9I

( )

acccuni
hieyjcuslomei

kej^aula
daiej.-viile ^
1

acrajnl

- account
-1

[Fm f} |1&/1|wariHwanfllfNowJ |aocoiirt|

. 7 .1 2 . ,

SQL. , , ,
- .
, , .
SQ L , , ,
, .
,
. .
, ,
, , .


- , IN SERT.
, , Microsoft Access.
S E L E C T ,
:
IN SER T INTO [IN ___]
[(1[,2[, ...]])]
S E L E C T [.]1[,2[, ...]]
FROM
SQ L ,
,
.
. . SQ L
:
IN SER T INTO Account ( account ) VALUES (109)
SQ L
:
IN SER T INTO Account ( account )
S E L E C T 109 AS 1;
-
Account, Account 109.
,
, .
, ,
, . 7.13.

converted to PDF by HupBaH9I

[acco u n t

~3

(* iB ;
"

:
: |~

'

'

. 7 .1 3 .
, , ,

.
.
, ,
, . 7.14.
1? 2

............[ - 1 1 ( | 1 1 ' 1 1 '

233

__

Ltt-
1'

*
4 1


. 7 .1 4 .

-
,
. ,
, .
,
:
...INTO << >>
, ,
.


,
. .
- ,
, .
, "".
"". ,
, , ,
,

converted to PDF by HupBaH9I

. ,
(. 7.15).

^ account
.

kcY tufiomei

d'jUL'LHV

__

art
.

Y
1

JiU
. 7 .1 5 .


, ,
, , ,
.
, -
. ,
.


, .
,
, ,
-
.
account,
key_customer summa.
:
a cco u n t k e y _ c u s to m e r
101
1
102
2
103
3
104
4
104
4
105
5
105
5
106
6
106
6

sum m a
10000
12300
13000
24000
31000
34000
36000
24000
28000

. ,
, .
.
,
"", "", ""
.
, Access

converted to PDF by HupBaH9I

. .
, account "",
" " " " " ",
, ,
" " "". , .
7.16, " ".
f 1

Ir ir iiN N

- #

!* -***

crpnfa.

CqfUVfXW*

m i

urtSof

+VW

J_L

. 7 .1 6 .
key_customer "/
". summa ,
S U M (),
(. . 7.16).
.
A cco u n t

101

10000

102
103
104
105
106

12300
13000
55000
70000
52000

. TRANSFORM PIVOT
SQL.
Access.
TRANSFORM SUM(Account.summa) AS Sum_summa
SELECT Account.account
FROM Account
GROUP BY Account.account
PIVOT Account.key_customer;
, ,
SQL. ,
. SQL, .
,
. :
SELECt first,second
FROM tableone
UNION
SELECT first,second
FROM tabletwo
(
),
UNION ,

converted to PDF by HupBaH9I

.
(, second Long):
SELECT first,second
From tableone
UNION
SELECT first,0
FROM tabletwo
, .
- ( Pass-Through)
8.
SQL , DDL
SQL.
Jet SQL , ,
.
SQL .
, Access ,
, Visual Basic Visual C++,
(DAO).
:
Dim db As Database, qd AS QueryDef, mySQL As String
Set db = DBEngine.Workspaces(0).Databases(0)
mySQL = "SELECT * FROM Account WHERE account=102"
Set qd =db.CreateQueryDef("Mywritebyhandquery",mySQL)
,
, . DAO
SQL .
CreateQueryDef - SQL.
,
QueryDefs. SQL QueryDef,
, . .
QueryDef.
SQL,
, , ,
.
Dim db As DATABASE, qd As QueryDef, mySQL As String
Set db = DBEngine.Workspaces(0).Databases(0)
Set qd = db.QueryDefs("Simplequery")
qd.SQL = "SELECT * FROM account WHERE date_write >>_
" _ & "#01/06/96#"
MsgBox(Str(qd. LastUpdated))

CreateQueryDef, .
FROMQUERY.
Dim db As DATABASE, qd As QueryDef, mySQL As String
Set db = DBEngine.Workspaces(0).Databases(0)
Set qd = db.CreateQueryDef("DLquery", _
"CREATE TABLE _ fromquery (mama T EX T(20), _
slava LONG)")
qd.Execute
, Access,
RunSQL RunSQL DoCmd. . 7.4
, RunSQL
RunSQL. RunSQL.
7 .4 . , RunSQL

converted to PDF by HupBaH9I


SQ L


IN SERT INTO

DELETE

SELECT...IN TO

UPDATE
( SQ L)

CREATE TABLE

ALTER TABLE

DROP TABLE

CREATE INDEX

DROP INDEX
RunSQL :
DoCmd.RunSQL SQL
SQL - , SQL .
. - 32768
.
" ",
:

txtField1.
txtField2.
cmbInsert3.

Click , , ,
txtField1 txtField2, " ":
Sub cm bInsert3_Click()
Dim SQLstr As String, SQLstr1 As String
SQLstr = "INSERT INTO [ ] (, ) "
SQLstr1 = "VALUES ([txtField1],[txtField2])"
DoCmd.RunSQL SQLstr & SQLstr1
End Sub
, ,
. ,
,
. , ,

,
.
, SQL -
,
. Visual FoxPro Access SQL,
? SQL,
. , Delphi Visual
Basic, SQL.
SQL Visual Basic, , ,
. Visual Basic DAO
. , QueryDef .
, . Visual Basic, 4.0,
, , - RDO,
.
SQL ,
.

7.6.

converted to PDF by HupBaH9I

,
.
, , ,
, , , ,
, , , , .
-
. - , ,
, , , , .

,
.
,
.

Visual FoxPro
, .
. , ,
,
, . ,
- , , ,
.
Visual FoxPro
, , ,
. Visual FoxPro
.
,
. .
, .
, - , , .
S E T E X C L U S IV E ON
. ,
S E T ( ) EXCLUSIVE :
? SET("EXCLUSIVE")

,
U SE , . ,
,
:
USE myfile EXCLUSIVE

, .
, .
,
. :
.

, Visual FoxPro ,
. ,
. , ,
, .
.
, ,
.
. 7.5 , ,
, .

converted to PDF by HupBaH9I

7 .5 . , Visual FoxPro


ALTER TABLE
APPEND
APPEND BLANK
APPEND FROM
APPEND FROM
ARRAY
APPEND MEMO
BLANK
BROWSE, CHANGE,
EDIT




,

CURSORSETPROP()
DELETE

DELETE NEXT 1

DELETE RECORD < < >
>
DELETE <<
>>
DELETE-SQL

GATHER

INSERT

INSERT-SQL

MODIFY MEMO

READ
,

RECALL

RECALL NEXT 1

RECALL RECORD < < >
>
RECALL

<< >>
REPLACE
,

REPLACE NEXT 1 ,

REPLACE RECORD < < > ,
>


REPLACE
<< >>
SHOW GETS
,

TABLEUPDATE()

UPDATE

UPDATE-SQL

. Visual FoxPro
F L O C K (). S E T E X C L U S IV E ON,
, F L O C K ()
, .
, , . F L O C K ()
.T ., .
,
, .
: F L O C K ('1 ') F L O C K ('A c co u n t').
. R L O C K () L O C K () .T .,

converted to PDF by HupBaH9I

.
,
.
. -
. :
OPEN DATABASE "auto_store"
S E T R EP RO CESS TO 3 AUTOMATIC
STO RE '1,2,3,4' TO cRecList
cO ldExcl= SET("EXCLU SIV E")
S E T EX CLU SIV E OFF
U SE model
?LOCK(cReclist,'m odel')
UNLOCK IN model
S E T EX CLU SIV E &cRecList
. ,
. :
, ,
.
Visual FoxPro .
.
, Visual
FoxPro , ,
, .
,
. ,
,
T A B L E U P D A T E ( ).
t A b L E U P D A t E ( ) .
C U R S O R S E T P R O P ( ) .
C U R S O R S E T P R O P ( ) , .
, , ,
. :
.

.

, .
- ,
,
,
. , Visual
FoxPro .

C U R S O R S E T P R O P () :
= CURSORSETPROP("Buffering",2)
Visual FoxPro , .
, Visual FoxPro
.
T A B L E U P D A T E ( ), Visual FoxPro .

C U R S O R S E T P R O P () :
= CURSORSETPROP("Buffering",3)
T A B L E U P D A T E ( ), Visual
FoxPro . , Visual FoxPro
.
, , ,
Visual FoxPro .

converted to PDF by HupBaH9I

,
C U R S O R S E T P R O P () :
= CURSORSETPROP("Buffering",4)
Visual FoxPro , .
Visual FoxPro
. ,
, . , T A B L E U P D A T E (),
.
,
" ", ,
. Visual FoxPro
.
.
, Grid.
BufferMode 1 (pessim istic), DataSession 2
(private data session), . 7.17.

Properties - form_buffer_scx
Object:

Forml

All

D ata

M ethods

Layout

Other

x ^
Box

[Default]

BufferM ode

1 - Pessimistic

Caption

Forml

Circle

[Default]

Class

F o rm

ClassLibrary
Click E ven t

[Default]

ClipControls

.T . - True (Default)

Closable

.T . - True (Default)

CIs

[Default]

Comment
ControlBox

.T . - True (Default)

ControlCount

Controls

Current*!

CurrentY

D ataSe ssio n

2 - Private Data Session

O ccu rs w hen a Form Set, Form, or P a g e object becom es


active or when a ToolBar object is shown.

. 7 .1 7 .

:
DO FORM justmadeformforbufferingvalidate NAME f1
,
DO FORM justmadeformforbufferingvalidate NAME f2

converted to PDF by HupBaH9I

View Window CurrentSession ,


, ,
. ,
, , . View Window,
, ,
, ,
Grid. Properties, ,
(. 7 .18).

W ork A re a Properties
Data Buffering Options----

OK

Enable Data Buffering

'Lock Records

(*

When Edited

When Written

"Buffer

Cancel

Current Record

Modify...

All Edited Records

Data Filter

Index Order

<no order>

rAllow Access to

(*

AJI Fields in the work area

Only fields specified by 'Field Filter'

Field Filter...

c: \project_book\larisa. dbf

. 7 .1 8 .
, , ,
- . , ,

, .
, T A B L E U P D A T E () ,
, , .

:
= CURSORSETPROP("Buffering",5)
Visual FoxPro
, T A B L E U P D A T E (). Visual FoxPro
:
1.
2.
3.
4.

.

.
, .
, .

R E C N O ().
. ,
,
.
. . 7.6 ,
.
7 .6 .

converted to PDF by HupBaH9I

12

45

-1

-2

, , ,
T A B L E R E V E R T ( ) , ,
.T. , .F. - .
T A B L E R E V E R T ( ) , T A B L E U P D A T E ( ) , ,
, .
T A B L E U P D A T E ()
T A B L E R E V E R T ( ) . .
, .
:
TABLEUPDATE([lAllRows] [ ,/Force]] [, cTableAlias
| nWorkArea])
lAl/Rows .T. .F.. .T.
,
,
.
lForce, , ,
. T A B L E U P D A T E ()
lForce, .F ., Visual FoxPro , ,
. ,
. , T A B L E U P D A T E () ,
.T ., , ,
.
, cTableAlias
nWorkArea . ,
, .
T A B L E R E V E R T ( ) T A B L E U P D A T E () .
TA BLEREVERT([lAllRow s] [, cTableAlias | nWorkArea])
lAllRows .T ., ,
.F ., .
,
,
.
O L D V A L (), C U R V A L ( ), G E T N E X T M O D IF IE D ( ) , G E T F L D S T A T E ( ).
O L D V A L () :

OLDVAL(cExpression [, cTableAlias | nWorkArea])


O L D V A L ()
. ,
, .
,
, T A B L E U P D A T E () ,
- , ,
.
, O L D V A L (),
cExpression. :
OPEN DATABASE auto_store
USE account
=CURSORSETPROP("Buffering",5)
GO 3

converted to PDF by HupBaH9I

REPLACE account WITH 203


?OLDVAL("account")
* * * 103
=TABLEUPDATE(.t.)
?OLDVAL("account")
* * * 203
C U R V A L () :
CURVAL(cExpression [, cTableAlias | nWorkArea])
C U R V A L ()
.
, C U R V A L () O L D V A L (), ,
, ,
. , C U R V A L () O L D V A L ()
.
C U R V A L () ,
cExpression.

JUSTMADE FO RM FO RBU FFERIN GVALI DATE. TextBox,
, . AfterRowColChange Grid1
:
LPARAMETERS nColIndex
TH isForm .Text1.Value =;
OLDVAL(ThisForm .Grid1.Colum ns(nColIndex).ControlSource)
TH isForm .Text2.Value =;
CURVAL(ThisForm .Grid1.Colum ns(nColIndex).ControlSource)
( , , )
:
=TABLEUPDATE(.F.)
ThisForm .G rid1.SetFocus
,
:
= TA BLER EV ER T(.F.)
ThisForm .G rid1.SetFocus
, ,
BufferMode Optimistic,
. , ,
.
. 7.19 , RRR
Greece Israel, Cyprus.

converted to PDF by HupBaH9I

rl

w
Curvodj

p MvaIQ
|l ! L I I M :

. ' Forml

_pidv[g_
Greece

Sit

H lfill

T tt
O rfd

w
oldvotQ
I brail

EUTVffl J

Hit

D ltd

anAnM
lemon
omnqB

Soldi I
S

100j

B ra il

11|

ran g e

C y |i iu s

45j

111.1

33

mu

Biaril

P a iu m i

14

..

T tt L i

. 7 .1 9 .

Israel ,
, O L D V A L () C U R V A L ().
G E T F L D S T A T E ( ) , ,
, ,
.
, G E T F L D S T A T E ( )
. :

GETFLDSTATE(cFieldName | nFieldNumber [, cTableAlias | nWorkArea])


, G E T F L D S T A T E ( ) ,
. , , R E C A L L ,
G E T F L D S T A T E () , ,
. D E L E T E D ( )
.
G E T F L D S T A T E ( ) . ,
, . 7.7.
7 .7 .

G E T N E X T M O D IF IE D ()
:

GETNEXTMODIFIED(nRecordNumber [, cTableAlias | nWorkArea])


nRecordNumber ,
, .
G E T N E X T M O D IF IE D () 0,
, . ,
( )

converted to PDF by HupBaH9I

.
- ,
, T A B L E U P D A T E (),
, , , ,
T A B L E U P D A T E () , .T. (= T A B L E U P D A T E ( .T .) ) .
O L D V A L () C U R V A L (). C U R V A L ()
, O L D V A L () - ,
.

JUSTMADE FO RM FO RBU FFERVALIDATING. , , "-
" . Click ""
:
GO GETN EXTM ODIFIED(0)
k= TABLEU PD ATE(.F.)
IF k = .F.
This.Parent.Com m and3.Enabled = .T.
ENDIF
ThisForm .G rid1.SetFocus
Click "- " :
=TA BLEU PD A TE(.F.,.T.)
This.Enabled= .F.
ThisForm .G rid1.SetFocus
Click "" :
= TA BLER EV ER T(.F.)
ThisForm .Com m and3.Enabled = .F.
ThisForm .G rid1.SetFocus
, .
,
"" .
, C U R V A L () O L D V A L () ,
. , k .F .,
"- " Text1 Text2
, O L D V A L () C U R V A L ().
.
, ,
, ,
O L D V A L ().

Visual FoxPro , :

, ;
;
.

.
, . ,
, .
Visual FoxPro , :

B E G IN T R A N S A C T IO N - .
R O L L B A C K - ,
B E G IN T R A N S A C T IO N .

converted to PDF by HupBaH9I

EN D T R A N S A C T IO N - , ,
B E G IN T R A N S A C T IO N , .

, CDX ,
, .
, .
.
. , .
,
. ,
, -
.
.

.
.
, .
, ,
( ) ,
.
,
, .
"Record not available<193>Please Wait" (" . , "),
.
,
.
END T R A N S A C T IO N , ,
CDX , . ,
B E G IN T R A N S A C T IO N EN D T R A N S A C T IO N ,
.
( ), .
, EN D T R A N S A C T IO N
.
, .
, EN D T R A N S A C T IO N
. EN D T R A N S A C T IO N ,
, .
, B E G IN
T R A N S A C T IO N , R O L L B A C K .
, .
,
, T X N L E V E L ( ) .
:
OPEN DATA auto_store
USE Model
BEGIN TRANSACTION
??TXN LEVEL
* * * * 1,
* * * * *
BEGIN TRANSACTION
?? TXN LEVEL
* * * * 2,
* * * * *
END TRANSACTION
END TRANSACTION
.

B E G IN T R A N S A C T IO N .
EN D T R A N S A C T IO N R O L L B A C K
B E G IN T R A N S A C T IO N , .
, EN D T R A N S A C T IO N
R O L L B A C K . .
EN D T R A N S A C T IO N ,
RO LLB A C K.

converted to PDF by HupBaH9I

, ,
, .

IN D E X .
, .


F L O C K () R L O C K ( ) , . END
T R A N S A C T IO N .
R O L L B A C K EN D T R A N S A C T IO N
, B E G IN T R A N S A C T IO N .
,
, EN D T R A N S A C T IO N .
,
, , ,
. :
USE Account
BEGIN TRANSACTION
BEGIN TRANSACTION
REPLACE count WITH 103 FOR count=203
END TRANSACTION
REPLACE count WITH 203 FOR count 103
END TRANSACTION
203.
, R E P L A C E
:
USE Account
BEGIN TRANSACTION
REPLACE count WITH 203 FOR count 103
BEGIN TRANSACTION
REPLACE count WITH 103 FOR count=203
END TRANSACTION
END TRANSACTION
, - 103.


Microsoft Visual FoxPro
RAM,
,
RAM . RAM
.
, EDITW ORK, SORTW ORK,
PROGWORK TM PFILES CONFIG.FPW .
, ,
, .
, .
- ,
, .
,
, ,
, .
.

Microsoft Access
Access
. .

converted to PDF by HupBaH9I

, . 7 .2 0,
. , " ",
.

- -----

(* ;

- -

(*

O LE /D DE ():

[30

[2

O DBC ():

11500

- D D E --------------------

~ DDE
DDE

():

G0

(): 1250

11

. 7 .2 0 .
""
.
, ,
, . , :
. :
, -
. ,
: ,
, .
"" .
,
, , , Access
. Access
2 . "".
.
,
, RecordLocks,
Access.
,
.
RecordLocks .
, ,
.

. ,
. ,
,
.

converted to PDF by HupBaH9I

,
Application .
SetOption Application
( ), GetOption
M S G B O X () .
Public Sub mygetoption()
Dim m ystr As String
Application.SetOption " ", 2
m ystr = Application.GetOption(" _ ")
MsgBox (m ystr)
End Sub
, RecordLocks, ,

. , ,
,
. Recordlocks :
Public Sub myqueryproperties()
Dim db As DATABASE, qd As QueryDef
Set db = D BEngine.W orkspaces(0).D atabases(0)
db.QueryDefs(" query").Properties("recordLocks") = 2
End Sub
RecordLocks :
Public Sub ActiveFormRecordLocksChange
Screen.ActiveForm .RecordLocks = 2
End Sub
, , , ,
, , .

:
1.

2.
3.

, :
ActiveFormRecordLoc1ksChange, ,
-.
, RunCode,
, , , fActiveFormLocksChange.
,
.

,
,
RecordLocks 2,
. ,
, .
, .
, , ,
, BeginTrans, Com m itTrans RollBack Workspace.
BeginTrans . ,
. -
, , ,
. ,
,
.
Com m itTrans.
, , ,
, . -
Com m itTrans,
.
A ccess, Visual FoxPro,
. . Com m itTrans
W orkspaces . , ,

converted to PDF by HupBaH9I

.

.
: .
Sub ForceTrans()
Dim db As DATABASE, wks As W orkspace, rst As _ Recordset
Dim otvet As Integer
Set wks = DBEngine.W orkspaces(0)
Set db = w ks.D atabases(0)
Set rst = db.OpenRecordset(" ", _ dbOpenDynaset)
wks.BeginTrans
wks.BeginTrans
rst.M oveLast
rst.AbsolutePosition = 2
rst. Edit
rst. = ""
rst.UPDATE
wks.Com m itTrans
otvet = MsgBox("", vbYesNo + _ vbDefaultButton1, " ")
If otvet = vbYes Then
wks.Com m itTrans
Else
wks.Rollback
End If
End Sub
Access .
.
W orkspace.
.
, "".
.
, , ,
.
Public Sub m ultipletrans()
Dim db As DATABASE, wks As W orkspace, rst As _ Recordset
Dim db1 As DATABASE, wks1 As W orkspace, rst1 As _ Recordset
Set wks = DBEngine.W orkspaces(0)
Set db = w ks.D atabases(0)
Set rst = db.OpenRecordset(" ", _ dbOpenDynaset)
Set wks1 = DBEngine.W orkspaces(0)
Set db1 = w ks1.D atabases(0)
Set rst1 = db1.OpenRecordset(" ", _ dbOpenDynaset)
wks.BeginTrans
rst.FindFirst "[]=''"
rst. Edit
rst. = ""
rst.UPDATE
wks1.BeginTrans
rst1.FindFirst "[]=''"
rst1.Edit
rst1 . = ""
rst1.UPDATE
wks.Com m itTrans
wks1.Com m itTrans
End Sub
W orkspace.
, , ,
.
Database Recordset Transactions,
True False. ,
BeginTrans, Com mitTrans Rollback .

converted to PDF by HupBaH9I

,
.

8
-
8 .1 . ODBC
Transact-SQ L


8 .2 . Visual FoxPro


8 .3 . Access Visual Basic
8 .4 . ODBC API
8 .5 . Remote Data Objects
8 .6 . SQL-DMO
, , .
, -
-,
, . -
,
. , ,
, .

,
, .
, ,
.
, - ,
.
, -.
- ,
. F ro n t-e n d ( ) ,
, - . B a c k
e n d () , ,
-
-.
- (front-end)
(back-end), .
.
Visual FoxPro, Visual Basic Access
-, , , ,
.
MS SQ L Server .

8.1.
ODBC
-
, .

. , , ODBC.
ODBC
MS SQ L Server.

converted to PDF by HupBaH9I

- O p en D a ta b a s e C o n n e c tiv ity (ODBC) -


. ODBC , , ,
Access Visual FoxPro, , .

, ODBC (MS SQL


Server, Oracle . .), ,
, Paradox, ,
FoxPro Delphi. ODBC ,
, , ,
,
front-end back-end .
ODBC
, , ,
, , , . ,
ODBC , ,
, . ODBC
, .
,
, - .
, - ODBC.
ODBC SQ L
. ODBC
, ODBC. ,
,
. ODBC
.
ODBC
, SQ L ,
, .
ODBC
SQ L ODBC,
. ODBC ,
,
(Tim estam p, Binary), , SQ L ,
, SQ L ,
.
ODBC MS SQ L Server, Microsoft 1996 ,
,
. , MS SQ L Server,
, ODBC Microsoft,
.
,
S Q L G e t In f o ( ) , S Q L G e t F u n c tio n ()
S Q L G e t S tm t O p tio n (). .
ODBC -
,
. ODBC ,
, , . ,
ODBC, ,
,
.
ODBC . 8.1.
8 .1 . ODBC

ODBC
,
.
S Q L C o n n e c t (),
,
,

.

converted to PDF by HupBaH9I

,


, .
ODBC


,
ODBC
.

DLL.
,

,

.

ODBC ,

,
SQ L
.


,
, ,
.

,
O D B C

, , ,
. .


ODBC .

,
.

ODBC - SQ L .
SQ L , SQL. ,
, ODBC , "ODBC SQ L",
,
.

, .
,
.
ODBC

.

. , , , - ,
. , Access
MS SQ L Server,
(. . 8 .1 ):

converted to PDF by HupBaH9I

$$

Paas-thrnugh

O D BC APS

RDO

SQLOLE

. 8 .1 .

.
Microsoft Access. -
.
, ,
.
S Q L p a s s -th ro u g h .
, , Access. ,
ODBC, .
O D B C A P I .
Access
. , ,
, Access.

, .
R e m o te D ata O b je c ts .
, ,
Enterprise Visual Basic 4 .0 .
Remote Data Objects (RDO) - ODBC .
, . , RDO
ODBC API. ,
RDO . RDO
, , ODBC API.
, Enterprise Visual Basic 1000 .
S Q L DMO. SQ L OLE
, ODBC. SQLDMO. , Visual Basic for
Application, Visual Basic (32 bit), Visual FoxPro C++ (32 bit), ,
SQ L .
Windows NT Windows 95.

converted to PDF by HupBaH9I

SQ L Server.
SQ L Server
. , .
,
SQ L - pass through . SQ L ,
:
1.
2.
3.
4.
5.
6.

.
.
, .
, ,
.

.
.

,
ODBC . ,
Microsoft , , .
, , ,
. .
, ODBC SD K. ,
.

Transact-SQL
, -,
SQ L . ,
, ODBC,
API.
SQL.
MS SQ L Server.
MS SQ L Server.
Transact-SQ L - C R E A T E T A B L E
.
, Transact-SQ L
SQL.
, . 8.2 .
CREATE TABLE [database.[owner].]tablename
({colname datatype [NULL | NOT NULL | ID EN TITY [(seed, increment)]]
[constraint [ constraint [...constraint]]]
| [[,] constraint]} [[,] {nextcolname | nextconstraint}...])
[ON segmentname ]
8 .2 . CREATE TABLE

Database ,
. ,

,
U SE.

Owner

, ,

, .

Tablename .
SQ L
.

Colname .
SQ L
.

Datatype , SQL.

converted to PDF by HupBaH9I

,
.

Seed


IDENTITY.

Increment
IDENTITY.

Constraint .
:
CREATE TABLE modelSQL
(key_au to smallint ID EN TITY (1 ,1 ),
m odel_nam e varchar(25) NOT NULL,
m odel_prc money)
C R E A T E T A B L E :
ID EN TITY - , SQ L Server ( Increment),
1 (Seed).
NOT NULL - , .
. ,
NULL.
, . . 8.3
, MS SQ L Server .
8 .3 . MS SQ L Server

bynary(n)

n
.
NULL.

varbynary(n) n
.
NULL.
char(n)

varchar(n)


n .
NULL.
n
.
NULL.

datetime

,
1 1753 31
9999 3.33
.

smalldatetime

,
1 1900 06
2079 1 .

decim al(p,s) ,
p s
. p
, 38, s , p.
num eric(p,s) ,
p s
. p
, 38, s , p.
float(n)

real
int
smallint



15.
10 38 .
, 7
.
,
-2 147 483 648 2 147 483 647.
,

converted to PDF by HupBaH9I

-32768 32767.
tinyint

,
0 255.

money


-922 337 203 685 477.5808
922 337 203 685 477.5808.

smallm oney
-214 746.3648 214
746.3647.
bit
Tim estam p

text
image

1 0.
,
SQ L, ,
.

Tim estam p.
,
2 .
2 .

. 8.3 , .
sp_addtype.
C R E A T E T A B L E constraint ().
:
1.
2.
3.
4.
5.

(Prim ary Key) .


(Unique) .
(Foreign Key) .
(Default) .
(CH ECK).

,
, .
-
,
(, ) , ,
.
:
[CONSTRAINT constraintname]
PRIMARY KEY [CLU STERED | NONCLUSTERED]
(colname [, colname2 [ ..., colname16]])
[ON segmentname ]
16 .
. CLU STERED
NONCLUSTERED. CLU STERED ,
, . , .
CLU STERED . ,
CONSTRAINT . , .
,
, .
:
CREATE TABLE Auto_Store.YourReadness.FirstTable
(sqlserverstns CONSTRAINT p k _SQ L PRIMARY KEY CLU STERED ,
access_u sers)
:
CREATE TABLE Auto_Store.YourReadness.FirstTable
(sqlserverstns PRIMARY KEY CLU STERED ,
access_u sers)

converted to PDF by HupBaH9I

, ,
U N IQ U E
A L T E R T A B L E .
- :
[CONSTRAINT constraintname]
UNIQUE [CLU STERED | NONCLUSTERED]
(colname [, colname2 [ ..., colname16]])
[ON segmentname]
:
CREATE TABLE Auto_Store.YourReadness.FirstTable
(sqlserverstns CONSTRAINT p k _SQ L PRIMARY KEY CLU STERED ,
access_u sers CONSTRAINT u k _a c_u se rs UNIQUE)
, C LU STERED ,
NONCLUSTERED.
,
,
FOREIGN k Ey .
R EFER EN CES, , .
,
. :
[CONSTRAINT constraintname]
[FOREIGN KEY (colname [, colname2 [ ..., colname16]])]
REFER EN CES [owner.]reftable [(refcol [, refcol2
[ ..., refcol16]])]
, , (FOREIGN KEY)
16 . , FOREIGN KEY REFEREN CES
, .

. :
CREATE TABLE autostore.yourreadness.pat_table
(tree char(20) PRIMARY KEY,
leaf char(10))
CREATE TABLE autostore.yourreadness.child_table
(wood char(20) REFER EN CES pat_tab le(tree))
FOREIGN KEY,
.
:
CREATE TABLE autostore.yourreadness.pat_table
(tree char(2 0),
branch money,
leaf ch ar(1 0),
CONSTRAINT tochild PRIMARY KEY (tree,branch) )
CREATE TABLE autostore.yourreadness.child_table
(tree char(2 0),
branch money,
childs varchar(25 ),
FOREIGN KEY (tree,branch) REFEREN CES pat_table(tree,branch)
, F O R E IG N K E Y .

, .
Default .
:
[CONSTRAINT constraintname]
DEFAULT {constantexpression | niladic-function | NULL}
[FOR colname]

converted to PDF by HupBaH9I

, ,
( ), .
, Tim estam p ,
ID EN TITY ().
, FOR colname.
Constraint.
, accept_date
, - , ,
.
CREATE TABLE autostore.yourreadness.child_table
(tree char(2 0),
branch money,
childs varchar(25 ),
accept_date datetime DEFAULT getdate()
FOREIGN KEY (tree,branch) REFEREN CES pat_table(tree,branch)
Check , .
:
[CONSTRAINT constraintname]
CHECK [NOT FOR REPLICATION] (expression)
, NOT FOR REPLICATION,
, .
Check. Check
accept_date ,
.
CREATE TABLE autostore.yourreadness.child_table
(tree char(2 0),
branch money,
childs varchar(25 ),
accept_date datetime CHECK accept_date << getdate()+1
FOREIGN KEY (tree,branch) REFEREN CES pat_table(tree,branch)



. ,
CREA TE TA BLE.
CREATE VIEW [owner.]viewname
[(columnname [, columnname]...)]
[WITH ENCRYPTION]
A S selectstatement [WITH CHECK OPTION]
owner . Viewname -
. , , ,
. WITH ENCRYPTION,
, .
WITH CHECK OPTION
, ,
. A S
S Q L-SELEC T .
:
CREATE VIEW yourreadness.som ekindofview
AS S E L E C T tree FROM O iild ja b le

converted to PDF by HupBaH9I

C R E A T E T R IG G E R , :
CREATE T R IG G E R [owner .]trigger_name
ON [owner.]table_name
FOR {IN S E R T , UPDATE, D ELE T E }
[WITH ENCRYPTION]
A S sql_statements
, :
CREATE T R IG G E R [owner. ]trigger_name
ON [owner.]table_name
FOR {IN S E R T , UPDATE}
[WITH ENCRYPTION]
AS
IF UPDATE (column_name)
[{AN D | O R } UPDATE (colum n_nam e)...] sql_statements
,
, .
, , -
. , .
W IT H E N C R IP T IO N , , ,
SQ L , .
.
. SQ L ,
.

8.2. Visual FoxPro



, ,
, SQ L Server.
, ,
front-end. ,
.
ODBC.
-
Visual FoxPro.
Visual FoxPro ,
:
1.

2.

3.

(Connection Designer).
C R E A T E C O N N E C T IO N .
D B S E T P R O P ( ) .
(View Designer). C R E A T E S Q L
V IE W .
D B S E T P R O P ().
SQ L pass-through
SQ L .
.
.

,
. , Visual
FoxPro, :
1.
2.
3.

File New, Connection.


C R E A T E C O N N E C T IO N .
Project Manager, Connection, New.

converted to PDF by HupBaH9I

, ,
, ,
.
,
Data Source, UserID Password. ,
. Data Source ODBC.
, Visual FoxPro, ODBC
. ODBC Data Source
ODBC , SQ L Server (. 8 .2 ). Drivers
ODBC. Data Source
Add
. DataSource , ,
Data Source . Options
, .
Pubs, MS SQ L Server.
, Add
, , , , , -
, , ,
, .

Add D ata Source


Select which ODBC driver you want to use
from the list, then choose OK.

OK
Cancel

Installed ODBC Drivers:


!CR Oracle?
CR SQLBase
CR Sybase System 10
Microsoft Access Driver (K.mdb)
Microsoft dBase Driver (K.dbf)
Microsoft Excel Driver (K.xls)
Microsoft FoxPro Driver r.dbf)

H I

Help

J
d

. 8 .2 . ODBC
Data Source,
. "Data Source"
Data Source ( ),
UserID PassWord. , ,
, "Connection String".
Connection String, , -
, - ,
Visual FoxPro. - (. 8 .3 ):

converted to PDF by HupBaH9I

Connection Designer - Connect 1


f

D jia

& Conneeiion inng

Source. U sejid. P assw w d

C o m e e l Siring
| D SH -1 G O T SQ L;U serl [>-IA M G EN IU S ]
Display O D B C L o q in Prampts

(*

W h e n L o tjn info is no( s p e c k e d

Data Processing

I-

A^rctwontws Execution

AJways

Never

Timeout IrJeival*
idle |n' n}

Connection [sec]:

" Difplaygaming?

|15

17 gatch Processing

Quety [Sec).

I* Automata Junsactions

|o

ij

jo

il

Wait Tine (mi):

j ICO

. 8 .3 .
D SN = IG O TO SQ L;U serID = IA M G EN IU S;_
Passw ord=JesusChristSuperStar;D atabase=Pubs
, ODBC
. ,
Visual FoxPro, ,
.
,

. :
1.
2.
3.

,
.
.
.

C R E A T E C O N N EC T IO N ,
, , DATASOURCE,
. ,
.
, , :
CREATE CONNECTION mysqlconnect ;
DATASOURCE "igotosql" ;
U SERID "Iamgenius" PASSWORD "JesusChristSuperStar"
, SQ L pass-thtough - SQ L
SQL. S Q L C O N N E C T (),
.
(Standard Connection), (Connect string)
(Name Connection).
.

hndl=SQLCONNECT('igotosql','iamgenius')

hndl=SQLCONNECT('igotosql','iamgenius', 'JesusChristSuperStar','pubs')

hndl=SQLCONNECT('m ysqlconnect')

converted to PDF by HupBaH9I

.
, , ODBC: ODBChdbc ODBChstmt.

S Q L S E T P R O P ( ) .
S Q L G E T P R O P ().
S Q L S E T P R O P () :

SQLSETPROP(nConnectionHandle, cSetting, eExpression)


S Q L S E T P R O P () .
.
Visual FoxPro ,
( nConnectionHandle) 0.
S Q L S E T P R O P () 1, , -1,
, -2,
. ConnectTimeOut Visual FoxPro.
Visual FoxPro,
. , Visual FoxPro,
.
S Q L G E T P R O P () .
0,
Visual FoxPro.


, Visual FoxPro
. ( - Visual FoxPro.) Visual FoxPro
, SQ L .
,
. SQ L pass-through
, ,
, . :
m yhandle=SQLCONNECT("m ysqlconnect")
lA=SQLGETPROP("m yhandle", "Asynchronous")
IF !lA=SQLSETPROP("m yhandle","Asynchronous",.T.)
ENDIF
BatchMode , ,
S Q L E X E C ( ) . BatchMode - .
S Q L E X E C ( ) ,
.
, S Q L E X E C ( ) SQ L S E LEC T ,
, BatchMode,
.
,
S Q L M O R E R E S U L T S (). :
m yhandle=SQLCONNECT("m ysqlconnect")
=SQLSETPROP(m yhandle,"M atchM ode",.T.)
= SQ LEX EC (m yhandle,"SELEC T * FROM account",;
"SELEC T * FROM Country","Results")
mores=0
DO W HILE mores << 2
m ores=SQLM O RERESULTS(m yhandle)
ENDDO
:
^

Synchronous Batch

Asynchronous Batch

Synchronous NonBatch

Asynchronous Nonbatch

converted to PDF by HupBaH9I

(Synchronous Batch Mode) - ,


, , .
(Asynchronous Batch Mode) -
0 , ,
.
(Synchronous Nonbatch Mode) - ,
, 1.
S Q L M O R E R E S U L T S (), , .
,
S Q L M O R E R E S U L T S (). S Q L M O R E R E S U L T S () 2,
.
(Asynchronous NonBatch Mode) -
, , , , 1,
S Q L M O R E R E S U L T S (), 2.
. 8.4.
8 .4

ConnectTimeOut

( ),
.
0,
.
0 600.
- 15 .
.

Idle-Tim eout ,
.

. - 0
( ). .
QueryTimeOut


,
. 0,
.
0 600. -.

Transactions , ,
.
:
1 DB_TRANSAUTO ( V ISU A L FOXPRO.H) -
;
;
2 DB_TRANSMANUAL ( V ISU A L FOXPRO.H)
S Q L C O M M IT () S Q L R O L L B A C K ().
WaitTime

, ,
Visual FoxPro ,
SQL. - 100
. .

S Q L S T R IN G C O N N E C T ()
. ,
. .
. :
h=SQ LSTRINGCO NN ECT('dsn=M yAutostoreSQ L;uid=sa; pwd=Im m anager')
= SQ LEX E C (h ,"SE LEC T * FROM Account","FoxAccount")
, , , C1
, ,
, .
CREATE CONNECTION c1;
CONNSTRING 'dsn = M yAutostoreSQL;uid=sa;pwd=Im m anager'

converted to PDF by HupBaH9I

h=SQLCONNECT('c1')
= SQ LEX E C (h ,"SE LEC T * FROM Account","FoxAccount")
.
-
. S Q L D IS C O N N E C T (). :
CREATE CONNECTION c1;
CONNSTRING 'dsn = M yAutostoreSQL;uid=sa;pwd=Im m anager'
h=SQLCONNECT('c1')
= SQ LEX E C (h ,"SE LEC T * FROM Account","FoxAccount")
=SQ LDISCO N N ECT(h)
. S Q L E X E C ( )
S Q L D IS C O N N E C T (),
. . S Q L E X E C ( )
,
. .
C U R S O R S E T P R O P (),
.
,
C U R S O R S E T P R O P (), , ,
.
,
U S E ,
.
CREATE CONNECTION c1;
CONNSTRING 'dsn = M yAutostoreSQL;uid=sa;pwd=Iam m anager'
h=SQLCONNECT('c1')
h=SQLCONNECT("cn1")
= SQ LEX E C (h ,"SE LEC T * FROM Account","FoxAccount")
=CURSORSETPROP('tables','Account')
=CURSORSETPROP('KeyFieldList','field1')
=CURSORSETPROP('updatablefieldlist','field2')
=CURSORSETPRO P('updatenam elist',;
'field1 mytable.field1,field2 mytable.field2')
=CURSO RSETPRO P('sendupdates',.T.)
BROW SE
USE
=SQ LDISCON N ECT(h)
, S Q L E X E C ( ) ,
. C U R S O R G E T P R O P ()
. .
Transactions 1, ,
. 2,
. , ,
, ,
.
S Q L C O M M IT () S Q L R O L L B A C K ().
. ,
, ,
, - ,
.
,
.
Transactions .
CREATE CONNECTION cn1 CONNSTRING 'dsn = myteach'
h=SQLCONNECT("cn1")
= SQ LEX E C (h ,"SE LEC T * FROM Account","FoxAccount")
=SQ LSETPRO P(h,"Transactions",2)
=CURSORSETPROP('tables','Account')

converted to PDF by HupBaH9I

=CURSO RSETPRO P('KeyFieldList','account,key_custom er')


=CURSORSETPROP('updatablefieldlist','sum m a')
=CURSORSETPRO P('updatenam elist',;
'account account.account,key_custom er account ; key_custom er,;
sum ma account.sum m a')
=CURSO RSETPRO P('sendupdates',.T.)
REPLACE ALL field2 WITH 27
IF DAY(DATE()) = 2
SQ LROLLBACK(h)
ELSE
SQLCOMMIT(h)
ENDIF
USE
=SQ LDISCON N ECT(h)


7 . ,
, ,
Visual FoxPro, .
, , .
, FoxPro 2.6 .
Visual FoxPro 3.0 .
. , ,
, , ,
. -.
, FoxPro 2 .6 ,
,
.
C R E A T E S Q L V I E W .
CREATE SQ L VIEW [ViewName ] [REMOTE]
[CONNECTION ConnectionName [SHARE]
| CONNECTION DataSourceName]
[AS SQLSELECTStatement]
R EM O T E.
C O N N EC T IO N
, . ,
. ? .

, , , ,
.
, . ,
,
.
,
,
ODBC, .
.
Project Manager, , Remote Views,
. 8 .4 , New.

converted to PDF by HupBaH9I


P ro p e l M a n a g e r- M y b o o ^ p r o jo c l

All

|i

Data

i|

Documentsj

Classes |

=] Databases

Code

Other

IQ

New...

Kb auto store
= 0 sergey

Add..

5- i

Tables
Local Views
Remote Views
<9 Connections
^ Stored Procedures
Free Tables
' |jp Queries
queryS

Modify
Browse
Remove..
Build...

Description:
Path:

. 8 .4 .
,
,
.
. ,
. ODBC, ,
, Visual
FoxPro.
, ,
, . SQ L Server
Microsoft Access , .

OK,
, .
.
,
. - ,
,
.
,
T A B L E U P D A T E () - ,
. -
, .
, SQ L pass-through
. SQ L pass-through , ,
,
. ,
, : ,
.
, ,
Browse Grid. , .
Grid Browse ,
. ,
, .
,
.
- ,
, ,
ODBC - , API. , Visual FoxPro DLL, , ,
, , .
Access Visual Basic
, ODBC A PI, RDO (
), SQL-DMO, Visual FoxPro.

converted to PDF by HupBaH9I

8.3. Access Visual Basic



A ccess Visual Basic .
,
, .
, , ,
, .
,
, .
Microsoft Access SQ L Server .
. ,
,
. ,
. - .
, Microsoft Access,
.
, . ,
ODBC (. 8 .5 ).

M ji D o c u m e n ts

| | | ( s jf iJ a la J

,,,

. )
(-1
~*1 (): [

icrosoft

dBASE til
& ' (BASE W
., dBASE 5

'

]"*"

.
i . - npofpii.ir^y

". " "

licrosoN FoxPro

-aatoK

. 8 .5 . Access 7.0

,
(Data Source), .
, New
ODBC (. 8 .6 ).

converted to PDF by HupBaH9I

S Q L D ata So u rces
Select Data Source:

FoodTwo
Meandpdx
myfox
myteach
myv
myvvod
newlycreatedaccessbase
sergey

OK

--d

New..

Cancel

. 8 .6 .

, . ,
.
.
. ,
Jet Access .
, , ,
. ,
A ccess.
Access. ,
" ".
.
(Add-In) Visual Basic Data Manager.
Visual Basic,
Data Manager.
. 8 .7 -8 .9 .

T a h l e s/Query Defs
Open

New

Design

Jj
* Is
I
Si

account
customer
first
fromquery
1 Larisa
My QD1

Delete

Tables.... I
Relations
I
:I....Attached

:
------------------ 1

S Q L Statement

. 8.7 .

converted to PDF by HupBaH9I

Oaf Manaqer^ Cijsp rftlpiCQch.mdh


File

| 1

W h )m
k

Hefp
h

*
[ScuTabift~

jCorned
|O D B C . S H v f(j3 4 jS (5 L iC e D ff^ :'iP itfta t_ b o d

customer
ORDERS.DB

ODSC^SM.vl^,-SiiwO&<:ylrojK!t_ld
Paradon
,J*t* b w * fc V iiM ri\ )c itiM id ii1 .in (li

.
||

fieAMadi

Close

S'/E
'
---------------->
-

:-. :

f11>>,4>"
i 4>>JJWi'
J

xttzi K

; ; ssTtri?: ti n: . w

. 8 .8 .

^ N e w Attached T a b le
Attachment Name

W
----------------------------------------------Database Name

Connect String
|jet Engine MDB

Table to Attach

I
~

AttachSavePWD

AttachExclusive

Attach

Close

. 8 .9 .
? -,
, . -, , ,
, .
, Access ,
.
? ,
. ?
.
. ,
. DAO - .
:
Dim MyDb As Database
Dim mytableDef As TableDef
Set MyDb = D BEngine.W orkspaces(0).D atabases(0)
Set MytableDef = _ CreateTabledef("JustProgram m aticalyM adeTable")
. ,
,
.
Visual Fox-Pro 3.0.

converted to PDF by HupBaH9I

, Connect SourceTableNam e
. AttachTable.
vfp34.
(Data Source) .
Public Sub TableCREA TE()
Dim myDb As DATABASE, mytdef As TableDef
Set myDb = DBEngine.W orkspaces(0)("Autostore.m db")
Set mytdef = m yDb.CreateTableDef("AttachTable")
m ytdef.Connect = "ODBC;dsn=vfp34"
m ytdef.SourceTableNam e = "country"
myDb.TableDefs.Append mytdef
End Sub
A ccess, Visual Basic Microsoft Excel.
,
DAO . ,
, ,
, .
, ,
, ,
, , ,
, .
, Seek.
,
, , .
, ,
. ODBC
.
, .
Basic.
Dim CurrentDatabase As Database
Dim MySet As Recordset
' FoxPro
Set CurrentDatabase = D BEngine.W orkspaces(0).O penD atabase_
("C:\FOXPRO\DATA\", False, False, "FoxPro 2.5")
' Custom er
Set MySet = CurrentDatabase.OpenRecordset("Custom er")
(
, FoxPro 2 . ,
C:\FOXPRO\DATA\), .
,
.
,
, .
, ,
, .
FoxPro 2.6.
Dim CurrentDatabase As Database
Dim MyTableDef As TableDef
Set CurrentDatabase = _ DBEngine.W orkspaces(0).OpenDatabase("C:\DATA", F a ls e ,_ False, "FoxPro
2.6")
Set MyTableDef = _ CurrentDatabase.CreateTableDef("From Access")
MyTableDef.Fields.Append M yTableDef.CreateField("Field1", D B _TEX T, 15)
CurrentDatabase.Tabledefs.Append MyTableDef
, , SQ L
pass-through. SQ L pass-through ,
, Jet.
, .
, -

converted to PDF by HupBaH9I

, , .
SQ L pass-through , ,
, , , SQ L pass-through
, ,
. , ,
. , pass
through , - .
,
. SQL ,
Pass-Through.
, SQ L .
. , -
, (Data Source).
, (. 8 .1 0 ).

...........................................................
O D BC....................
............................................
....................................
O D BC...............................

pDBC;DSN=superbase;SourceDB

GO

. 8 .1 0 .
.
,
"".
Visual Basic pass-through Data
Manager.
pass-through , QueryDef.
, Visual Basic
pass-through . ,
. 8.11.

n lx ll

I 0 Forml
rec N

|i

Account
|101

Summa
| l 1000

Forward

Back

Save

Exit

. 8 .1 1 .
SQ L pass-through ,
.

converted to PDF by HupBaH9I

Private Sub Form _Load()


Set Db = W orkspaces(0).OpenDatabase("C:\SPORT\TOTEACH.MDB")
'
' "My QD1", ,
' .
For I = 0 To Db.QueryDefs.Count - 1
If D b.Q ueryD efs(I).N am e = "My QD1" Then
Db.QueryDefs.Delete "My QD1"
Exit For
End If
Next I
' , , DAO QueryDef
' .
Set Qd1 = Db.CreateQueryDef("M y QD1")
Qd1.Connect = "odbc;dsn=vfp34;"
' SQ L
' ReturnsRecord ( ) ,
'
Q d1.SQ L = "SELEC T * FROM Account"
Qd1.ReturnsRecords = True
'
' , ,
' ,
Set Rs = Db.OpenRecordset("My Qd1",_dbOpenSnapshot)
Me.Text1 = Rslaccount
Me.Text2 = Rslsum m a
vtext1 = Rslaccount
vtext2 = Rslsum m a
Me.Text3 = Rs.RecordCount
End Sub
, pass-through -
Connect ReturnRecords.
- ,
pass-through . ,
, pass-through , .
Private Sub Com m and3_Click()
For I = 0 To Db.QueryDefs.Count - 1
If D b.Q ueryD efs(I).N am e = "My QD2" Then
Db.QueryDefs.Delete "My QD2"
Exit For
End If
Next I
Set Qd2 = Db.CreateQueryDef("M y QD2")
Qd2.Connect = "odbc;dsn=vfp34;"
Q d2.SQ L = "Update account set account=" & _Str(M e.Text1) & ",_sum m a = " & Str(M e.Text2) &
" where account = "_ & Str(vtext1) & " _a n d sum m a = " & Str(vtext2)
Qd2.ReturnsRecords = False
Qd2.Execute
Set Rs = Db.OpenRecordset("My Qd1",_dbOpenSnapshot)
Rs.FindNext "account=" & Str(M e.Text1) & _ " and sum m a=" & Str(M e.Text2)
Me.Text3 = Rs.RecordCount
End Sub
, ReturnsRecords False
Execute QueryDef.
pass-through
, .
Access
(Data Source)
Set Qd3= Db.CreateQueryDef("M y QD3")
Qd3.Connect = "odbc;dsn=vfp34;"
Q d3.SQ L = "CREATE TABLE m adebyaccess(field1 c(20))

converted to PDF by HupBaH9I

Qd3.ReturnsRecords = False
Qd3.Execute

8.4. ODBC API

ODBC API - ODBC.


ODBC .
ODBC
.
ODBC ,
. ,
ODBC.
, Access ISAM , ,
, .
ODBC A PI,
D e c la re .
' ODBC API
Declare Function oSQLAllocEnv Lib "odbc32.dll" _
Alias "SQLAllocEnv" (phenv As Long) As Integer
Declare Function oSQLAllocConnect Lib "odbc32.dll" _
Alias "SQLAllocConnect" (ByVal henv As Long, phdbc As _ Long) As Integer
Declare Function oSQLConnect Lib "odbc32.dll" _
Alias "SQLConnect" (ByVal hdbc As Long, ByVal szDSN As _ String, _
ByVal cbDSN As Integer, ByVal szUID As String, _
ByVal cbUID As Integer, ByVal szAuthStr As String, _
ByVal cbAuthStr As Integer) As Integer
Declare Function oSQLAllocStmt Lib "odbc32.dll" _
Alias "SQLAllocStmt" (ByVal hdbc As Long, pHstmt As _ Long) As Integer
, , ,
, - .
- ,
, , ODBC API.
, .
,
. Access Visual Basic,
, ,
DLL.
(
, , - , ):
Type ORecordSet
lngHenv As Long '
lngHdbc As Long '
lngHstmt As Long '
lngHstmtUpdate As Long '
'
intColumns As Integer '
lngRows As Long '
lngRowCount As Long '
'
lngRowSetSize As Long '
'
lngMaxRows As Long '
'
lngMaxWidth As Long '
lngCursor As Long '
lngConcur As Long '
EOF As Boolean '
BOF As Boolean '
lngFirstRow As Long '

converted to PDF by HupBaH9I

lngCurrentRow As Long '


lngLastRow As Long '
lngLastSetRow As Long '
'
strCursorNam e As String '
intArrayPos As Integer '
'
intRowStatus() As Integer '
'
strColLabels() As String '
lngColLabels() As Long '
lngD isplaySize() As Long '
End Type
, oRecordSet:
Private mtypODBC As OrecordSet
:
' , ODBC
Public Const SQ L_IN VA LID _H A N D LE = -2
Public Const S Q L_ER R O R = -1
Public Const S Q L_S U C C E S S = 0
Public Const S Q L_S U C C E S S _W IT H _IN F O = 1
Public Const S Q L_S T ILL_E X EC U T IN G = 2
Public Const SQ L_N EED _D A TA = 99
Public Const SQL_N O_DATA_FO UN D = 100
,
, .
.
Function rO D BCConnect(strServer As String, strUID As String,
_strPassw ord As String) As Integer
Dim intRet As Integer
Dim strConnOut As String * 256
Dim intConnOut As Integer
Dim typOBad As ORecordSet
Dim i As Integer
On Error GoTo rODBCConnectErr
rODBCConnect = True
'
intRet = oSQLAllocEnv(m typODBC.lngHenv)
If intRet <<>> S Q L_S U C C E S S Then
Call rODBCErrorInfo(m typODBC.lngHenv, SQ L_N U LL_H D BC , _
SQ L_N U LL_H STM T)
End If
If intRet << S Q L _S U C C E S S Then
rODBCConnect = False
GoTo rODBCConnectExit
End If
'
intRet = oSQLAllocConnect(ByVal mtypODBC.lngHenv, _
mtypODBC.lngHdbc)
If intRet <<>> S Q L_S U C C E S S Then
Call rODBCErrorInfo(m typODBC.lngHenv, _
mtypODBC.lngHdbc, SQ L_N U LL_H STM T)
End If
If intRet << S Q L _S U C C E S S Then
rODBCConnect = False
GoTo rODBCConnectExit
End If
'
intRet = oSQLConnect(ByVal mtypODBC.lngHdbc, strServer, _
Len(strServer), strU ID , Len(strU ID ), strPassword, _

converted to PDF by HupBaH9I

Len(strPassw ord))
If intRet <<>> S Q L_S U C C E S S Then
Call rODBCErrorInfo(m typODBC.lngHenv, _
mtypODBC.lngHdbc, SQ L_N U LL_H STM T)
End If
If intRet << S Q L _S U C C E S S Then
rODBCConnect = False
GoTo rODBCConnectExit
End If
rODBCConnectExit:
Exit Function
rODBCConnectErr:
MsgBox Err.Num ber & ": " & Err.Description, _
vbCritical, "rODBCConnect()"
typOBad.intArrayPos = -1
rODBCConnect = False
Resume rODBCConnectExit
End Function
,
, SQ L ,
:
intRet = oSQLAllocStm t(ByVal m typODBC.lngHdbc,_
mtypODBC.lngHstmt)
, ,
. ,
Microsoft SQ L Server, ,
. ,

, .
.
S Q L G e t I n f o ( ) , ,
.
, SQ L .
:
Declare Function oSQ LExecD irect Lib "odbc32.dll" _
Alias "SQLExecDirect" (ByVal hstmt As Long, _
ByVal szSqlStr As String, ByVal cbSqlStr As Integer) A s _ Integer
,
. :
Function rODBCOpenRecordset( _s trS Q L As String, lngType As Long) As Boolean
' ODBC
' ODBCConnect
'
' true , false
'
Dim intRet As Integer
Dim i As Integer
On Error GoTo rODBCOpenRecordsetErr
rODBCOpenRecordset = True
'
If mtypODBC.lngHdbc = SQ L_N U LL_H D BC Then
MsgBox " .
. " & _
" rODBCOpenRecordset", vbCritical, _
"rODBCOpenRecordset()"
rODBCOpenRecordset = False
GoTo rODBCOpenRecordsetExit
End If

converted to PDF by HupBaH9I

' SQ L
'
intRet = oSQLAllocStm t(ByVal mtypODBC.lngHdbc, _
mtypODBC.lngHstmt)
If intRet <<>> S Q L_S U C C E S S Then
Call rODBCErrorInfo(m typODBC.lngHenv, _
mtypODBC.lngHdbc, mtypODBC.lngHstmt)
End If
If intRet << S Q L _S U C C E S S Then
rODBCOpenRecordset = False
GoTo rODBCOpenRecordsetExit
End If
'
'
m typODBC.BOF = False
m typO DBC.EO F = False
m typODBC.lngFirstRow = 0
mtypODBC.lngCurrentRow = 0
mtypODBC.lngLastRow = 0
m typODBC.lngCursor = SQL_CURSO R_D YN AM IC
If lngType = dbOpenDynaset Then
m typODBC.lngConcur = SQ L_CO N CU R_VA LU ES
E lseIf lngType = dbOpenSnapshot Then
m typODBC.lngConcur = SQ L_CO N CU R_REA D _O N LY
Else
"rODBCOpenRecordset()"
rODBCOpenRecordset = False
GoTo rODBCOpenRecordsetExit
End If
m typODBC.lngRowSetSize = odbcRowsetSize
'
mtypODBC.lngMaxRows = odbcMaxRows
'
'
mtypODBC.lngMaxWidth = odbcMaxWidth
intRet = oSQLSetStm tOption(ByVal_m typO DBC.lngH stm t, _
S Q L _R O W S E T _S IZ E , m typODBC.lngRowSetSize)
If intRet <<>> S Q L_S U C C E S S Then
Debug.Print ": "
Call rODBCErrorInfo(m typODBC.lngHenv, _
mtypODBC.lngHdbc, mtypODBC.lngHstmt)
End If
'
intRet = oSQLSetStm tOption(ByVal mtypODBC.lngHstm t, _
SQ L_C U R SO R _TY P E, mtypODBC.lngCursor)
If intRet <<>> S Q L_S U C C E S S Then
Debug.Print ": "
Call rODBCErrorInfo(m typODBC.lngHenv, _
mtypODBC.lngHdbc, mtypODBC.lngHstmt)
End If
'
intRet = oSQLSetStm tOption(ByVal mtypODBC.lngHstm t, _
SQ L_CON CURREN CY, mtypODBC.lngConcur)
If intRet <<>> S Q L_S U C C E S S Then
Call rODBCErrorInfo(m typODBC.lngHenv, _
mtypODBC.lngHdbc, mtypODBC.lngHstmt)
End If
intRet = oSQLSetStm tOption(ByVal mtypODBC.lngHstm t, _
SQ L_M AX_RO W S, mtypODBC.lngMaxRows)
If intRet <<>> S Q L_S U C C E S S Then
Call rODBCErrorInfo(m typODBC.lngHenv, _
mtypODBC.lngHdbc, mtypODBC.lngHstmt)
End If
'
intRet = oSQLSetCursorN am e(m typODBC.lngHstm t, _
"C1", 2)

converted to PDF by HupBaH9I

If intRet <<>> S Q L_S U C C E S S Then


Call rODBCErrorInfo(m typODBC.lngHenv, _
mtypODBC.lngHdbc, mtypODBC.lngHstmt)
End If
m typODBC.strCursorNam e = rODBCGetCursorNam e()
' SQ L
intRet = oSQLExecDirect(ByVal mtypODBC.lngHstm t, _
strSQ L, Len(strSQ L))
If intRet <<>> S Q L_S U C C E S S Then
Call rODBCErrorInfo(m typODBC.lngHenv, _
mtypODBC.lngHdbc, mtypODBC.lngHstmt)
End If
If intRet <<>> S Q L_S U C C E S S And intRet <<>> S Q L_S U C C E S S _W IT H _IN FO Then
rODBCOpenRecordset = False
GoTo rODBCOpenRecordsetExit
End If
'
intRet = rODBCGetColum nInfo()
If Not intRet Then
rODBCOpenRecordset = False
GoTo rODBCOpenRecordsetExit
End If
rODBCOpenRecordsetExit:
Exit Function
rODBCOpenRecordsetErr:
MsgBox Err.Num ber & ": " & Err.Description, _
vbCritical, "rODBCOpenRecordset()"
rODBCOpenRecordset = False
Resume rODBCOpenRecordsetExit
End Function
A PI, ODBC API .
, . ODBC
: , . ,
ODBC, (
SQLAllocEnv) (SQ LFreeEnv).
- ,
ODBC, .
SQ L
, ,
D e c la re :
Declare Function oSQ LFreeStm t Lib "odbc32.dll" _
Alias "SQLFreeStm t" (ByVal hstmt As Long, ByVal fOption_As Integer) As Integer
rc = oSQ LFreeStm t (m typODBC.lngHstm t, SQ L_C LO SE )
:
Declare Function oSQLFreeConnect Lib "odbc32.dll" _
Alias "SQLFreeConnect" (ByVal hdbc As Long) As Integer
Declare Function oSQ LFreeEnv Lib "odbc32.dll" _
Alias "SQLFreeEnv" (ByVal henv As Long) As Integer
, ODBC API
. Access Visual Basic,
, :
Function rODBCDisconnect()
' (Data Source)
Dim intRet As Integer
On Error GoTo rODBCDisconnectErr
intRet = oSQLDisconnect(ByVal mtypODBC.lngHdbc)
If intRet <<>> S Q L_S U C C E S S Then
Call rO D BCErrorInfo(m typO DBC.lngH env,_

converted to PDF by HupBaH9I

mtypODBC.lngHdbc, SQ L_N U LL_H STM T)


End If
intRet = oSQLFreeConnect(ByVal mtypODBC.lngHdbc)
If intRet <<>> S Q L_S U C C E S S Then
Call rODBCErrorInfo(m typODBC.lngHenv, _
mtypODBC.lngHdbc, SQ L_N U LL_H STM T)
End If
intRet = oSQ LFreeEnv(ByVal mtypODBC.lngHenv)
If intRet <<>> S Q L_S U C C E S S Then
Call rODBCErrorInfo(m typODBC.lngHenv, _
SQ L_N U LL_H D BC , SQ L_N U LL_H STM T)
End If
rODBCDisconnectExit:
Exit Function
rODBCDisconnectErr:
MsgBox Err.Num ber & ": " & Err.D escriptio n,_ vbCritical, "rODBCDisconnect()"
rODBCDisconnect = False
Resume rODBCDisconnectExit
End Function
, ODBC API ,
, .
. 8.6 ODBC
(. . 8 .1 2 ). .

. 8 .1 2 .
8 .6 . ODBC API

SQLAllocEnv

.


.

SQLAllocConnect

SQLConnect

SQL


,
,

.

SQLAllocStm t .

converted to PDF by HupBaH9I

SQLPrepare

SQ L
.

SQLGetCursorName

,
.

SQ LSetCursorName

SQ LExecute

SQ LE xe c
Direct

SQLRowCount

SQLNumResultCol

.
,

, , .

.

SQLDescribe-
Col
.

/V

SQLColAttributes

SQLBindCol

SQLFetch

SQ LFreeStm t
.
SQLCancel
SQ LTransact
SQLDisconnect

.

.
.

SQ LFreeEnv

SQ LFreeConnect

ODBC API,
, , , ,
DLL :
Declare Function oSQLRowCount Lib "odbc32.dll" _
Alias "SQLRowCount" (ByVal hstmt As Long, pcrow As Long)_As Integer
Declare Function oSQLBindCol Lib "odbc32.dll" _
Alias "SQLBindCol" (ByVal hstmt As Long, ByVal icol A s _ Integer, _
ByVal fCType As Integer, rgbValue As Any, _
ByVal cbValueMax As Long, pcbValue As Long) As Integer
Declare Function oSQLColAttributes Lib "odbc32.dll" _
Alias "SQLColAttributes" (ByVal hstmt As Long, ByV al_ icol As Integer, _
ByVal fCType As Integer, rgbDesc As Any, ByVal cbDescM ax_ As Integer, _
pcbDesc As Integer, pfDesc As Long) As Integer
Declare Function oSQLDescribeCol Lib "odbc32.dll" _
Alias "SQLDescribeCol" (ByVal hstmt As Long, _
ByVal icol As Integer, ByVal szColName As String, _
ByVal cbColNameMax As Integer, pcbColName As Integer, _
pfSQLType As Integer, pcbColDef As Long, _
pibScale As Integer, pfNullable As Integer) As Integer
Declare Function oSQLDisconnect Lib "odbc32.dll" _
Alias "SQLDisconnect" (ByVal hdbc As Long) As Integer
Declare Function oSQLDriverConnect Lib "odbc32.dll" _
Alias "SQLDriverConnect" (ByVal hdbc As Long, _

converted to PDF by HupBaH9I

ByVal Hwnd As Long, ByVal szConnStrIn As String, _


ByVal cbConnStrIn As Integer, _
ByVal szConnStrOut As String, ByVal cbConnStrOutMax A s _ Integer, _
pcbConnStrOut As Integer, ByVal fDriverCompletion As Integer) As Integer
Declare Function oSQ LError Lib "odbc32.dll" _
Alias "SQLError" (ByVal henv As Long, ByVal hdbc A s _ Long, _
ByVal hstmt As Long, ByVal szSqlState As String, _
pfNativeError As Long, ByVal szErrorM essage As String, _
ByVal cbErrorMsgMax As Integer, pcErrorMsg As In te g e r)_ As Integer
,
ODBC API. ODBC
. ODBC ,
SQ L_ER R O R . ,
S Q L E rro r().
henv, hdbc hstmt
, S Q L E r r o r ( ) .
.
S Q L E r r o r ( ) , ODBC
S Q L _ E R R O R S Q L _ S U C C E S S _ W IT H _ IN F O .
S Q L E r r o r ( ) ODBC .
S Q L E r r o r ( ) :

SQ LSTA TE - .
Native Error Code - , .
Error Message Text - .

,
. , hstmt
, .
, ,
, . , hdbc
, hstmt.
S Q L E r r o r ( ) ,
. :

, ,
henv SQ L_N U LL_H D BC SQ L_N U LL_H STM T hdbc hstmt
. ODBC ,
henv.
, ,
hdbc hstm t, SQ L_N ULL_H STM T.
henv. ODBC,
hdbc.
, ,
hstmt. S Q L E r r o r ( )
hstmt, hdbc henv.
ODBC, hstmt.
, ,
S Q L E r r o r ( ) . S Q L _ S U C C E S S
.

,
S Q L E r r o r ( ) SQ L_NO _DATA_FO UN D.
Declare Function oSQLExtendedFetch Lib "odbc32.dll" _
Alias "SQLExtendedFetch" (ByVal hstmt As Long, _
ByVal fFetchType As Long, ByVal irow As Integer, _
pcrow As Long, rgfRowStatus As Integer) As Integer
Declare Function oSQLFetch Lib "odbc32.dll" _
Alias "SQLFetch" (ByVal hstmt As Long) As Integer
Declare Function oSQLGetCursorNam e Lib "odbc32.dll" _
Alias "SQLGetCursorName" (ByVal hstmt As Long, _
ByVal szCursor As String, ByVal cbCursorMax As Integer, _

converted to PDF by HupBaH9I

pcbCursor As Integer) As Integer


Declare Function oSQLGetData Lib "odbc32.dll" _
Alias "SQLGetData" (ByVal hstmt As Long, ByVal icol A s _ Integer, _
ByVal fCType As Integer, rgbValue As Any, _
ByVal cbValueMax As Long, pcbValue As Long) As Integer
Declare Function oSQLGetInfo Lib "odbc32.dll" _
Alias "SQLGetInfo" (ByVal hdbc As Long, _
ByVal fInfoType As Integer, ByRef rgbInfoValue As Any, _
ByVal cbInfoMax As Integer, cbInfoOut As Integer) A s _ Integer
Declare Function oSQLGetStmtOption Lib "odbc32.dll" _
Alias "SQLGetStmtOption" (ByVal hstmt As Long, _
ByVal fOption As Integer, pvparam As Any) As Integer
Declare Function oSQLNumResultCols Lib "odbc32.dll" _
Alias "SQLNumResultCols" (ByVal hstmt As Long, pccol A s _ Integer) As Integer
Declare Function oSQLSetCursorNam e Lib "odbc32.dll" _
Alias "SQLSetCursorName" (ByVal hstmt As Long, _
ByVal szCursor As String, ByVal cbCursor As Integer) A s _ Integer
Declare Function oSQLSetPos Lib "odbc32.dll" _
Alias "SQLSetPos" (ByVal hstmt As Long, _
ByVal irow As Integer, ByVal fOption As Integer, _
ByVal fLock As Integer) As Integer
Declare Function oSQLSetStmtOption Lib "odbc32.dll" _
Alias "SQLSetStmtOption" (ByVal hstmt As Long, _
ByVal fOption As Integer, ByVal bparam As Long) A s _ Integer

8.5. Remote Data Objects


Remote Data Objects (RDO) - - ,
Visual Basic 4 .0 Entreprise. ,
,
ODBC A PI, .
, DAO - .
RDO
-.
RDO ODBC API ,
, ,
, ,
.
RDO Visual Basic Access. Visual
Basic ActiveX - RemoteControl,
.
,
.
RDO RemoteControl, .
,
, MS SQ L Server Oracle. RDO
, ,
.
. 8.7 DAO RDO.
RDO "", "" "", "". DAO,
RDO , rdoEngine.
RDO . 8.13. RDO ,
rdoEngine rdoEnvirinments,
rdoEnvironm ents(0).

converted to PDF by HupBaH9I

. 8 .1 3 .
ODBC
rdoConnection. ,
rdoRegisterDataSource
ODBC.
8 .7 . RDO DAO
RDO

DAO

rdoEngine

DBEngine

User, Group

rdoEnvironment

W orkspace

rdoConnection

Database

rdoTable

TableDef

Index

rdoResultset

Recordset

Forward-only - type

Forward-Only
Snapshot

rdoColumn

Field

rdoPreparedStatem ent

QueryDef

, .
OpenResulset Execute, SQ L
rdoConnection rdoResultset
.
,
. CreatePreparedStatem ent
rdoPreparedStatem ent, ,

. rdoPreparedStatem ent ,
OpenResultset Execute rdoPreparedStatem ent,
rdoResulset .
, rdoParameter.

OpenResultset rdoPreparedStatem ent,


rdoResultset.
RDO, , References Tools,
RDO .
- Microsoft Remote Data Object. A ccess,
, , , Visual
Basic Entreprise Edition. ,
.
rdoEngine. dbEngine
DAO. RDO:

converted to PDF by HupBaH9I

rdoEngine.rdoDefaultCursorDriver = rdUseOdbc
rdoEngine :
rdoDefaultCursorDriver - ,
:

rdUseIfNeeded

ODBC
.
,
.

rdUseODBC

RDO
ODBC.

.

RdUseServer

ODBC
.

,
.

,
ODBC.
- rdoDefaultErrorTreshold -
ErrorTreshold rdoPreparedStatem ent.
, Number.
Number ErrorTreshold, ,
, ,
, .
-1, , ,
.
- rdoDefaultLoginTimeout - ,
ODBC
. - 15 . 0,
,
, .
rdoDefaultPassword rdoDefaultUser
rdoEnvironment.
rdoEngine . rdoRegisterDataSource
Windows ODBC.
, ODBC.
.
Windows.
:
rdoRegisterDataSource cDataSourceName , cDriverName, ISilent, cAttributes

cDataSourceName - , .
, ,
, . , OpenConnection.
cDriverName - , ,
Windows. ,
.
lSilent - , , ODBC,
.
True,
cAttributes.
cAttributes - ,
. .
, , Windows,
,
. , . 8.14.

converted to PDF by HupBaH9I

RDO (rdoEnvironm ent).


.
,
, .
,
.
rdoEnvironment. , ODBC
. , ,
, . SQ L ,

.
rdoEnvironment rdoCreateEnvironm ent
:
set Variable = rdoCreateEnvironm ent(Nam e, User, Password)

Variable - , rdoEnvironment.
Name - ,

User - rdoEnvironment.
Password - .

Environment.


rdoRegisterDataSource
rdoCreateEnvironment.
Const rServerDSN = "ToAutostore"
Const rServerU ser = "UID=sa;DATABASE=autostore"
Dim grdfEnv As rdo.rdoEnvironment
Dom grdfConn As rdo.rdoConnection
Dim sqlAttr As String
strAttr = "Description=Connect to autostore" & _
C hr$(13) & "OemToAnsi = No" & _
C hr$(13) & "Address=\\MAINSERVER\AUTOSTORE\" _ & C hr$(13) & _
"Database=Autostore"
rdoEngine.rdoRegisterDatasource rServerD SN , _ "SQL Server", True, sqlAttr
If grdfEnv Is Nothing Then
rdoEngine.rdoDefaultCursorDriver = rdUseOdbc
Set grdfEnv = rdoEngine.rdoCreateEnvironm ent _
("", "", "")
Set grdfConn = grdfEnv.OpenConnection _
(rServerD SN , rdDriverNoPrompt, False, _
rServerU ser)
grdfConn.QueryTimeout = 0
End If
rdoEnvironments rdoEnvironment rdoEngine.
Item ,
.
Item , :
Set grdfConn = rdoEnvironm ents.Item (0).grdfEnv.O penConnection _
(rServerD SN , rdDriverNoPrompt, False, _
rServerU ser)
:
Set grdfConn = rdoEnvironm ents(0).grdfEnv.OpenConnection _
(rServerD SN , rdDriverNoPrompt, False, _
rServerU ser)
rdoEnvironments Count,
.
rdoEnvironment .
BeginTrans, Com mitTrans RollBackTrans.

converted to PDF by HupBaH9I

Workspace DAO. ,
.
SQ L B E G IN T R A N S A C T IO N , C O M M IT T R A N S A C T IO N , R O L L B A C K T R A N S A C T IO N ,
.
B E G IN T R A N S .
C O M M IT T R A N S .
R O L L B A C K T R A N S
rdoEnvironment ,
.
rdoEnvironment Close. ,
, rdoEnvironm ents(0).
rdoEnvironment ,
rdoResulset, rdoEnvironment
.
OpenConnection ,
, rdoEnvironment
, .
:
Set Connection = Environment.OpenConnection(DataSourceName[,
Prompt[, Readonly[, Connect]]])

Connection - , rdoConnection.
Environment - , .
DataSourceName - , ,
Windows. ,
, ODBC
. , Prompt
rdDriverNoPrompt,
.
Connect DataSourceName.
Prompt .
ODBC
DataSourceName ( ), .

rdDriverNoPrompt

DataSourceName Connect

.

,
OpenConnection
.

RdDriverPrompt


ODBC

,

.

rdDriverComplete


ODBC


DataSourceName Connect.

rdDriverCompleteRequired
, ,

rdDriverCom plete,
,
ODBC
,

converted to PDF by HupBaH9I

,
.

Readonly - ,
.
Connect - , .
ODBC
.

, ,
, , ,
.
,
.
rdoConnection,

rdoResultset rdoPreparedStatem ent,


OpenResultset CreatePreparedStatem ent, .
,
rdoTable rdoColumn rdoConnections(0).rdoTables
rdoTables(n).rdoColum ns.
, , Begin-Trans, CommitTrans
RollbackTrans.
, Close.

rdoEnvironment , .

CursorDriver
,
, .
: rdUsedIfNeeded,
rdUseODBC, rdUseServer.
hEnv

ODBC
,
ODBC API
.

LoginTimeOut ODBC
-


ODBC.
,
,
ODBC .
Name

Password

,

rdoEnvironment.

UserName


rdoEnvironment.

, rdoEngine, rdoErrors
RDO.
, ODBC RDO,
.
,
. ,
rdoErrors. rdoError
rdoErrors

converted to PDF by HupBaH9I

. Visual Basic
.
On Error Goto << >>
, rdoError
. - rdoDefaultErrorTreshold ErrorTreshold -
, .
, :
Function rdfInitialize() As Boolean
Const rServerDSN = "ToAutostore"
Const rServerU ser = "UID=sa;DATABASE=autostore"
Dim errX As rdo.rdoError
Dim grdfEnv As rdo.rdoEnvironment
Dim grdfConn As rdo.rdoConnection
Dim sqlAttr As String
strAttr = "Description=Connect to autostore" & _
C hr$(13) & "OemToAnsi = No" & _
C hr$(13) & "Address=\\MAINSERVER\AUTOSTORE\" _ & C hr$(13) & _
"Database=Autostore"
rdoEngine.rdoRegisterDatasource rS e rv erD S N ,_ "SQL Server", _
True, sqlAttr
If grdfEnv Is Nothing Then
rdoEngine.rdoDefaultCursorDriver = rdUseOdbc
Set grdfEnv = rdoEngine.rdoCreateEnvironm ent _
("", "", "")
Set grdfConn = grdfEnv.OpenConnection _
(rServerD SN , rdDriverNoPrompt, False, _
rServerU ser)
grdfConn.QueryTimeout = 0
End If
rdfInitializeExit:
DoCmd.Hourglass False
Exit Function
rdfInitializeErr:
For Each errX In rdoEngine.Errors
MsgBox " " & errX.Num ber & " " _
& errX.Source & ": " & errX.Description, _
vbCritical, "rdfInitialize()"
Next errX
rdfInitialize = False
Resume rdfInitializeExit
End Function
rdoErrors . Clear
rdoError . Item rdoError .
, :
m yRdoError=rdoEngine.rdoErrors.Item (1)
m yRdoError=rdoEngine.rdoErrors(1)
Count rdoError .
rdoError.

Description ,
.
HelpContext HelpFile
Microsoft Windows,
HelpContext ,
,
.

converted to PDF by HupBaH9I

Help-File

Source

.

ODBC rdoError
rdoErrors.
RDO,

"MSRDO32".
,
,
Source.

SQ LRetCode


RDO. Long

:
rdSQ LSuccess -
;
rdSQLSuccessW ithInfo -

;
rdSQLNoDataFound -
;
rdSQ LError - ,
;
rdSQLInvalidHandle -
.

SQ L-State

,
SQ LState,
,

.
"01"
,
rdSQLSuccessW ithInfo.

RDO rdoConnection,
. rdoConnection
, ,
ODBC ,
. , ,
rdoConnection,
, Comm itTrans .
, Com m itTrans (
RollbackTrans) rdoEnvironment.
rdoConnection ,
RDO. rdoTable
(View ), . rdoTable
.
, ,
,
, .
rdoTable ,
, . rdoTable
rdoTables. ,
:
Set m yrdEnv =rdoEngine.rdoEnvironm ent(0)
Set myrdConn=m yrdEnv.OpenConnection("Toautostore", _ rdDriverNoPrompt, False)
Set myrdTable = myrdConn.rdoTables("account")
:
Set myrdTable = m yrdConn.rdoTables!account
rdoTable rdoTables,
:

converted to PDF by HupBaH9I

Set m yrdEnv =rdoEngine.rdoEnvironm ent(0)


Set myrdConn=m yrdEnv.OpenConnection("Toautostore", _ rdDriverNoPrompt, False)
Set myrdTable = m yrdConn.rdoTables(2)
, , rdoResults.

.
.
Visual Basic 4 .0 Entreprise Edition ,
text1.
Private Sub Form _Load()
' ' Workspace
Dim RDE As rdo.rdoEnvironment
' - ,
'
' ODBC API,
'
' ,
' ,
'
Dim rdConn As rdo.rdoConnection
' ,
' , ,
Dim rdoTab As rdo.rdoTable
Dim rdoCol As rdo.rdoColumn
Dim rdoRst As rdo.rdoResultset
Dim errX As rdoError
' rdoDefaultCursorDriver ,
'
' ' ODBC
'
' ,
'
rdoEngine.rdoDefaultCursorDriver = rdUseServer
'
Set RDE = rdoEngine.rdoCreateEnvironm ent("", "", "")
'
Set rdConn = RDE.OpenConnection("m yteach",_rdDriverNoProm pt, False)
'
On Error GoTo rdfInitializeErr
'
' ,
'
' Set rdorst=
'rdConn.OpenResultset("M yTable",rdOpenDynam ic,rdConcurValues).
' ,
' OpenResultset
' rdoTable .
', .
Set rdoTab = rdConn.rdoTables("MyTable")
'
Set rdoRst = rdConn.OpenResultset(rdoTab.Nam e, _
rdOpenDynam ic, rdConcurValues)
'
Set rdoCol = rdoRst.rdoColum ns(1)
rdoRst. Edit
rdoCol.Value = 27
rdoRst.Update
Me!text1 = rdoCol.Value
Exit Sub
rdfInitializeErr:
If Err.Num ber = rdoEngine.rdoErrors(0).Num ber And _
rdoEngine.rdoErrors.Count >> 1 Then

converted to PDF by HupBaH9I

For Each errX In rdoEngine.rdoErrors


MsgBox "Error " & errX.Num ber & " " _
& errX.Source & ": " & errX .D escription,_
vbCritical, "rdfInitialize()"
Next errX
Else
MsgBox "Error " & Err.Num ber & " " _
& Err.Source & ": " & Err.Description, _
vbCritical, "rdfInitialize()"
End If
End Sub
rdoResultset OpenResulset,
rdoConnection, rdoTable rdoPreparedStatem ent ( ).
OpenResultset ,
rdoConnection
Set Variable = Connection.OpenResultset(Source[,
7ype[, Locktype[, Options]]])
rdoTable rdoPrepraredStatement
Set Variable = Ob/ect.OpenResultset([ 7ype[,
Locktype [, Options]]])

Set rdoRst = rdConn.OpenResultset(rdoTab.Nam e, _
rdOpenDynam ic, rdConcurValues)
, rdoTable,
, rdoPreparedStatem ent SQ L .
, ,
. , SQL
:
Set rdoRst=rdConn.O penResulset("SELECT * FROM MYTABLE", _
rdOpenDynam ic, rdConcurValues)
Source ( )
, , ,
.
Set rdoTab = rdConn.rdoTables("MyTable")
Set rdorst=rdoTab.OpenResultset(rdOpenDynam ic,rdConcurValues)
, , ,
, W HERE,
,
.
rdoPreparedStatem ent,
OpenResulset.
rdoPreparedStatement rdoConnection
CreatePreparedStatem ent, :
Set Prepstmt = Connection.CreatePreparedStatem ent(N am e, Sqlstring)
Name - rdoPreparedStatement.
- Sqlstring - SQL. ,
(""). , ,
rdoPreparedStatem ents. ,
,
prepstmt - rdoPreparedStatem ents(2).
rdoPreparedStatem ent rdoParam eters,
Source OpenResultset.
:

converted to PDF by HupBaH9I

S Q LStr= "SELEC T * FROM Account WHERE account = ? A N D _ summa >> ?"


Set myprepst=myrdConn. CreatePreparedStatem ent("From Account",SQ LStr)
'
m yprepst.rdoParam eters(0)= 104
m yprepst.rdoParam eters(1)= 25000
Set m yrdRst= m yprepst._ OpenResulset(rdOpenDynam ic,rdConcurValues)
OpenResultset, 7ype,
Integer.

rdOpen rdoResultset,
ForwardOnly
(
).
,

.


rdOpenStatic

. ,
,
,

.
RdOpenKeyset


.
.
,
,

.
.

RdOpenDynamic


.
.
,
,

.
.

.
, rdOpenForwardOnly.
- , ,
.
,
. ,
.
LockType ,
.
Integer, :

rdConcurLock

,
,
Edit.

.

RdConcur-

converted to PDF by HupBaH9I

ReadOnly

, ,

rdConcurRowver

,

Update.


.

rdConcurValues ,

Update.

.
Option .
,
.
RDO - rdoColumns.
rdoColumn
.
MoveFirst, MoveLast, MoveNext MovePrevious, ,
DAO.

8.6. SQL-DMO
Microsoft SQ L Server.
.
,
OLE . ,
Visual Basic, ,
DMO. ,
Microsoft SQ L Server.
. , SQ L Server ,
Windows 95, ,
, .
SQ L Server, Entreprise Manager
Books On-line.
SQL-DMO , Windows 95
Windows NT, :

SQLOLE.H LP - SQL-DMO;
SQ LO LE.R EG - ;
SQ LO LE65.D LL - in-process SQL-DMO ;
SQ LO LE65.TLB - , OLE
Automation;
SQ LO LE65.SQ L - transact-SQ L .

DMO - Distributed Management Object - .


- .

DMO . ,
, ,
. , ,
, .
,
, , SQL-DMO
. QueryResults,
.
. 8.15 SQL-DMO , . 8.8
.

converted to PDF by HupBaH9I

:. p eccrp a
2
(3 - j S tftw *
-

| ~

_ l Ecrtsnd

| { ) ]

( ' !

_ | Genigiaphiei
0 Q MiaoSofl

| B e c k g n x n f etch

* 1'

| C ollate

H ecW

0 Q

| Description

ODBC

C l esc in;

ffl-Q FootfTw
- b26
0 I
0 Q IHJIWDd

, C S W ItJ 3 S \S V E T E W \v fp c tb c [flf

| Exclusive

""
"

|S e i4 o C o u n l0 n

|Sour;=OE

0 _J rnw^cnealatlacDenbdtq

C J QDBC

| D nvei

^SourceType

LlC\fta^ec^_l)*^A^ala,D0C,
"

_ | U D B C D * S jr e

Q
Q

supeibase

1L

_______________ ill .

iur>iribaT4WKEY_CURRNTJJSER\ol(w3reDBC\DOBC,lNKvfp34

. 8 .1 5 .
8 .8 . SQL-DMO

Alert

AlertSystem
Application


,
SQ L Server,
.

SQ L Server.

,
SQ L Server,
.

Article

,
. - ,
,
.
TableName DestinationTableName
,
.
InsertCom m and, UpdateCommand
DeleteCommand
transact-SQ L,
, .
ReplicateAllColumns
ReplicationFilterProcName
,
.

Backup

BulkCopy



( )
SQ L Server.
.
ExportData
Im portData Table View.

Check

Column


,
.
ExcludeReplication
.

, ,

converted to PDF by HupBaH9I

,
NULL . .
Configuration


.
ConfigValue,
, .


ReconfigureCurrentValue
ReconfigureWithOverride.

ConfigValue

,
.

Database

,

, Table, StoredProcedure . .

ExecuteWithResult.

DBObject

,

,
Table, View, Rule . .

DBOption

,
. ,
,
. .

Default

,
.

Device


(,
, . .).


,
.

DRIDefault

Executive

Group

History-Filter

Index


EnumHistory
PurgeHistory SQ LServer Task.
.
,
, ,

.

IntegratedSecurity ,
SQ L Server

Windows NT.
Key

Language
Login

Names

,
.
.

, SQ L Server.

.
SQ L Server;
User .

converted to PDF by HupBaH9I

.
Operator

,
,
, . .

Permission

Publication

(
), .
AddFullSubscriber ,

.

QueryResults

,
.
ExecuteW ithResults
SQ LServer, Database Rem oteServer.

.

RegisteredServer SQ L
, ServerGroup
SQ L Enterprise Manager.
Server Manager
.
Registry
Remote-Login

Rem ote-Server
Rule
Server-Group
SQ LServer

Stored-Procedure

Subscriber-Info

Subscription

,
Windows SQ L Server.

SQ L Server
.
SQ L Server,
.

.
, .
.
SQ LServer

, Connect.
Transact-SQ L,
.
Text
DLL,
.

,
(
ActiveStartDate A ctiveEndDate),
,
. .
,
.

System -Datatype
SQ L Server.
Table

().
,
,
. .

Task

TransactionLog


.


.

converted to PDF by HupBaH9I

Transfer


( Database)
, .

Trigger

.

Script.
Type.

User

User-DefinedDatatype
View

.

.
.
, . Text
S E L E C T Transact-SQ L
.
.

DMO Application,
.
SQL-DMO
, . Visual Basic
. .
. ,
. ,
Properties, Property .
, . :
For Each oProperty in oSQ LServer.Properties
Debug.Print oProperty.Name & " = " oProperty.Value
Next
Visual FoxPro
. 3.0 . ,
, , Visual Basic
:
For Each oDatabase in oSQ LServer.D atabases
Debug.Print oDatabase.Nam e
Next
Visual FoxPro :
nDBNum = oSQ LServer.D atabases.Count
FOR nItem = 1 TO nDBNum
? oSQ LServer.oD atabases(nItem ).N am e
NEXT
Add.
- Remove.
, SQLDMO , - (list), .
DMO,
, ,
.
SQ L DMO, Access
Visual Basic, SQ LServer:
Global M yServer As New SQ LO LE.SQ LServer
Visual FoxPro,
C R E A T E O B JE C T ():
oM yServer = CREA TEO BJECT("SQ LO LE.SQ LServer")

converted to PDF by HupBaH9I

.
, ,
.
, Connect SQ LServer, ,
:
oM yServer.Connect(Servernam e:= "A utoserver",_ Login="Me",Password="You")
,
. :
Function SQLLogin(strServerN am e As String, _strU ID As String, strPWD As String) As Boolean
' SQ L ,
' .
' SQ LServer
' ,
' - .
On Error GoTo SQLLoginErr
Const erSQLAlreadyLoggedIn = -2147211004
SQLLogin = True
DoCmd.Hourglass True
m ySQ LServer.Connect strServerN am e, strU ID , _strPW D
SQLLoginExit:
DoCmd.Hourglass False
Exit Function
SQLLoginErr:
Select Case Err.Num ber
Case erSQLAlreadyLoggedIn
SQLLogin = True
Resume Next
Case Else
MsgBox "Error " & Err.Num ber & ": " & _
Err.Description, vbCritical, "SQLLogin()"
End Select
SQLLogin = False
Resume SQLLoginExit
End Function
.
, SQL-DMO
. Disconnect SQ LServer:
oM ySqlServer. Disconnect

,
. , ,
, , .
,
, , :
Function SQLM akeNewDatabase(strNam e As String, _strD eviceN am e As String, lngSize As Long)
' SQ L Server
On Error GoTo SQLM akeNewDatabaseErr
SQLM akeNewDatabase = True
Dim objNewDatabase As New SQLO LE. Database
If Not gobjSQ LServer Is Nothing Then
DoCmd.Hourglass True
With objNewDatabase
.Name = strName
End With
'
'
gobjSQ LServer.Databases.Add objNewDatabase

converted to PDF by HupBaH9I

'
With objNewDatabase
.ExtendOnDevices (strDeviceNam e & "=" & _ CStr(lngSize))
.Shrink (lngSize)
End With
Else
SQLM akeNewDatabase = False
End If
SQLM akeNewDatabaseExit:
DoCmd.Hourglass False
Exit Function
SQLM akeNewDatabaseErr:
MsgBox "Error " & Err.Num ber & ": " & _Err.D escrip tion , _vbC ritical, "SQLM akeNewDatabase()"
SQLM akeNewDatabase = False
Resume SQLM akeNewDatabaseExit
End Function
,
.
Dim oTable As Table
Dim oCol As Column
Set db = ss.Databases("pubs")
For Each oTable In db.Tables
'
Set oCol = New Column
oCol.AllowNulls = True
oCol.Datatype = "varchar"
oCol.Length = 30
oCol.Name = "NewCol"
oTable.BeginAlter '
oTable.InsertColum n oCol, ""
oTable.DoAlter '
Next oTable
, , BeginAlter,
DoAlter.
, BeginAlter.

:

Alert
AlertSystem
Article
Executive
Operator
Publication
Rem oteServer
SubscriberInfo
Subscription
Table
Task

,
, , ,
.
- .
, SQLDMO - -.

converted to PDF by HupBaH9I


9 .1 .
9 .2 .
" " Visual FoxPro
" " Access
9 .3 .
Visual FoxPro
Access
,
, .
,
.

. ,
, .
Microsoft "Putting It All Together!" " !"

. ,
,
. ? .

9.1.

.
(Visual FoxPro, Visual Basic Access) ,
. Visual Basic Access
, Visual
FoxPro ,
.
,
.
, , .
,
, -
. Visual
FoxPro Visual Basic ,
.
, , .
,
.
-

.
- Windows API.

Windows API - , ,
.

Windows API
:

. , ,
,
Visual FoxPro Visual Basic.
.

converted to PDF by HupBaH9I

,
.
.
Windows API ,
,
.

Windows API
,
. , ,
, ,
Visual,
. , Microsoft
Windows API
.
Visual FoxPro ( CD-ROM) Visual Basic
Windows A PI,
.
Windows API,
. -,
. - -
, . DECLARE.
Visual Basic :
[Public | Private] Declare Function FunctionName Lib "LibraryName" [Alias " AliasName" ]

[([Param List])][As ParamType]


Visual FoxPro :
DECLARE [cFunctionType] FunctionName IN LibraryName [AS AliasName] [cParam Type1 [@]
Param Nam e1,cParam Type2 [@] ParamName2, ...]
,
.
:

FunctionName, DLL.
!
- ,
cFunctionType. , , Visual Basic Public
,
. Private
.
DLL Windows LibraryName, .
, API Windows,
W IN32API, :
KERN EL32.D LL, G D I32.D LL, U SER 32.D LL, MPR.DLL ADVAPI32. DLL.
Visual FoxPro Visual Basic.

.
,
DLL Windows. @
, , .
, DLL
. DLL
(null pointer),
.

Visual Basic :
[Optional][ByVal | ByRef][Param Array] varnam e[( )][A s ParamType]

converted to PDF by HupBaH9I

ByVal ByRef , .
,
:


Integer

Long

String



16-
.



32
.

16

.


32
32-
. .

32-
.

,
,
( C H R (0 ))
.
32
.

32

.

,
DLL .

(handle) - , .

Windows .
, , , , . . ,
; " ". Windows API C r e a t e P e n ( )
"", .
, ,
D e s tro y O b je c t().
Windows API.
, .
, Visual FoxPro ,
, .
( ).
.
.

API Windows ( C,
WIN32API.HLP):
DW ORD GetLogicalDriveStrings (D W O R D nBufferLength, LPTSTR IpBuffer);
.

U I N T GetDriveType (L P C T S T R IpRootPathNam e);
:
0 - ;

converted to PDF by HupBaH9I

1
2
3
4
5
6

;
;
;
;
;
.


.
,
, ,
:
U I N T SetErrorM ode(UINT fuErrorM ode);
. Visual FoxPro
, + + ,
DW ORD ( ) U I N T ( ) 4
INTEGER.
, ,
.
Project Manager Classes New
New Class , , ,
, . ,
.
lstDrives :

BoundColumn = 2 ( );
ColumnLines = .F. ( );
FontSize = 12 ( , 10,
).

Init :
*
*
DECLARE IN T E G E R GetLogicalDriveStrings IN Win32API AS GetDrive;
IN TEG ER , STR IN G
*
DECLARE IN T E G E R GetDriveType IN Win32API AS GetType;
S TRIN G
*
LOCAL cLetter, nLetter, NType, nDrivesNum
*
*
lpString=SPACE(200)
*
nBuffSize=LEN(lpString)
*
= GetDrive(nBuffSize,@lpString)
*
nDrivesNum = O C C U RS(":",lpString)
*
FOR nLetter = 1 T O nDrivesNum
cLetter = UPPER(" " + SU B STR (lp Strin g ,A T(":",lp Strin g,n L etter)-1,1 ))

nType = GetType(ALLTRIM(cLetter + ":\"))
( )
( )
This.AddItem(cLetter, nLetter, 1)
This.List(nLetter, 2) = S T R (n T y p e )

DO CASE
CASE NType = 2

converted to PDF by HupBaH9I

This.Picture(nLetter)
CASE NType = 3
This.Picture(nLetter)
CASE NType = 4
This.Picture(nLetter)
CASE NType = 5
This.Picture(nLetter)
ENDCASE
ENDFOR

= "FLOPPY.BMP"
= "DRIVE.BMP"
= "NET.BMP"
= "CDROM.BMP"

.
, , Visual FoxPro,
IC O 32x32.
16x16. , Imagedit Visual
FoxPro. , Visual FoxPro
, , .
, , , , ,
, .
- ( MSK),
.
, Wizard ()
.
Click :
LOCAL cLetter
cLetter = This.DisplayValue + ":"
* ,
*
* IsDiskIn
IF ALLTRIM(This.Value) = "2"
IF This.IsDiskIn(cLetter) = .T.
This.Parent.cmdOk.Enabled = .T.
ELSE
= MESSAGEBOX(" !",0,;
" ")
IF This.IsDiskIn(cLetter) = .T.
This.Parent.cmdOk.Enabled = .T.
ELSE
This.Parent.cmdOk.Enabled = .F.
ENDIF
ENDIF
RETURN
ENDIF
This.Parent.cmdOk.Enabled = .T.

N ew M ethod Class IsDiskIn()
:
LPARAMETERS cDrive
LOCAL lOldError
* SetErrorMode, ,
* ,
*
DECLARE IN T E G E R SetErrorMode IN Win32API IN TE G E R
*
lOldError = ON('ER ROR ')
ON ERROR lDiskError = .T.
* SetErrorMode 1
*
*
nOldErrorState = SetErrorMode(1)
* , , ,
*
lDiskError = .f.

converted to PDF by HupBaH9I

* NUL
*
lDriveState = FILE(cDrive + "\NUL")
IF .NOT. lDiskError
IF lDriveState
lDriveOk = .t.
ELSE
lDriveOk = .f.
ENDIF
ELSE
lDriveOk = .f.
ENDIF
*
IF .NOT. EMPTY(lOldError)
ON ERROR DO (lOldError)
ELSE
ON ERROR
ENDIF
*
nRestState = SetErrorMode(nOldErrorState)
RETURN lDriveOk
.
Windows API
.
, Visual
FoxPro ( Line). Paint :
nY = 1
FOR nX = 5 T O 375 STEP 5
ThisForm.Line(nX, nY*100)
nY = -n Y
ENDFOR
Windows API. Paint
:
***
DECLARE IN T E G E R GetDC IN WIN32API IN TE G E R
* HW ND
***
DECLARE IN T E G E R ReleaseDC IN WIN32API IN TEG ER , IN TE G E R
* HW ND
* HDC
***
DECLARE IN T E G E R LineTo IN WIN32API IN TEG ER , INTEG ER , IN T E G E R
* HDC
* int nXEnd x -
* int nYEnd y -
***
DECLARE IN T E G E R MoveToEx IN WIN32API IN TEG ER , IN TEG ER , IN TEG ER , STRIN G
* HDC
* int X x -
* int Y y -
* LPPOINT (N ULL in FoxPro)
*** GetFocus H W ND
DECLARE IN T E G E R GetFocus IN WIN32API
mynull = .NULL.
pmhand = GetFocus()
IF p m h a n d < < > > 0 &&
hmdc = G e tD C(pm hand)
= MoveToEx(hmdc, 0, 0, mynull)
nY = 1
FOR nX = 5 T O 375 STEP 5
= LineTo(hmdc, nX, nY*100)

converted to PDF by HupBaH9I

nY = -n Y
ENDFOR
= ReleaseDC(pmhand, hmdc)
ELSE
W A I T W IN D O W " "
ENDIF
, .
Windows API .
.
- (device context).
?

- , -
.


- (, )
.
, .
. , ,
Windows ,
, , .
,
. " ",
. :

,
, , , .
( Pen) , .
( Brush) ,
, .
( Font) , .

, Windows API,
. , Windows API
.
Visual Basic -
. Visual FoxPro
.
.
Dial-Up
Networking. Windows . Visual FoxPro
:
DECLARE IN T E G E R RasDial IN rasapi32 ;
ST R IN G DialExtetions, ;
ST R IN G cPhonebookfile, ;
ST R IN G @ cParameters, ;
IN T E G E R nCallBack, ;
ST R IN G cCallBack, ;
ST R IN G @ nConnHandle
nConnHandle = C H R ( 0 ) + C H R ( 0 ) + C H R ( 0 ) + C H R ( 0 )
&&
cConnName = "RcomPPP" &&
cPhone = "2594277"
&& ,
cUserName = "Administrator" &&
cPassWord = "AndreyG" &&
cDomain = "" && Windows N T
*
cParam = C H R ( 2 8 ) + C H R ( 4 ) + C H R ( 0 ) + C H R ( 0 ) + ;

converted to PDF by HupBaH9I

PA D R (cC o n n N a m e+ C H R (0), 2 5 6 + 1 ) + ;
P A D R (C H R (0 ), 1 2 8 + 1 ) + ;
P A D R (C H R (0 ), 1 2 8 + 1 ) + ;
PAD R (cU se rN a m e +C H R (0 ), 2 5 6 + 1 ) + ;
PADR(cPassword+CHR(0), 2 5 6 + 1 ) + ;
P A D R (cD om a in + C H R (0), 1 5 + 1 ) + " "
*
nRes = RasDial(NULL, NULL, @cParam, 0, NULL, @nConnHandle)
, Visual Basic, :
Private nConnHandle As Long, nRes As Long
'
Private Typ e DIALPARAMS
dwSize As Long
szEntryNam e(256 + 1) As String
szPhoneNumber(128 + 1) As String
szCallbackNumber(128 + 1) As String
szUserName(256 + 1) As String
szPassword(256 + 1) As String
szDomain(15 + 1) As String
End Type
Private ConnParams As DIALPARAMS
'
Private Declare Function RasDialA Lib "rasapi32" _
(DialExtetions, _
cPhonebookfile, _
ByRef Parameters As DIALPARAMS, _
nCallBack As Long, _
cCallBack, _
ByRef hConnHandle As Long) As Long
'
nRes = 0
nConnHandle = 0
' dwSize Windows 95
ConnParams.dwSize = 1052
' Windows
C onnParams.szEntryName(0) = "R"
C onnParams.szEntryName(1) = "c"
C onnParams.szEntryName(2) = "o"
C onnParams.szEntryName(3) = "m"
C onnParams.szEntryName(4) = "P"
C onnParams.szEntryName(5) = "P"
C onnParams.szEntryName(6) = "P"
C onnParams.szEntryName(7) = C hr(0 )
'
ConnParams.szPhoneNumber(0) = C h r(0 )
ConnParams.szCallbackNumber(0) = C hr(0 )
ConnParams.szUserName(0) = "A"
ConnParams.szUserName(1) = C hr(0 )
ConnParams.szPassword(0) = C h r(0 )
ConnParams.szDomain(0) = C h r(0 )
'
nRes = RasDialA(Null, Null, ConnParams, 0, Null, nConnHandle)

9.2.
, ,
,
.

.
,
.

converted to PDF by HupBaH9I

, ( ).

.
, ,
, .
.
, Visual Basic, , Access, Visual FoxPro
-, . ,
,
.
, ,
. , (Properties)

. , ,
( ).
, " " ,
.
.
, ,
.
,

.
.
RecordSource
( ) .
,
, ControlSource () .
,
, , , , ,
, .
, . , ,
. -
, .
. ,
. ,
, , ,
. .
, , ,
, ,
, .
Access ,
(D A O ).
, .
Order_ .
O rd e r_ .
,
Order_.
.
key_order , . key_salman
( Access)
( Visual FoxPro).
, ( Access),
.
, , ,
, ""
.
, , Model, ,
, Account.
.

" " Visual FoxPro


Visual FoxPro.
:

converted to PDF by HupBaH9I

.
"" .
N e w File Visual FoxPro.
New Form.
C R E A T E FO R M .
Project Manager Form New.

,
. 9.1.
Visual FoxPro Form , :

Form Designer

Fomn
| |

V ....n il F ll P .ri

E>

E * jtyf j

Uelf.'

* NSwUeitodi
F l iid

I-........
...... 1 . i . i

t'ugipni 1

Ntrir '-'-'/

p | g | B l4 N
> F I IP IP D ' 1:: 1|1

loot*

1 .1 1 .1
L ']

1 1 ;jL.i.LL..LJ...LiL

...L.L.LjU
..
...

i
3
...

[ ?

JB 0O

- I

judijsJip R io...

object


P f t m p w F a m 1

ja

A r d N fht '
Fa

tii

| Dam || Lfoul


,t ..

...j..

Fame.

i ;

, ; |

gaiai\

frm
| | 1 1 1 lw B i M i i

* 1

bfrFt.m

VI

i n
m

M d O tfe e t
A K * y )0 * T tp
A ito C n itw
nuh f t *

j . Jur^l/lu
B ar
B u ta M n fs

........
F h * iL r iiu li

j t ;.jL'd Balder
l r:. 5'. .. t'.r

-rj

Ooow 1 aFfl iriSft Rum. cnPba*


I. f

H 'r . i o n i r . t r .

rj

ToulQ O : - jb it J

tmwi.
?1--;. ^rd i.

rfr*tiddt

P roperties

Layout
Form C o r I rots


C o lo r P a le tte

. 9 .1 .

N e w p rop erty - .
N e w m ethod - .
Edit Property/M ethod -
.
Include File - , .
Create Form S e t - - ,
.
Rem ove Form S e t - , .
A d d N e w Form - .
Rem ove Form - .
Quick Form - (Form Builder),

.
.
Run Form - .

converted to PDF by HupBaH9I

.
F o r m D e s i g n e r
.
. . 9.2.

Form Designer
S -!

Is


: =1 (Fomn Btilder)
Layout
CcJor Palene
BzIeoi; - Form Control

Properties
(Data Environment)

. 9 .2 .
L a y o u t
. ,
. 9.3. -
, S h ift .
, ,
,
C trl.
, , Undo
Visual FoxPro.

I nrjnut
|=|||--|| i$ | =] | | 1 || | | ^ | l j |

ITiMfn-.THTi.

li^i .iI ht

i-


sc

RkipahHURSHUfl iraaMrtpflR Rhy^fll4-IHH rjfi>i4KTrtR

:
, 1-1
l-l.fjLiL-TT fJ L

1/ 1/.-


ihc rpci 1
iLiBai :

^ i j 1
. 9 .3 . Layout

converted to PDF by HupBaH9I

F o r m C o n t r o l s
. . 9.4
.

Objects ' CnyvMT jma

ue rjftw?imoR i;y ?

View ClaSSSS

: CtiymL'i ,ilhh uihukh i/ijiiuj ibjycMbi- (jh Cjiliuick.

Lfcbel

: -,

Te*t Bow

: P^oiv ,

Edil

: -1.', ? 1

u -

C u m i r i a i d B u L L'jii

: l l a i o j u j h /js h h h kucjiih:h

C o m m e n d B u tto n C r o u p

rnanai-:

Clptirn K iit-rn c-Srnin : ,


Check B d *
Combo Dov
List Box

Spinner

^.

Grid

^ -_

It a g s

P a a i- ,

T i m e 1'

^ ./ apewe-iLi /

PageFrame

C Q i ^ a i T . , ^

O L E 2.C

H i'cn a
0 6 & " - C L E -

O L E Bojnd

G e n e ra l

Line

^^ ^ -! | - pgjnWH | P IM n cf

bhEpe

1-1; , .
31:11(5(
^ *
ha

Se p a ra b r

Buiidsr Luck

- Ehl6p3TL LliO -'


,
] 01I13 fiUfiTOfli IHFl
; ] , --
. 1- - , .
L l^ n u ib a ^ e ic H ^jjih i -

Button Lcck


^ |1- ^
-

. 9 .4 .
,
Options Tools. Forms
(. 9.5).
.
- 6 10.
- Pixels. Maximum Design Area 640x480 - ,
,
VGA. ,
,
.

converted to PDF by HupBaH9I

Bicnjcwei ine

c c to i

*
[

G enera]

Prrjsds

GdiiItd Ii

Intemnii
' SdaivPoalBan

HG rid Linas

'S n o p lD Gri I

l a b :

DriIG1nI 3f]<icing
I (pixels]:

V e rtic a l S p a rin g

Boode Units:

Mcwimurn CfeEign^rea;

-T em plata CfaspgsI

harm Lict

InflirajDim(DWVar (S\Rndin5BMC^par1.vcxJ

BuifcJerLDck

S et a s Default

Cancel

H elp

,
,

^

. 9 .5 .
-
, Properties,
: "All", "Data",
"Methods", "Layout", "Other". Properties . 9.6.

converted to PDF by HupBaH9I

Propcihes - ra lc_sq l sc h

J a l* J

bject:

I Forml

*3 ~

id

All | Data j Methods] Layout j Other

hsm

!
^ f^ T ru e

A iio C e n te k

Y 3 2 , i a 2 r'*
t '
a 2-.^Tr%

"
i*#r iW* telft

EaseClass
BderS(ylfc
[
EuflerM odH

,
.

,

-.


OTAteHHTb


Enler
.

FlVf}!
\ A - Sizabte Border
[BtefaiiltJ
0 - H o n e [D afaJtJ

L-aptioi'i

Circle ............... ......... J D c fO ljItlX .............
ass
A
assLibiary
iDfefaujti
\
Q fc k E vent
ipCcrttrols
,T. -T r u e [Default]
. F , - F a ls e
C bsable

Specifiesthetent displayed ir an obieci's


caption




.

, ,
,
.



Enler
ki-

<Expression Builder,
Eft

, ,
Left, . .

. 9 .6 . ( Properties)
"All" , .
Properties, :
AutoCenter = .T. - Form;
BackColor = R G B ( 1 7 6 , 1 7 6 , 1 7 6 ) - ;
Caption = - , ;
Closable = .F. - Form,
, Close;
Height = 300 - ;
Icon = "c:\mybook\sample\net13.ico" - ,
Form ;
MaxButton = .F. - Maximize;
MinButton = .F. - Minimize;
ShowTips = .T. -
;
Width = 540 - .
, Label, Text
Box, Command Button, Combo Box, Shape,
.
.
.
mygo Container ().
mygo1, mygo.
,
.

, .
N ew File Visual FoxPro.
New Class New
File. New Class (Class Name), ,

converted to PDF by HupBaH9I

(Based O n ), (Store In ),
(. 9.7). Project Manager Classes New.

Ell

J New Class
N ew Class In fo -

OK
Class Name:

m ijg tj

B ased On:

C ontainer

J 1

C ancel

From:
Store In:

c: \m yb ook\sannple\roub. vex

. 9 .7 . New Class
. 9.7, mygo, Container ,
, - Roub.vcx
Form
Controls, .
:
1.
2.
3.

View Classes Form Controls.


Add.
Open Open.

mygo ,
, , ,
, , ,
, . . 9.8
mygo. . 9.1 mygo
ToolTipText .

ClassDesignm- roub.vcx [mygo|


I
' l
<

>
f

P?RE3
!

jl U

Form: [Fwnfl

~~3

P e jw p

~3

. 9 .8 .
9 .1 . mygo

Com1

Com2

Com3

Com4

Com5

Com6

Com7

Com8

Com9

Com10

converted to PDF by HupBaH9I

, m y_show _s_u myrefresh,


Form New Method.
m y_show _s_u :
ThisForm.mygo1.Com8.Enabled = .F.
ThisForm.mygo1.Com9.Enabled = .F.
MyUpdate = 0
IF D e l_ = 0
ThisForm.mygo1.Myrefresh
ELSE
Del_ = 0
ENDIF
myrefresh :
ThisForm.Text1.Refresh
ThisForm.Text2.Refresh
ThisForm.Text3.Refresh
T h isF o rm .T ext4. Refres h
ThisForm.Refresh_list
Click Com1 :
G O TO P
ThisForm.mygo1.Com1.Enabled = .F.
ThisForm.mygo1.Com2.Enabled = .F.
ThisForm.mygo1.Com4.Enabled = .T.
ThisForm.mygo1.Com5.Enabled = .T.
ThisForm.mygo1.MyRefresh
Click Com2 :
IF B O F() = .F.
SKIP -1
ThisForm.mygo1.Com4.Enabled = .T.
ThisForm.mygo1.Com5.Enabled = .T.
ELSE
ThisForm.mygo1.Com1.Enabled = .F.
ThisForm.mygo1.Com2.Enabled = .F.
G O TO P
ENDIF
ThisForm.mygo1.MyRefresh
Click Com3 :
DO FORM Find_ord.scx
Click Com4 :
IF E O F () = .F.
ThisForm.mygo1.Com1.Enabled = .T.
ThisForm.mygo1.Com2.Enabled = .T.
SKIP 1
IF E O F () = .T.
ThisForm.mygo1.Com4.Enabled = .F.
ThisForm.mygo1.Com5.Enabled = .F.
G O BO TTOM
ENDIF
ELSE
ThisForm.mygo1.Com4.Enabled = .F.
ThisForm.mygo1.Com5.Enabled = .F.
G O BO TTOM
ENDIF
ThisForm.mygo1.MyRefresh
Click Com5 :
G O BO TTOM
ThisForm.mygo1.Com1.Enabled = .T.
ThisForm.mygo1.Com2.Enabled = .T.
ThisForm.mygo1.Com4.Enabled = .F.
ThisForm.mygo1.Com5.Enabled = .F.
ThisForm.mygo1.MyRefresh
Click Com6 :
IN S E R T I N T O order_view (key_salman, key_customer, key_model) ;
VALUES (order_view.key_salman, order_view.key_customer, order_view.key_model)
MyUpdate=1
ThisForm.mygo1.Com8.Enabled = .T.

converted to PDF by HupBaH9I

ThisForm.mygo1.Com9.Enabled = .T.
ThisForm.Text1.Visible=.F.
ThisForm.mygo1.MyRefresh
Click Com7 :
Answer_d = M ESSA GEBO X (" ?", 4 + 3 2 + 2 5 6 , "")
IF An sw er_d = 6
DELETE
D el_=1
SKIP 1
IF E O F () = .T.
G O BO TTOM
ENDIF
MyUpdate=1
ThisForm.mygo1.Com8.Enabled = .T.
ThisForm.mygo1.Com9.Enabled = .T.
ThisForm.mygo1.MyRefresh
ENDIF
Click Com8 :
= T A B L E U P D A T E (.T .,.T .)
ThisForm .m ygo1.M y_Show _s_u
Click Com9 :
= T A B L E R E V E R T (.T .)
ThisForm .m ygo1.M y_Show _s_u
Click Com10 :
IF MyUpdate=1
Answ er_s_u = MESSAGEBOX(" ?", 4 + 3 2 , "")
DO CASE
CASE A n sw e r_s_u = 6 &&
= T A B L E U P D A T E (.T .,.T .)
CASE A n sw e r_s_u = 7 &&
= T A B L E R E V E R T (.T .)
ENDCASE
ThisFo rm .m yg o1 .M y_Show _s_u
ENDIF
ThisForm.Release
. . 9.9
,
.

converted to PDF by HupBaH9I

))1

LCSTAOTO

T tn tiltd

Click

)]
Fan Ini

PROP M OD

niii*
U l
^-

^ '.

|~

|C o n b o 1


Lrt&:1tiT4Llitltnew

:
:

J]nil I_

: |11

K(W |

CnnbaZ

Iri -^

: []

1 > * "
F IN D O H D

CvCcrua ppi .

VLjjihtw _ s _ i
M jra fre a k

!*)

^
Rnfimk lirrt
*(
Combo idt

FDim .ITnival

. 9 .9 . ,
Load :
&& O D BC auto Auto_store
OPEN DATABASE Auto_store EXCLUSIVE
CREATE C O N N E C T IO N remote_01 DA TASO UR C E auto
DO CASE
CASE LevDostup=1
= DBSETPROP('remote_01', 'C O N N E C TIO N ', 'ConnectString', ;
'D S N = a u to ;U ID = lo g in _le v1 ;P W D = le v1 ')
CASE LevDostup=2
= DBSETPROP('remote_01', 'C O N N E C TIO N ', 'ConnectString', ;
'D S N = a u to ;U ID = lo g in _le v2 ;P W D = le v2 ')
CASE LevDostup=3
= DBSETPROP('remote_01', 'C O N N E C TIO N ', 'ConnectString', ;
'D S N = a u to ;U ID = lo g in _le v3 ;P W D = le v3 ')
CASE LevDostup=4
= DBSETPROP('remote_01', 'C O N N E C TIO N ', 'ConnectString', ;
'D S N = a u to ;U ID = lo g in _le v4 ;P W D = le v4 ')
CASE LevDostup=5
= DBSETPROP('remote_01', 'C O N N E C TIO N ', 'ConnectString', ;
'D S N = a u to ;U ID = lo g in _le v5 ;P W D = le v5 ')
ENDCASE
&&
a _ v = A D B O B J E C T S (a _ v ie w , 'V IEW')
IF a _ v > > 0
p rm = A S C A N (a _vie w , 'propmodel_view')
la u= AS CA N (a _view , 'lauto_view')

converted to PDF by HupBaH9I

s m n = A S C A N (a _vie w , 'sman_view')
cus= A SC A N (a_vie w , 'cust_view')
m o d = A S C A N (a _v ie w , 'model_view')
ord = A S C A N (a _vie w , 'order_view')
ENDIF
IF p rm = 0
CREATE SQ L V IE W propmodel_view C O N N E C TIO N remote_01 SHARE ;
A S S E L E C T model.key_model, model.name_model, model.swept_volume, ;
model.quantity_drum, model.capacity, model.torgue, model.top_speed, model.starting, ;
model.quantity_door, model.quantity_sead, model.length, model.width, ;
model.height, model.expense_90, model.expense_120, model.expense_town, ;
firm.name_firm, country.name_country,fuel_oil.name_fuel_oil, ;
tyre.name_tyre, body.nam e_body ;
FROM model f ir m , country, fuel_oil, tyre, body ;
WHERE model.key_firm=firm.key_firm ;
A N D firm.key_country=country.key_country ;
A N D model.key_fuel_oil=fuel_oil.key_fuel_oil ;
A N D model.key_tyre=tyre.key_tyre ;
A N D model.key_body=body.key_body
ENDIF
IF lau=0
CREATE SQ L V IE W lauto_view C O N N E C T IO N remote_01 SHARE ;
A S S E L E C T automobile_passenger_car.key_model, automobile_passenger_car.date_issue, ;
automobile_passenger_car.cost, account.selled ;
FROM automobile_passenger_car, account ;
WHERE automobile_passenger_car.key_auto=account.key_auto
ENDIF
IF s m n = 0
CREATE SQ L V IE W sman_view C O N N E C T IO N remote_01 SHARE ;
A S S E L E C T salesman.key_salman, ;
salesman.last_name+' '+salesman.first_name+' '+salesman.patronymic as sman ;
FROM salesman
ENDIF
S E L E C T * FROM sman_view I N T O ARRAY Arcombo1
IF cus=0
CREATE SQ L V IE W cust_view C O N N E C T IO N remote_01 SHARE ;
A S S E L E C T customer.key_customer, customer.name_customer ;
FROM customer
ENDIF
S E L E C T * FROM cust_view I N T O ARRAY Arcombo2
IF m od=0
CREATE SQ L V IE W model_view C O N N E C T IO N remote_01 SHARE ;
A S S E L E C T model.key_model, model.name_model ;
FROM model
ENDIF
S E L E C T * FROM model_view IN T O ARRAY Arcombo3
IF ord=0
CREATE SQ L V IE W order_view C O N N E C TIO N remote_01 SHARE ;
A S S E L E C T order_.key_order, order_.key_salm an, order_.key_customer, order_.key_model ;
FROM order_
&& order_
= DBSETPROP('order_view', 'View', 'Tables', 'order_')
&&
= DBSETPROP('order_view.key_order', 'Field', 'UpdateName', 'order_.key_order')
= DBSETPROP('order_view.key_salman', 'Field', 'UpdateName', 'order_.key_salman')
= DBSETPROP('order_view.key_customer', 'Field', 'UpdateName', 'order_.key_customer')
= DBSETPROP('order_view.key_model', 'Field', 'UpdateName', 'order_.key_model')
&& Order_
= DBSETPROP('order_view.key_order', 'Field', 'KeyField', .T .)
&&
= DBSETPROP('order_view.key_salman', 'Field', 'Updatable', .T .)
= DBSETPROP('order_view.key_customer', 'Field', 'Updatable', .T .)
= DBSETPROP('order_view.key_model', 'Field', 'Updatable', .T .)
&&
= DBSETPROP('order_view', 'View', 'SendUpdates', .T .)
&& ,

converted to PDF by HupBaH9I

&&
= DBSETPROP('order_view', 'View', 'WhereType', 4)
ENDIF
USE order_view
=CURSORSETPROP("Buffering", 5)
Unload :
C LOSE D ATABASES ALL
C LOSE TAB LES ALL
Combo_init :
n n Ad d Ite m = "Th isFo rm .C o m b o "+ A LL T(cN u m )+ ".A d d Ite m "
n n Arn = "A rc o m b o "+ A L LT(c N um )
FOR I = 1 T O ALEN (&nnArn,1)
& nnAddItem (allt(& nnArn(i,2)))
ENDFOR
Refresh_list :
ThisForm .Com b o1 .Va lue = ((A SC AN (Arco m b o1 ,ord er_view .ke y_salm a n))+ 1 )/2
T hisForm .C o m bo2.Value=((A SC AN (Arcom bo 2,o rder_view .key_custo m er))+1)/2
ThisForm .C o m b o3 .Va lue = ((A SC AN (Arcom b o 3 ,ord er_view .k e y_m od e l))+ 1 )/2
Show_sav_und :
MyUpdate=1
ThisForm.mygo1.Com8.Enabled = .T.
ThisForm.mygo1.Com9.Enabled = .T.
Click Propmodel ( )
:
glkey_mod=order_view.key_model
DO FORM prop_mod.scx
Click Lauto ( ) :
glkey_mod=order_view.key_model
g ln am e _m o d=ALLT(Arcom bo3(ThisForm .C om bo3.V alue,2))
DO FORM listauto.scx
Init Combo Box (Combo1, Combo2 Combo3)
:
c N u m = R IG H T (T h is .N a m e ,1 )
ThisForm.combo_init
InteractiveChange Combo1 :
REPLACE order_view.key_salman W ITH Arcom bo1(ThisForm.Combo1.Value,1)
ThisForm.Text2.Refresh
ThisForm.Show_sav_und
InteractiveChange Combo2 :
REPLACE order_view.key_customer W ITH Arcombo2(ThisForm.Combo2.Value,1)
ThisForm.Text3.Refresh
ThisForm.Show_sav_und
InteractiveChange Combo3 :
REPLACE order_view.key_model W ITH Arcombo3(ThisForm.Combo3.Value,1)
T h isF o rm .T ext4. Refres h
ThisForm.Show_sav_und
Click lauto,
(glke y_m od ) (glnam e_m od)
. L IS T A U T O ( ).
Click propmodel,
(glke y_m od ) PROP_ m O d ( ).
.
L IS T A U T O ( ).
.
Data Environm ent View
Visual FoxPro. Data Environment,
.
A d d Data Environm ent,
Visual FoxPro, ,
. Add Table or
View.
,
, .

converted to PDF by HupBaH9I

. ,
. 9.10. , ,
.
' W n a e tm t
Eib .* Y e w

F tip r o 5
Xooh Erogem

miormert

'

M\ | | | | * | | | | |
JMiiJ: *t
l: atpc*
~ j

ssr

Al

*1 * 1

Data | Methods | Lq/cul | O tfw

! 5 1 | D d * ]

'JZ

L U

WflpMTifclB.

IwejDelhfll

ftjjg Q p *fiT<Ui4
BascQtea

T. T'Lrt
h

jb d J]

CjttflAifttf.... .........

TD^taEnwifOfyMsrti - F o c rto c ?

il

jj

mmejnadel
_(

sm pL^P1
quriiy_4ui^J


1 k e ^jM h
ra m e jvm

r*
i1
/

Q ln d F
k*y_lM4

TP,
~J

C b it la b t o i ___"
lesbnp E-d
|D d a u t]
E n h tv e r i
ID d s d j

k fl/jT iX H Ij;
name c o u ili
O bndc^
'
cw j ^ i

|Llrt*Jl
D1m eni

Ibe-usedtniHnrmc* ai cbjec-l n

iL I
Addb an EMftig k4c or view fa

i'll; 1* .2* |2^1'

D ata *

. 9 .1 0 .
L IS TA U T O lauto_view,
lauto_view
(Data Environment) . .
-. , ,
(Form .Load), lauto_view
, lauto.
. ,
.
Load :
S E L E C T lauto_view.date_issue, lauto_view.cost, ; lauto_view.selled ;
FROM lauto_view ;
WHERE lauto_view.key_model=glkey_mod ;
I N T O C UR SOR lauto
, Form Controls, L IS T A U T O (Grid).
(RecordSource), Grid,
- lauto. .
. , ,
. ,
,
, , . .
.
Layout Grid Column
( ColumnCount = 3 ), (
DeleteMark = .F.), ( ScrollBars = 2 -
), ( HeaderHeight = 25)
Grid ( RowHeight = 25).
Data Grid.Column ,
:
Grid.Column1.ControlSours=lauto.date_issue

converted to PDF by HupBaH9I

Grid.Column2.ControlSours=lauto.cost
Grid.Column3.ControlSours=lauto.selled
Column - CurrentControl =
CheckBox, .
CheckBox
Form Control .
CurrentControl Column ( Sparse = .F.).
Layout Grid.Column.Header,
( Grid.Column1.Caption = , Grid.Column2.Caption = ,
Grid.Column3.Caption = ), (
Alignment = 2).
L IS T A U T O , . 9.11.

; MlcrbsdEt Visual

FoxPro 5-

File Edit View Format Form lools

Program Window Help

{? I*

Ml a

Ji Form Designer - listauto.scx

Jj

< j j ______
Form: | Forml

______
Page: |

if i

. 9 .1 1 . " "
P R O P _ M O D ( ).
PROP_MOD propmodel_view,
, (Form.Load),

propmodel.
Load :
S E L E C T * FROM propmodel_view ;
WHERE propm odel_view.key_model=glkey_mod ;
I N T O C UR SOR propmodel
Form Controls PROP_MOD
TextBox propmodel.
( ControlSours = < < _ . _ > > ). . 9.12.
PROP_MOD.

converted to PDF by HupBaH9I

-ti tujjrei fiiDp_mrwt


"~

"

"

...... ' 4~'

"11
"" '^4

* "

f 4|; J hmm-1

. 9 .1 2 . " "
,
. , ,
.
,
. .
: (Interactive)
(B y List). Forms
T a b Ordering Options (. . 9.5).
,
Tab Order View Visual FoxPro
(. 9.13).
j !i II

Visw

3 3 .

Fflmdl Foqfl J o d r

Erogrm iftfrdow

( ^ [ | ) I >1

[ !

tM s

!= I 1

lit

IHUMI

. 9 .1 3 .

converted to PDF by HupBaH9I

S h ift
. , .
. ,
.

Shift. ,
. , Sh ift, .
, Reorder.
- .
Tab Order , . 9.14.

Efe

rriiv.5j F anj J o d i

^ fcjdlp

~ | ! s j

a , i sm

|
oto:\ TsiH5

-
.

1
*

. - fru:

_?

Teilfi

UdUMtT.! Te*t7

. ??TtjiuiHi

iU
; |nrml

2 :

d
life

| 2

. 9 .1 4 .
.
, .
. 9.14, ,
. , By Row By Column
,
.
, OK.
Microsoft Word Microsoft
Excel ( ). , .
SAMPLE.EXE,
.

" " Access


Access
.
, .
Visual FoxPro, Access
, . 9.15.
.
.

converted to PDF by HupBaH9I


*J
||1|;=| Jfn p M n l

LtinjjM it

| &| |

JSl
I


.............
UctcreaitBi . . . .
.
"<- . 1 ................

<0..................
- I

....................................................

00 Dal........
'i - 1 ' *.:! i I

. . . .

.........................
1 '... -- 1S3t i"!"

._
*
1'

............
.

..

<>-: - I - : - .

-.1 f :
. I

. 9 .1 5 . Access 7.0
Access, ,
, ,
.
, , .
,
,
- .
' ,
'
Public m y w k s p As W orkspace
Public m y w k s p 1 As Workspace
'
Public rstOrd As Recordset
Public rstcust As Recordset
Public rstAc As Recordset
W orkspace , .
Recordset ,
,
- .
, " " .
- " ".
:
Private S u b ^ ^
' Sale sman
Dim strSearch As String
'
Se t m y w k s p = D B E n g in e .W o rk s p a c e s (0 )
'
Se t rstOrd = m y w k s p .D a ta b a s e s (0 ).O p e n R e c o r d s e t (" o r d e r_ " , _ d b O p e n D y n a s e t )
'
m y w k s p . Beg inTrans
'
' La s t_ n a m e login
s trSearch = "L a s t_ n a m e = " & C h r ( 3 4 ) & _ m y w k s p .U s e r N a m e & C h r ( 3 4 )
'
r s tO rd .A d d N e w

converted to PDF by HupBaH9I

'
rstOrd!key_salman = DLookup("key_salman",_"salesman", strSearch)
rstOrd.UPDATE
Me!cmbCust.Enabled = True
Me!txtFam.Enabled = True
End Sub
order_ , ,
, . ,
. ,
, ,
, ,
order_. Username
mywksp.
strSearch = "Last_name=" & C h r(3 4 ) & mywksp.UserName & _ C h r(3 4 )
'
rstOrd.AddNew
'
'
rstOrd!key_salman = DLookup("key_salm an",_ "salesman", strSearch)
,
, .
, ,
,
, (
, ) (
, ).
Click, " ":
Private Sub cmbNcl_Click()
Set mywksp1 = DBEngine.Workspaces(0)
Set rstcust = mywksp1.Databases(0).OpenRecordset("customer", _ dbOpenDynaset)
mywksp1. Beg inTrans
DoCm d.OpenForm "", acNormal, , , acAdd
End Sub
"". ,
,
, , ,
. .
, ,
. ,
,
. ,
LostFocus ( ):
Private Sub txtFam_LostFocus()
If L e n (T rim (tx tF a m )) > > 0 Then
Me!cmbCust.RowSource = "S EL EC T D IS T IN C T R O W _
customer.key_customer,customer.name_customer,_
customer.address, customer.tel FROM customer Where _ customer.name_customer
like " & C h r(3 4 ) & Trim (tx tFa m ) &_
"*" & _ C h r(3 4 ) & ";"
Else
Me!cmbCust.RowSource = "S EL EC T D IS T IN C T R O W _
customer.key_customer,customer.name_customer,
_ customer.address, customer.tel FROM customer ;"
End If
End Sub
-
, , RowSource

converted to PDF by HupBaH9I

.
, .
" , , ", "
". OpenForm DoCmd:
Private Sub cmbCAuto_Click()
DoCm d.OpenForm _
" , , ", acNormal
End Sub
" , , "
RecordSource ( ).
. :
,
- .
.
.
. , Access
, , .
Private Sub name_model_AfterUpdate()
If L e n (Trim (n a m e _m o d e l)) > > 0 Then
Me.FilterOn = False
Me.Filter = "name_model=" & C h r(3 9 ) _
& Me!name_model & C h r(3 9 ) & _
"and name_firm=" & C h r(3 9 ) & Me!name_firm & C h r(3 9 )
Me.FilterOn = True
End If
End Sub
.
, " ",
.
Private Sub 9_Click()
DoCm d.OpenForm " ", _
acNormal, , "[N a m e _m o d e l]= " & C h r(3 9 ) & _
Me![name_model] & C h r(3 9 ), acReadOnly
End Sub
, ,
" ". Account. ,
, , .
Private Sub 8_Click()
Dim FStr As String
FStr = "name_customer=" & C h r(3 9 ) & _ Forms![ ].cmbCust & C h r(3 9 )
Set rstAc = mywksp.Databases(0).OpenRecordset("account", _ dbOpenDynaset)
rstAc.AddNew
rstAc!key_customer = DLookup("key_customer", _ "customer", FStr)
rstAc!key_auto = Me!key_auto
rstAc!date_write = N o w ()
rstAc.UPDATE
Forms![ ].cmbAc.Enabled = True
DoCmd.Close acForm, " ,_ , "
End Sub
" "
. .
" " .
mywksp.CommitTrans
rstOrd.Close
rstAc.Close

converted to PDF by HupBaH9I

m y w ksp .C lose
M e ![ 1 ].E n b le d = Tr u e
D o C m d .O p e n T a b le "account"
D o C m d .G o T o R e c o rd acTable, "account", acLast
, rstO rd, rstAc m y w k s p
Close. ,
" " , Access
.
- , "
". ,
. , : ,
, ,
.
Private S u b c m b R b a c k _ C lic k ()
m yw ks p .R o llb a ck
rstO rd.C lose
rstAc.Close
m y w k s p .C lo s e
M e ![ 1 ].E n a b le d = Tr u e
M e!c m b C u st.En a b le d = False
M e !tx tF a m .E n ab led = False
M e !c m b A c .En a b le d = False
End Sub

9.3.
- , ,
. , ,
, .
,
.
,
. ,

, . , ,
:

.
,
.
,

. , 8 ,
.
.
,
. ,
, .
.
, .

Visual FoxPro
Visual FoxPro (Menu
De sign e r). ,
, Visual FoxPro
.
O th e r, Menus New.
, . 9 .1 6 .
. ,

converted to PDF by HupBaH9I

Visual FoxPro. ,
. MPR, MPX. .
- . Menu
Generate.
()

Menu - -1
0

EtOrnpl
< w

1'
;-.
< - - :i

Subm enu

M *n u L *v e l_
M enu

7 ^


. 9 .1 6 . Visual FoxPro

Visual FoxPro,
- Menu Quick Menu.
Visual FoxPro,
, - ,
. . , , ,
- ,
. , Edit,
, .

Help, .

. ,
.
Prompt.
, Result Submenu
Create. ,
, .
, .
Menu Level.
, Prompt ,
, \-. ,
, Preview.
" ".
,
- . .
\ < < . ,
, ,
\ < < . . ,
, " "
. ,
, ,
.

converted to PDF by HupBaH9I

.

Options. Prompt Options,
.
. 9.17. Shortcut,
Key Definition. . Key
Label. Key Text ,
. ,
C trl. Visual FoxPro -
, ,
. \ < < ,
Visual FoxPro Key Label A l t
. , .
Key Definition Key Label
.

*1

' Prnrnpl Oplions


Com m ent

OK

-'i-.-ii-b i.-r.i-i-b -ii-

C ancel

Shortcut...

\5kipFor .

HblegofiflJe,

P Pad Net*

OLE-


. 9 .1 7 .
Skip
For, Prompt Options. ,
,
. .F., , .T. .
.
, Visual FoxPro O L E-,
Negotiate ,
O L E -. None -
O L E -.
Message
, .
. ,
.
Prompt Options - Pad Name,
, .

. Visual FoxPro, ,
. ,
Pad Name .
-
Result Visual FoxPro,
. Visual FoxPro Result Command
. , D O L o g _ u s e r .
Cleanup (
), : D O L o g _ u s e r I N M a in , Main -

converted to PDF by HupBaH9I

.
- , ,
, Result Procedure.
Create .
-
, .
, .
Result Bar#,
- . Menu Level
. View Visual FoxPro Menu Options,
. Edit
:
< < , >>
DO CASE
CASE BAR() = 1
< < , >>
CASE BAR() = 2
< < , >>
ENDCASE
B A R ( ) .
, Result.
, View Visual FoxPro
General Options. ,
. 9.18, ,
, Setup. ,
, ,
, , Cleanup.
Location :



. 9 .1 8 .

Replace - .
Append - .
Before - .
After - .

converted to PDF by HupBaH9I

Visual FoxPro
S E T S Y S M E N U T O D E F A U L T .
( E X E ) ,
R E A D E V E N T S Cleanup, ,
, C L E A R E V E N T S .

Access
Access . -
. - .
, ,
.
() . ,

, .
.
,
, , .
9.19.

. 9 .1 9 .
,
, .
,
. ,
, , -, ,
. 9.20.

converted to PDF by HupBaH9I

m
:

< >




. 9 .2 0 .
, O K ,
. , . 9.21.
, .
,
.

- [ ]

QK

J9KCT :

BcToDHTb

- ! I

. 9 .2 1 .
, - "
", " " " ".
, ,
, .
" ",

converted to PDF by HupBaH9I

, .
:
Sub _()
DoCm d.OpenForm " "
End Sub
,
. ,
.
. 9.21 " " - , " " - ,
" " ,
" _ " .
,
, ,
.
,
, ,
.
,
, ,
. - ,
.
, ,
, .

10

10.1.
10.2. OLE 2.0
OLE 2.0
OLE Automation
Excel
Word for Windows
10.3. OLE Automation
MS Graph 5.0
MS Excel 7.0
Word for Windows
Schedule+
10.4. ActiveX

,

. , -
?
.

10.1.


,

.

converted to PDF by HupBaH9I

, Windows

.
-
,
.
. ,
- ,
.
,
, ,
, . .,
.
, ,
.
, ,
,
Microsoft Word for Windows .
Microsoft
Office, .
,
:

.

.
.

- .


, Microsoft Office
.
,
.
Microsoft Office
()
OLE 2.0
Microsoft Visual Basic for Application. , Microsoft Office
,
.
:

, ,
, .
,
.

OLE 2.0
,
. ,
Microsoft Excel - ,
OLE. OLE Microsoft Excel
120 2700 .
, OLE 2.0,
Microsoft
Excel .

10.2. OLE 2.0


OLE - O b j e c t L in k e d a n d E m b e d d in g ( )
,
.

converted to PDF by HupBaH9I

, , , ,
,
.
:

OLE;
O L E -;
OLE Automation.

? :

Windows,
. ,
, ,
.
.


.

.

, .
.

.
, Excel
. .
OLE Automation
.
,
.

OLE 2.0
O L E 2 .0 .

,
. OLE 2.0
, ,
. ,
,
.
OLE 2.0 ,

(, ).
,
. . ,
, , ,
, .
OLE 2.0 , :
.

- ,
, - ,
, .

OLE 2.0 .

converted to PDF by HupBaH9I

- ,
( ) .

, , .
, ,
.
, .

, , .
, ( , ),
. .
,

. ""
, ,
,
.

OLE Automation
OLE 2.0 - O L E A u t o m a t i o n -
.

, OLE Automation, ,
- OLE Automation,
, Visual Basic for
Application.
OLE Automation O L E -.

O L E - - ,
.

, O L E-, O L E -
O L E - .

, 3.0 Visual FoxPro O L E -.


O L E-, -
Visual FoxPro.
O L E - O u t - o f -P r o c e s s .
16-bit, 32-bit O L E .
. O L E - I n - P r o c e s s
DLL-, .
Access 7.0.
O L E - ,
O L E- .
. 10.1 O L E -
Microsoft.
1 0 .1 . O L E - Microsoft
O L E -

converted to PDF by HupBaH9I

O u t - o f -P r o c e s s
Microsoft Schedule+ 7.0
Microsoft Graph 5.0

VBA_GRP.HLP

Microsoft Word 7.0

WRDBASIC.HLP

Microsoft Excel 7.0

VBA_XL.HLP

C In -P ro c e s s
Data Access Object

DAO.HLP, DAOSDK.HLP

SQ L Distributed
Management Objects

SQ LBOOKS.M VB

O L E- Microsoft Excel:

Application - Microsoft Excel;


Workbook - , -
Microsoft Excel;
Chart - ;
Worksheet - ;
Range - .

, Microsoft Excel,
.
. , , , ,
. Application. -
, ,
. , , :
Application.Quit
Application . ,
,
Microsoft Excel:
Application.Workbooks
, Workbooks ,
, .

- , , ,
.


. ,
:
*
oExlApp = GETOBJECT(,"Excel.Application")
nWrk = 1
* ,
nCount = oExlApp.Application.WorkBooks.Count
FOR nWrk = 1 T O nCount
*

? oExlApp.Application.WorkBooks.Item(nWrk).FullName
NEXT
*
oExlApp.Application.Quit
, Excel, . Visual FoxPro
. C om m and

converted to PDF by HupBaH9I

- F O R , .
, nCount. !
O LE A u to m a tion Visual FoxPro.
.
,
It e m , .
:
A p p lic a tio n .W o rk b o o k s .Ite m (1 )
:
A p p lic a tio n .W o rk b o o k s .Ite m (1 ).C lo s e
,
- . . A 1 :
A p p lic a tio n .W o r k b o o k s .Ite m (1 ).W o r k s h e e ts .It e m (" S h e e t1 " ).C e lls .It e m (1 ,1 )
, ,
" " . . 10.1
Microsoft Excel.

. 1 0 .1 . Microsoft Excel
,
- . Parent
Visual FoxPro, Microsoft Office
Application. . 10.2.

converted to PDF by HupBaH9I

. 10.2.
OLE Automation
.

, , Microsoft Excel . 10.3.

Application

! 1

Workbook

Chart

Sheet

Add-in

---------



. 10.3.

, , ,
OLE Automation Visual FoxPro ,
Visual FoxPro -
C REATEOBJECT(ClassNam e [, eParameter1, eParameter2, ...])
O L E - ,

converted to PDF by HupBaH9I

G ETO B JEC T([F ileN a m e ] [ , ClassName])


FileNam e (
), O L E -, .
ClassName ( O L E -).
, , Microsoft Excel,
, , . .
:
<<" "> > .< < " "> >
:
oSht = GETOBJECT("C:\VFP\SAM PLE\VAT. XLS","EXCEL.S H EET")
Visual Basic Access ,
S e t,
:
' MS Excel
Dim oExlApp As Object
'
Set oExlApp = CreateObject("Excel.Application")
'
oExlApp.Visible = True '
oExlApp.Quit ' Excel
Set oExlApp = Nothing '
' MS Excel
Dim oExlApp As Object
Set oExlApp = GetObject("C:\VFP\SAMPLE\VAT.XLS","Excel.Sheet")
Set oExlApp = Nothing

Excel

Excel,
C R E A T E O B J E C T ( ) G E T O B J E C T ( ) .
Microsoft Excel
. 10.2.
1 0 .2 . Microsoft Excel

Application CreateObject
Microsoft Excel.

.
GetObject

FileName

,
Microsoft
Excel
.
,


Microsoft
Excel
.

FileNam e .

Sheet Chart.

Sheet CreateObject

converted to PDF by HupBaH9I

Chart

Microsoft
Excel,


"Object"
"Sheet1".
Chart

"Chart1".


(),
,
Excel
.

Microsoft Excel
,

,

. ,

Excel, ,

, .
GetObject

FileName

()
Microsoft Excel
,

.

Microsoft Excel ,

.
,



Excel.
FileName

("")
Microsoft
Excel,


"Object"

"Sheet1".
FileName
("")
Microsoft Excel
,

,
.
FileName ,
.

, . 10.2, OLE Automation


Microsoft Excel .

converted to PDF by HupBaH9I

Excel .
, Visible Application "":
...Application.Visible = .T.
, ,
" " Visible :
...W in d o w (n ).V is ib le = .T.
Excel O LE A u tom a tio n .
A d d W orkbooks:
...W o rk b o o k s .A d d
, Microsoft Excel,
.

A p p lic a tio n
oApp = C R E A T E O B J E C T ( " E X C E L . A P P L I C A T I O N " )
oApp = G E T O B J E C T ( " " ," E X C E L .A P P L I C A T IO N " )
Excel .
oApp = G E T O B J E C T ( , " E X C E L . A P P L I C A T I O N " )
Excel. Excel ,
.

Sheet
o Ex S h ee t = C R E A T E O B J E C T ( " E X C E L .S H E E T " )
F O R nVal = 1 T O 10
oE x lSh ee t.Ce lls (n V a l, nVa l).Va lu e = nVal * nVal
ENDFOR
* ,
* oExlSheet.Application.Visible = .T.
o E x lS h e e t .S a v e A s (" T E M P .X L S " )
Excel
, . 10.4. T E M P .X L S ,
Excel.

converted to PDF by HupBaH9I

| Tampjds
| A
11
2
3

-Jn Jx .

|B

c| 1 D

i l

4
9
16
25

---

1 J

i
i
i
I

i
j
i
I

ii

J7

"
S4

49

9
10

1'

11

J.2.

is
14
16

I i

4.

J5

1 L Shuutl A

31
100

i
!
I
1

L... i
]<|

'
i
i
i

1
;
i
1

I
i
i

W
Ml

. 10.4.
oExISheet = G E TO B JE C T ("R A S _1 .X L S ", "EXCEL.SHEET")
oExISheet.Range("G2").VaIue = 16
oExlSheet.Range("G3").Value = 10
oExlSheet.Parent.Save &&
? oExlSheet.Range("G4").Value
RAS_1.XLS.
, , OLE
Automation, . ,
, G2 G3, ,
G4, , G3 G2.
Chart
oExlChart = C R EA TEO BJ E C T (" EXCEL.CH ART")
*
oExlChart.Parent.Sheets(2).Range("A1:D10").Clear
FOR nVal = 1 T O 10
*

oExlChart.Parent.Sheets(2).Cells(nVal,1).Value = nVal
oExlChart.Parent.Sheets(2).Cells(nVal,2).Value = nVal * nVal
NEXT
*
oExlChart.ChartWizard(oExlChart.Parent.Sheets(2).Range("A1:B10"),,,2)
* ,
oExlChart.Application.Visible = .T.
W AIT
.
, . ChartWizard
. ChartWizard
.
. Excel
W A I T ,
.
oExlChart = G E T O B JE C T("R A S _1 .X L S ", "EXCEL.CHART")
oExlChart.ChartTitle.Text = " "
RAS_1.XLS.
Chart Chart Insert.

Word for Windows

converted to PDF by HupBaH9I

Word for Windows C R E A T E O B J E C T ( )


, .
G E T O B J E C T ( ) .

oWrd = G E T O B J E C T (" ","W O R D .B A S IC ")
C R E A T E O B J E C T ( ) .

oWrd = G E T O B J E C T (,"W O R D .B A S IC ")
.
Excel Word for Windows OLE
Automation - W o r d B a s i c ( Word.Basic). ,
Word
WordBasic.
Word,
- "Hello!" ,

, . Word Access. ,
Access, Word.
Access .
.
, CallWord. :
Public Function CallWord() As Integer
Dim oWbApp As Object
Set oWbApp = CreateObject("Word.Basic")
oWbApp.FileNew '
oWbApp.Insert "Hello!" '
Set oWbApp = Nothing
Exit Function
End Function
. -
,
En te r. Word
.
Excel Word
, , , .
Word OLE Automation .
WordBasic , o L e Automation
. ,
. WordBasic
ToolsOptionsSave
ToolsOptionsSave [.CreateBackup = nu m b er] [, .FastSaves = n u m b er] [, .SummaryPrompt =
nu m b er]
Word , , :
ToolsOptionsSave .SummaryPrompt = False
O L E-,
:
oWbApp.ToolsOptionsSave , , 0

10.3. OLE Automation



.
Microsoft Microsoft Graph 5.0,
.
,
Microsoft Graph 5.0,

converted to PDF by HupBaH9I

, Microsoft Excel.
Microsoft Graph 5.0 O L E -
,
. MS Graph 5.0 ,
.

MS Graph,
OLE Automation.
.
. 10.5 MS Graph 5.0, . 10.3 -
.
1 0 .3 . MS Graph 5.0

Application

Axis
AxisTitle

Border

Chart

ChartArea

,
,
(,
, . .)

ChartGroup ,
.
ChartGroup
ChartTitle

DataLabel


(

)

DownBars

DropLines

,
Y

ErrorBars

,
X -Y

Floor

Font

GridLines

HiLoLines

Interior

( , .
.)

Legend

LegendEntry ,

LegendKey
PlotArea
Point

converted to PDF by HupBaH9I

Series

SeriesLines
TickLabels

TrendLine

UpBars

Walls

27
, , .
10.4. Application ( , ),
Creator ( , - Apple Macintosh)
Parent ( ), .
1 0 .4 . MS Graph 5.0

Application ChartWizardDisplay, HasLink, SaveAsOldExcelFile-Format


Name, Visible, Chart, Quit
Axis

AxisBetweenCategories,
Delete
AxisGroup, AxisTitle, Border,
Crosses, CrossesAt,
HasMajorGridlines,
HasMinorGridlines, HasTitle,
MajorGridlines,
MajorTickMark, MajorUnit,
MajorUnitIsAuto,
MaximumScale,
MaximumScaleIsAuto,
MinimumScale,
MinimumScaleIsAuto,
MinorGridlines,
MinorTickMark, MinorUnit,
MinorUnitIsAuto,
ReversePlotOrder, ScaleType,
TickLabelPosition, TickLabels,
TickLabelSpacing,
TickMarkSpacing, Type

AxisTitle

Border, Caption, Font,


Delete
HorizontalAlignment, Interior,
Left, Name, Orientation,
Shadow, Text, Top,
VerticalAlignment

Border

Color, ColorIndex, LineStyle,


Weight

Chart

Area3DGroup, AutoScaling,
Bar3DGroup, ChartArea,
ChartTitle, Column3DGroup,
Corners, DepthPercent,
DisplayBlanksAs, Elevation,
Floor, GapDepth, HasAxis,
HasLegend, HasTitle,
HeightPercent, Legend,
Line3DGroup, Perspective,
Pie3DGroup, PlotArea,
PlotVisibleOnly,
RightAngleAxes, Rotation,
SizeWithWindow, SubType,
SurfaceGroup, Typ e , Walls,
WallsAndGridlines2D,

BarGroups, ChartGroups,
ChartWizard, ColumnGroups,
Delete, DoughnutGroups,
LineGroups, OmitBackground,
PieGroups, RadarGroups,
SeriesCollection, SetEchoOn,
XYGroups

converted to PDF by HupBaH9I

A p plyDataLabels,
A r e a G r o u p s , A u to F o rm a t,
Axes
C ha rtAre a B order, Font, Height, Interior, Clear, C learContents,
Left, N a m e , S h a d o w , T o p ,
C lea rF orm a ts, C o p y
Width
ChartGroup

Ax is G ro u p ,
D o u g hn u tH ole Size ,
D o w n B a rs , DropLines,
FirstSliceAngle, G a p W id th ,
HasDropLines, HasHiLoLines,
HasRadarAxisLabels,
HasSeriesLines,
H a s U p D o w n B a rs , HiLoLines,
O v e rla p , RadarAxisLabels,
SeriesLines, S u b T y p e , T y p e ,
U p B ars, V a ry B y C a teg o rie s

SeriesCollection

C hartTitle B order, Captio n, Font,


Delete
HorizontalAlignm ent, Interior,
Left, N a m e , Orientation,
Shadow, Text, Top,
VerticalAlignm ent
DataLabel A u to T e x t, Bord er, Caption,
Font, H orizontalAlignm ent,
Interior, Left, N a m e ,
N u m b e r F o r m a t , Orientation,
Shadow, ShowLegendKey,
Text, Top, Type,
VerticalAlignm ent

Delete

D o w n B a rs B order, Interior, N am e

Delete

DropLines B order, N ame

Delete

ErrorB ars

B order, EndStyle, N a m e ,
C lear Formats

Delete

Floor

B order, Interior, N a m e

C lear Formats

Font

Ba ck grou n d , Bold, Color,


C o lo rIn d e x, FontStyle , Italic,
N a m e , O utlineFont, Sh a d o w ,
Size, Strik e th rou gh,
Subscript, Superscript,
Underline

GridLines

B order, N am e

Delete

HiLoLines B order, N am e

Delete

In terio r

Color, C o lo rIn d e x,
In v e rtIfN e g a tive , Pattern,
PatternColor,
PatternColo rIndex

Legend

B order, Font, Height, Interior, Clear, ClearContense, C o py ,


Left, N a m e , Position, S h a d o w , Delete, LegendEntries
T o p , Width

LegendEntry

Font, In d e x , LegendK ey

Delete

Le g e n d K e y B order, Interior,
C lea rF orm a ts, Delete
In ve rtIfN e g a tive ,
M arkerB ackgroundColor,
M ark e rB a ck gro u n d C olo rIn d e x,
M arkerForegroundC olor,
M ark e rF oreg roun d C olorIn d e x ,
MarkerStyle, S m o o th
PlotArea
Point

B order, Font, Height, Interior, ClearForm ats


Left, N a m e , T o p , Width
B order, DataLabel, Explosion, ApplyDataLabels,

converted to PDF by HupBaH9I

H asDataLabel, Interior,
C lea rF o rm a ts, C o p y , Delete
In ve rtIfN e g a tive ,
M arkerBackgroundColor,
M ark e rB a ck g rou n d C olorIn d e x,
M arkerForegroundC olor,
M ark e rF oreg roun d C olorIn d e x ,
MarkerStyle, P ictureType,
PictureUnit
Series

A x is G ro u p , Border, ErrorBars, Interior, In v e rtIfN e ga tiv e ,


Explosion, HasDataLabels,
M arkerB ackgroundColor,
HasErrorBars
M ark e rB a ck grou n d C olorIn d e x,
M arkerForegroundC olor,
M ark e rF oreg roun d C olorIn d e x ,
MarkerStyle, P ictureType,
PictureUnit, S m o o t h , T y p e ,
A p plyDataLabels,
C lea rF orm a ts, C o p y ,
DataLabels, Delete, ErrorBar,
Points, Trendlines

S e ries Lines

B order, N am e

TickLabels Font, N a m e , N u m b e rF o rm a t,
Orientation

Delete
Delete

T re n d L in e B ackw ard, Border, DataLabel, C lear Form ats, Delete


Displa yEquation,
Dis p la yRSq ua re d , Forward,
In d e x , Intercept,
In te rce p tIsA uto, N a m e ,
N a m e Is A u to , O rd e r, Period,
Type
U p B ars

B order, Interior, N a m e

Delete

Walls

B order, Interior, N a m e

ClearForm ats

MS Graph 5.0
MS G ra p h 5.0
Visual FoxPro,
. . 10.6.
MS G ra p h 5.0 ,
,
,
.

converted to PDF by HupBaH9I

& ptttyftbrtiTt) p*BCTty

' (

> 6 < *

_SJ

. 10.6.

MS Graph (). (
. 10.5) ,
"" .
, . 10.5, , ,
:
CREATE TAB LE Graphs (title C (2 5 ), number I, query M, y_n u m b e r I,;
y1_caption C (2 5 ), y2_caption C (2 5 ), graph G)
APPEND BLANK
APPEND GENERAL graph CLASS "MSGraph"
1 0 .5 . GRAPHS.DBF

T IT L E

Character

25

NUMBER

Integer

QUERY

Memo

SQL

Y_NUMBER

Integer

25

Character

25

General



MS Graph 5.0

N
0
T1
I
P
A
C
_
2
Y

Y1_C AP TIO N Character

GRAPH

. ,
SQL , Query, 256
. ,
,
, (
):
S E L E C T m.m onth_nam e,SUM (d.Price*d.quantity),m .m onth_num b
FROM Months m,Invoices i,Inv_Details d WHERE i.kod_id = d.kod_id AN D
MON TH (i.inv_date) = m .m onth_num b GROUP BY m.m onth_nam e OR DER BY m .m onth_num b
I N T O C UR SOR Datafile
Datafile.
OLE Bound Control.

converted to PDF by HupBaH9I

olbGraph. Data Environment


ControlSource olbGraph graph.
Init :
ThisForm.LockScreen = .T.
S E L E C T Graphs
G O TO P
cCom = Query
cCom = L E F T (c C o m , LEN(cCom) - 2)
* , Query
&cCom
ThisForm.RefreshGraph
ThisForm.ChangeGraphType
ThisForm.LockScreen = .F.
Load aType .
:
PUBLIC ARRAY a Typ e [4 ,2 ]
a Ty p e [1 ,1 ] = " "
a Ty p e [2 ,1 ] = ""
a Ty p e [3 ,1 ] = ""
a Ty p e [4 ,1 ] = ""
a Ty p e [1 ,2 ] = 1
a Ty p e [2 ,2 ] = 3
a Ty p e [3 ,2 ] = 4
a Ty p e [4 ,2 ] = 5
Destroy :
RELEASE aType
cmbData.
:
RowSourceType = 2 - ;
RowSource = Graphs.title
Init cmbData :
This.Value = Graphs.Title
InteractiveChange cmbData:
LOCAL cData, cCom
ThisForm.LockScreen = .T.
cData = This.Value
S E L E C T Graphs
LOCATE FOR Title = cData
cCom = Query
cCom = L E F T (c C o m , LEN(cCom) - 2)
&cCom
ThisForm.RefreshGraph
ThisForm.ChangeGraphType
ThisForm.olbGraph.Object.ChartTitle.Caption = cData
ThisForm.LockScreen = .F.
cmbType.
:

RowSourceType = 5 - ;
RowSource = aType - ;
BoundColumn = 2 - Value .

Init cmbType
:
This.Value = 1
InteractiveChange cmbType
:

converted to PDF by HupBaH9I

ThisForm.ChangeGraphType
ChangeGraphType:
LOCAL NType
nType = ThisForm.cmbType.Value
IF ThisForm.opgShow.Value = 1
*
ThisForm.olbGraph.Type = NType
ELSE
*
ThisForm.olbGraph.Type = NType + 8
ENDIF

opgShow.
InteractiveChange opgShow
:
ThisForm.ChangeGraphType
RefreshGraph:
LOCAL cGraphString, nY_lim
cGraphString = ""
*
nY_lim = Graphs.Y_number + 1
S E L E C T Datafile
* , ,
* C H R (1 3 )
FOR iCounter = 1 T O nY_lim
cGraphString = cGraphString + FIELDS(iCounter) ;
+ IIF(iCounter < < nY_lim, C H R (9 ), C H R (1 3 ))
ENDFOR
*
* O L E -
SCAN
FOR iCounter = 1 T O nY_lim
cGraphString = cGraphString + IIF(TYP E(Fields(iC ounter))='C ',;
EV ALU A TE(F IELD S(iC o u n te r));
,str(E V A L U A T E (F IE L D S (iC o u n te r))));
+ IIF(iCounter < < nY_lim, C H R (9 ), C H R (1 3 ))
ENDFOR
ENDSCAN
S E L E C T Graphs
APPEND GENERAL graph D A TA cGraphString

MS Excel 7.0
Excel
, . Excel
, MS Graph, ,
Excel , Sheet.
MS Graph DataSheet, ,
. Excel
,
MS Graph Microsoft.
.
.
*

oleChart - OLE Container Control,


Excel . Form Controls OLE Container
Control .
Insert Object, Excel Chart. O K
Excel,
, . ,
, Visual
FoxPro
.

converted to PDF by HupBaH9I

,
Edit.
cmdExit - . Caption
"OK".
cmdType - .
. Caption "".
cm dSubType - .
. Caption
"".
cmbData - .
, ,
:

BoundColumn = 2
ColumnCount = 2
ColumnWidths = 150,0
FirstElement = 1
Name = cmbData
NumberOfElements = ALEN(aDataTables)
RowSource = aDataTables
RowSourceType = 5
Style = 2
Value = "Total1"
,
aDataTables.
, .
. ( ).
,
Total1.

.
, Load
Form, :
PUBLIC aDataTables(3,2)
aDataTables(1,1) = " "
aDataTables(2,1) = ""
aDataTables(3,1) = ""
aDataTables(1,2) = "Total1"
aDataTables(2,2) = "Total2"
aDataTables(3,2) = "Total3"
,
, , .

, , .

InteractiveChange cmbData :
ThisForm.LockScreen = .T.
S E L E C T (ThisForm.cmbData.Value)
&&
nRow = 2
SCAN &&
ThisForm.oleChart.Object.Parent.Sheets("Sheet1").;
Cells(nRow,2).;
Value = Sum1
ThisForm.oleChart.Object.Parent.Sheets("Sheet1").;
Cells(nRow,3).;
Value = Sum2
ThisForm.oleChart.Object.Parent.Sheets("Sheet1").;
Cells(nRow,4).;
Value = Sum3

converted to PDF by HupBaH9I

nRow = nRow + 1
ENDSCAN
T h is F o rm .L o c k S c re e n = .F.
,
(
). ole Chart O bject
, Visual FoxPro , Parent Excel.
Visual FoxPro , Form -
oleChart. Parent Excel ,
W orkb ook. Sheets
S h e et1 , . Cells
,
Value. S u m 1 , S u m 2 S u m 3 - ,
-
.
Init Form
:
T h is F o rm .c m b D a ta .V a lu e = T h is F o r m .c m b D a ta .L is t (1 ,2 )
T h is F o rm .c m b D a ta .In t e r a c tiv e C h a n g e
N T y p e n S u b T y p e
. Form New Property.
3 1 .
Click c m d T y p e :
I F T h is F o r m . n T y p e > > 13
Th is F o rm .n Typ e = 0
E N D IF
T h is F o r m . n T y p e = T h is F o r m .n T y p e + 1
T h is F o r m .O le C h a r t .T y p e = T h is F o r m .n T y p e
" "
.
Click c m d S u b T y p e :
I F T h is F o r m . n S u b T y p e > > 3
T h is F o r m . n S u b T y p e = 0
E N D IF
T h is F o r m . n S u b T y p e = T h is F o r m . n S u b T y p e + 1
T h is F o r m .O le C h a r t .S u b T y p e = T h is F o r m .n S u b T y p e
Excel
. " " .
,
.
Click c m d Exit :
R E LEA S E Th is F o rm
D a ta E n v iro n m e n t ,
.
. 10.7.

converted to PDF by HupBaH9I


PafidYiii e 1

30

25

20
1

15

[ n p ijj

Cl

LD

IS

&

________
1

. 1 0 .7 . MS Excel 7.0

. ,
Excel.
Excel. .
" ", .
Microsoft Excel:
oleExcel=CREATEOBJECT("Excel.Application")
&& Excel
oleExcel.Visible=.T. &&
oleExcel.Workbooks.Add &&
oleExcel.Selection.ColumnWidth = 20 && 1
oleExcel.Range("B1").Select
oleExcel.Selection.ColumnWidth = 12 && 2
oleExcel.Range("C1").Select
oleExcel.Selection.ColumnWidth = 12 && 3
oleExcel.Columns("A:A").Select && 1
oleExcel.Selection.WrapText = .T.
&&
oleExcel.Range("A1:C1").Select
oleExcel.Selection.HorizontalAlignment =7
&& 1, 2 3
oleExcel.Range("A2:C2").Select
oleExcel.Selection.HorizontalAlignment = -4108
&& 1, 2 3
&&
oleExcel.Columns("A:B").Select
oleExcel.Selection.Borders(2).Weight=2 &&
oleExcel.Columns("A:C").Select
oleExcel.Selection.Borders(3).Weight=2 &&
oleExcel.Range("A2:C2").Select
oleExcel.Selection.Borders(3).Weight=-4138
&&
oleExcel.Selection.Borders(4).Weight=-4138
&&
oleExcel.Range("A1:C1").Select
oleExcel.Selection.Font.Bold = .T.
oleExcel.Selection.Font.ColorIndex = 25
oleExcel.ActiveCell.FormulaR1C1 = " "
oleExcel.Range("A2").Select
oleExcel.ActiveCell.FormulaR1C1 = " "
oleExcel.Range("A2:C2").Select
oleExcel.Selection.Font.Bold = .T.
oleExcel.Range("B2").Select

converted to PDF by HupBaH9I

oleExcel.ActiveCell.FormulaR1C1 = ""
oleExcel.Range("C2").Select
oleExcel.ActiveCell.FormulaR1C1 = " "
******* *******
FOR I = 1 T O KOL_Z
oleExcel.Cells(i+2,1).Value = all_value(i,1)
oleExcel.Cells(i+2,2).Value = all_value(i,2)
oleExcel.Cells(i+2,3).Value = all_value(i,3)
ENDFOR
******* *******
oleExcel.ActiveSheet.ChartObjects.Add(245, 10, 340, 270).Select
oleExcel.ActiveChart.;
chartwizard(oleExcel.range(oleExcel.cells(2,1),oleExcel.cells(12,3)),;
-41 0 0 ,5 ,1,1 ,1,2 ," ","","","")
&& :
&& Gallery - -4100,
&& Format - 5,
&& PlotBy - 1,
&& CategoryLabels - 1,
&& SeriesLabels - 1,
&& HasLegend - 2,
&& Title - " ",
&& CategoryTitle - "",
&& ValueTitle - "",
&& ExtraTitle - ""
******* *******
oleExcel.ActiveChart.Elevation = 0
oleExcel.ActiveChart.Rotation = 328
. 10.8.
X M / tn r x n t t I: <il 11| hip-11 -|i

utelal airab1! >


?l "I "I .\.\ ;ilM
3 I 3 *1

3
- J tjJ jjJ \ & \ ^

JbaTL I

>;-j|:ij ki inn: 11^: j io jbiumuoji.uh

____ >''1"___

HdUHCi^ib

- i 1 ~;.rl '

Kp 1

541
394

FI} |'3Spur 5

331

B H Bi
W S o d w 3 4.
260

SO
300

lie

10 r-:1: i D
11 8*oc
! :
\7.

296
296

13 C m l nenta 14 &

2S4

u sc
15 Ragag '.1z
1t> Grand P rii : .1
1J
1 .'. iiinn-iT - j
1J

SB

47E
334

ill ^

47S
4DC
400

ffij

353

236
213

tac

3S 3
353
305

20 '--:2.7

IT !

: i
22 Si*h3.Q

67
T66

U'

t93
193

I*

Is
-

I 1
S I

-'J

351

Flncr5/ Ihgjj/ ' I *I


A W U H
ir. 1 0.8 .

>j ( II / IV.::: / 1i,. t */ * /


.'J.- -I .l -m c - ic -iim ' p-i-JHi.i I K t P H u n

'
tn

'I

"

n r1
~ r~

Word for Windows



Word for Windows.

converted to PDF by HupBaH9I

. "
" Microsoft Word:
oleW ord=CREATEOBJECT("W ord.Basic")
oleWord.FileNewDefault
oleWord.AppShow
oleWord.FilePageSetup(,,"2,54 ","2,54 ","2,5 ","1,5 ","0 ","21 ","29,7 ")
oleWord.FormatFont("14",0,9,0,0,0,0,1,0,"0 ","0 ",0,"", ,"Times New Roman Cyr", , 1)
oleWord.FormatParagraph( "0 ", "0 ","0 ","0 ", 0,"",1,1, 0, 0, 0, 0, 0,"0","0 ")
oleWord.Insert(" ")
oleWord.InsertPara
oleWord.InsertPara
********* ***************
oleWord.TableInsertTable( , " 3 " ,A L L T (S T R (K o l_ z + 1 )))
oleWord.TableSelectColumn &&
oleWord.LeftPara &&
oleWord.TableSelectTable &&
oleWord.TableRowHeight("0",2,"25 ","0 ", 0,1)
oleWord.TableSelectColumn &&
oleWord.LineDown(1)
oleWord.LineUp(1)
oleWord.TableSelectColumn &&
oleWord.TableColumnWidth("11 ","0,38 ") &&
oleWord.NextCell
oleWord.NextCell
oleWord.TableSelectColumn &&
oleWord.TableColumnWidth("3,5 ","0,38 ")
oleWord.NextCell
oleWord.NextCell
oleWord.TableSelectColumn &&
oleWord.TableColumnWidth("3,5 ","0,38 ")
oleWord.TableSelectTable &&
oleWord.FormatBordersAndShading (3, 0, 2, 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, "0 ", 0, 0, 0,"0", -1 )
oleWord.CharRight(1)
oleWord.LineUp(1)
oleWord.TableSelectRow &&
oleWord.TableHeadings
oleWord.Bold
oleWord.CenterPara
oleWord.FormatParagraph("","","","",4,"25 ")
oleWord.CharLeft(1)
oleWord.Insert(" ")
oleWord.NextCell
oleWord.Insert("")
oleWord.NextCell
oleWord.Insert(" ")
oleWord.NextCell
******* *******
FOR I = 1 T O KOL_Z
oleWord.Insert(all_value(i,1))
oleWord.NextCell
oleW ord.Insert(STR (all_value(i,2)))
oleWord.NextCell
oleW ord.Insert(STR (all_value(i,3)))
IF I < < K O L _ Z
oleWord.NextCell
ENDIF
ENDFOR
. 10.9.

converted to PDF by HupBaH9I

IV'
fn

Word pu . (km
JJpflfSKr Jtn

- l_>prur.

G*l #|[
|0=| *

jj

1 ^|

m
Ti N=<.>.FLii dii

* 1 |*

|U

H B E
^ j f l j xl

_!_Irt _1 J
= = |4
=

11 1 ^

[W =1=

v IH

i=

B|

5 I ' t ' I I 0- O - i 10- I "1 I IS- i -1C i It- -15- I IC- i 1 IQ'

-I

till VJCitl Ttt1 MUlit dtf lUMUlJllBi


H h a b in i

51

J_
| i:rp n

| BI.HIII l h

" n i l i ; r iR i K -

F j . 11

i i z

i+'l

5C0i

\ ftr iv ' i l l '.'J

j:y.

VJJ

2 l . J

].j]

SJD

tfT

5 m i

i - l

v*

- -'.-r.u

i:-

| -1411 \ / \ in 1 |iii.

pifTT f

. 1 0 .9 . Microsoft Word

Schedule+
OLE Automation Microsoft Office
- Schedule+,
-.
Microsoft Schedule+ -,
. Schedule+ O L E , ,
, , , .
,
, .
Schedule+ Excel MS Graph.
: .
, .
. . 10.10.

. 1 0 .1 0 . Schedule+

Schedule+. (Appointm ents), (Contacts),
(Alarms) . . , . .
. ,
Visual Basic, :
Sub NewContact()

converted to PDF by HupBaH9I

Dim oSchedApp As Object, oSchedTable As Object, oSchedItem As Object


* Schedule+
Set oSchedApp = CreateObject("SchedulePlus.Application")
*
If Not oSchedApp.LoggedOn Then
oSchedApp.LogOn
End If
* .
* ScheduleLogged
* .
Set oSchedTable = oSchedApp.ScheduleLogged.Contacs
* ( )
Set oSchedItem = oSchedTable.New
*
oSchedItem.SetProperties FirstName:="", LastName:="", _
Notes:=" Microsoft", _
PhoneBusiness:="(812)259-4277", P honeFax:="(812) 112-6872"
'
Set oSchedItem = Nothing
Set oSchedTable = Nothing
Set oSchedApp = Nothing
End Sub
Schedule+, , Contacts
.
Schedule+ - .

.
Sub NewAppoint()
Dim oSchedApp As Object, oSchedTable As Object, oSchedItem As Object
Set oSchedApp = CreateObject("SchedulePlus.Application")
If Not oSchedApp.LoggedOn Then
oSchedApp.LogOn
End If
'
Set oSchedTable = oSchedApp.ScheduleLogged.Appointments
' ,
Set oSchedItem = oSchedTable.New
'
oScedItem.SetProperties T e x t:= "D e vC o n 9 7 ", _
Notes:=" Microsoft", _
Start: =("06/10/97 10:0 0 "), _
En d :=("06/13/97 18:00")
'
Set oSchedItem = Nothing
Set oSchedTable = Nothing
Set oSchedApp = Nothing
End Sub

10.4. ActiveX
,
ActiveX .


ActiveX (O C X ) Microsoft
Outline. , Outline ( M S O UTL32.OC X )
,
.
. Windows 95 Windows N T 4.0.
Outline ,

converted to PDF by HupBaH9I

. ,
. ,
. Outline ,
.

:

. ,
. Expand
Collapse.
. .
,
Indent.
" / " . , .
"",
"" "". "",
"".
. .
, , ,
. ,
, .
. PictureClick
PictureDblClick.
. , .

,
. ,
.
Style
Outline.
, ( )
. .
,
.
Auto_Store Outline.
, , Visual FoxPro . , Options
Tools, Controls. Selected
Outline Control, . 10.11. View
Classes Controls OLE Controls. . 10.12
View Classes. ,
Outline Control (.
10.13). Visual FoxPro
ActiveX, :

converted to PDF by HupBaH9I

ml

Options
V ie w

jj

General

Edit

D ata

R em ote D ata

File Locations

Forms

P rojects

Controls

International

C- V isual Class Libraries


(* OLE Controls
S elected:

MS O rganization Chart 2.0


M icrosoft Comm Control
M icrosoft D a ta M ap
M icrosoft E quation 2.0
M icrosoft G raph 5.0
M icrosoft MAPI M essage Control
M icrosoft MAPI Session Control
M icrosoft W o rd A rt 2.0
Li utline Control
PicClip Control

Set as D efault

OK

Insertable O bjects

Controls

C ancel

H elp

. 1 0 .1 1 .
al
A dd ...
^ S ta n d a rd

DLE Contois
. 1 0 .1 2 .

hi

4 M i:
DulWie ContiJ
. 1 0 .1 3 .

1.
2.
3.
4.

.
OLE Container Control Controls.
Outline Control.
Insert Object Insert Control
Control T yp e Outline Control (. 10.14).

(. 10.15).
Outline
Properties.

converted to PDF by HupBaH9I

ml

Insert Object
Control Iv p e :

Create N ew

C- Create

from File

(* Insert Control

M icrosoft Comnn Control


M icrosoft MAPI M essage Control
M icrosoft MAPI Session Control
O utline Control
PicClip Control

C ancel

A d d Control..
Result-----------------Inserts a n e w 'O utline Control' control into your
docum ent.

. 1 0 .1 4 . Insert Object Outline Control

Form: | Forml

Page: f

. 1 0 .1 5 . Outline

Properties Pictures, PictureClosed PictureOpen
. ,
Browse (. 10.16).

converted to PDF by HupBaH9I

: Outline Control
G eneral

P ictures | Fonts | Colors |

Property N ame:

Preview:

[P ictureC iosed
Browse...

Clear

. 1 0 .1 6 . Pictures Outline Control


(BackColor) (ForeColor)
Properties Colors, ForeColor (.
10.17).
: Outline Control
G eneral | P ictures | Fonts

Colors |

Property N ame:
[ForeColor
System Color:

I M _ lJ

a a

. 1 0 .1 7 .
. 10.18 , Outline Control
ForeColor, PictureClosed PictureOpen.

converted to PDF by HupBaH9I

Form' |Fopml

P b jik |

. 1 0 .1 8 .
Init Olec1 :
&& aTabList .
&& , ,
&& W H E R E
S E L E C T table slist.table _nam e ;
FROM datavocabula ry!table slist ;
W H ER E A L L T (Ta b le slis t.ta b le _ n a m e )< < > > "S a le " ;
A N D A L L T ( T a b l e s l i s t .t a b l e _ n a m e ) < < > > " A c c o u n t " ;
A N D ALLT(Ta b le slist.tab le_n a m e )< < >> "C usto m er" ;
A N D A LLT(Ta b le slis t.ta b le _n a m e )< < > > "O rd e r" ;
A N D A L L T ( T a b l e s l i s t .t a b l e _ n a m e ) < < > > " S a l e s m a n " ;
I N T O A R R A Y aTabList
&& nnPabl
n n P a b l= 0
&&
&& 1nnAr, 2 n n A r, 3 n n A r, < 1 9 3 >
&& Olec1
&& , ( i n d e n t ) = 2
&& (P ic t u r e T y p e ) = 2
F O R X = 1 T O A L E N (a T a b L is t)
T h i s F o r m . O l e c 1 .A d d I t e m ( A L L T ( a T a b L i s t ( X ) ) )
nnTa b = A LLT(a Ta b List(X ))
n n A r= "n n A r"+ A L LT(S TR (X ))
S E L E C T Ta b le s .fie ld _n a m e ;
FROM datavocabulary!tables ;
W H E R E Ta b le s .ta b le _ n a m e = n n Ta b ;
IN T O ARRAY &nnAr
n n A d d It e m = " T h i s F o r m .O l e c 1 .A d d It e m "
n n Arn = " n n A r " + A L L T ( S T R ( X ) )
FOR I = 1 T O A L EN (& n n A rn)
&n n A d d I t e m ( A L L T ( & n nArn ( i ) ) )
n n B e b y = n n P a b l+ X + I-1
T h is F o r m .O le c 1 . in d e n t ( n n B e b y ) = 2
T h i s F o r m .O le c 1 .P i c t u r e T y p e ( n n B e b y ) = 2
ENDFOR
n n P a b l= n n P a b l+ A L E N (& n n A r n )
ENDFOR

converted to PDF by HupBaH9I

,
. . 10.19.

. 1 0 .1 9 .


, .
.
, . 10.20. Visual Basic
.
, , ,
, Visual Basic, - Data Form Designer -
, . 10.22.
. . 10.21.
, ,

.
, . 10.20.
Label CommandButton Caption,
.
Data Control,
Allign 0.

converted to PDF by HupBaH9I

| 10 6

4 . : 1

i i

October 1996

[October ~

3 |1996 j J

. 1 0 .2 0 .
-
^: [, ffif:[)rjiTi

- - 1

] C q Iq Form Designer
3 s s =

F o m

N o m e

(w / c

E x ten s

Accounts

c n ):

31

_bm= yinng:

|Access

JFirah s fi l\. r R '

- ^ocum nts^DO^Mc?-v9ool<\v'9y\UTI T I.M DE

Qogn DsflEbsse

^=|^ jrrF'

|_1

S c lo c t

/ C L C h yD of

A v^ alno le L b l i n n s :

t is

lie : o r o n H o r a

S O L

c ta to n -o rt

I c lu d e d fJ c U im n s

KFV_Anr.0U\T
KEr_:U ST H M ER
K F Y _ 4 I 1

UAI h_W-il I b
S E .L E D

SU4
QUANTITY

D rtg/l: re p to Change
l.i l J Hi h F

0re e i

Lbb!

unn

!-.
e

Cnncoi-: , ^

. 1 0 .2 1 .

converted to PDF by HupBaH9I

Account
; KEY_ACCOUNT:
D A TE_W R ITE:

: SELLED:

; SUM :
Q U A N TITY :

Add

Delete

Refresh

Update

Close

IL j

N _!|

j
m

. 1 0 .2 2 .
.
cmdCallData " ".
cmdCallData_Click() :
frmNewDate.Show
.
Insert Form.
frmNewDate " ".
Calendar , , .
olcCalendar. Visual Basic
ActiveX , ,
Properties Visual Basic. , ,
:
Private Sub olcCalendar_AfterUpdate()
frmAccounts.txtFields(1) = olcCalendar.Value
End Sub
, ,
date_write Account.

11

11.1. Visual FoxPro

11.2. Access
, ,
. - ,
.
. ,
, ,
, .

11.1. Visual FoxPro


Visual FoxPro
, .
Visual FoxPro,
.

converted to PDF by HupBaH9I


. ,
, , .
,
.
(
) . 11.1. , Details,
,
, .
. , , . .
( R e p o r t D e s i g n e r )
- . . 11.2
.

11I l"i I-J


Details

Mini null Vhi j.ilt-iiHhii


Ejfa 4
Fnmd: locfe

Mndaw

}5 | | | ? ~ 1 ^ j
t |11 |1<=|-
-

P..

P....

*!

(' * }

/
/

IfrUbM...

r-;l-sJl .*...

P... , f . . . J

J!?._ . In _j_ln_

L ;ck FtepmL..
*

2
A I M 1-|a|c| is
r v r v v v



feni3p-dhft2Sti mcdViiDirxrti

HdTpytJiftHTOb

* HHfitpiyhjfftMToe
&


. 1 1.2 .

Report,
Visual FoxPro, :

Title/Summary - .
Data Grouping - .
Variables - .
Default Fonts - Windows
,
.

converted to PDF by HupBaH9I

Private Data Session - .

,
.
Quick Report - .
Run Report - .

,
View Format,
.

, . 11.2.
. Report Controls
Form Controls
. . 11.3.


General


. 1 1 .3 . Report Controls
Quick
Report Report.
. Quick Report,
. 11.4.
we

fluirt n^ftnil

*1

VetdLEJ.OU

=] z=i::

^_j

II'!
J? L::
F kit 11*ati Lrvrcmrenlt
Vdls
I

1 ..... 1

Rhlfidp IfiMftlllfiHUfl Fi

Data Environment

{ ^ )
Bbieoq
. 11.4.
Quick Report Details,
- Page Header. Page Footer
D A T E ( ) , - _ P A G E N O
( ) "Page" . ,
,

converted to PDF by HupBaH9I

, Title, . ,
, ,
, .
. 11.5 , Quick Report
Propmod, .
Data Environment View. ,
, , ,
, .
S E L E C T S Q L .
- Data Environment.
:,

net1
1

Eta E d

Vim J

N n

bJUEndcm irt d w

i * R : ;;i i j i _i

v j -

fcf
*i i i I i i i4 . i i I i i i i i I .i I . I . I . *I
!

,1. I . . f\

I -

\__ I

Al

|Mtheds| L ir t J | QUte

S_______
......
........................

ii

^ bets-a)

tiiMEvfrf

treliMi

'' ^(briai)

..............................
> | \*;\ |:_||;|'^1 L I

Itf E-rtrt _ ~~

hMi*

Pejaua]

liftjl*f Lii*df**fclhbbk.OJ,-ii*V
W*I Gun?
>1 I

Qata Environment

Properties

. 1 1.5 .

,
.
Data Environment, Project Manager. Project
Manager Data Environment.
, , , FoxPro ,
.
( ), ( , , . .)
. ""
Visual FoxPro. ,
,
.
.
.
, , , S h ift,
.
(selection marquee). , .
, .
,
, o . p , .
o , E n t e r .
oo, op p, , opo,
p oo , o .
Format:

converted to PDF by HupBaH9I

Align -
. Layout
.
Size -
. Layout.
To Grid
, Snap to Grid .
Horisontal Spacing - (Increase), (Decrease)
(Make Equal) .
Vertical Spacing - (Increase), (Decrease)
(Make Equal) .
Bring to Front - ,
.
Send to Back - ,
.
Group - ,
, .
Ungroup - .
Snap to Grid -
.
Set Grid Scale - .
Font - Windows
.
Text Alignment - .
O L E- .
.
Fill - .
Pen - .
Mode -
.

Report Controls (.
. 11.3). , , ,
, Report Expression,
. 11.6.
Report Expression
Expression:

J
J

N AM E M O D E L

Format:
Calculations..

OK
C ancel

Print W h e n ..

Object Position

W u

FJoat

( * Fix R e la tive to To p of Band

Fix R e la tive to B ottom of Band

S tretch w ith overflow


Comment

. 11.6.
o ( )
, ^ T O p h ^ , ,
, , p oo.
, p , p,

converted to PDF by HupBaH9I

Expression , op ,
. opo , oo , p
p p p p Visual FoxPro
p. po .
Format Report Expression , ^ ^ p b m
.
:

A - .
L - .
N - .
X - .
9 -
.
# - , .
$ - .
$$ - .
* - ""
.
. - .
, - .

, "9,999,999.99",
,
.
Format
. . 11.1 ,
Format ^ ^ o r o .
1 1 .1 .

p
To Upper
Case

o p

Ignore
Input Mask

Left Justify

o,
po

Right Justify o,
po p
Center
Justify

o p

po
Left Justify

Blank if
Zero

p , p 0

(Negative)

CR if
Positive

oo
CR - ^

DB if
Negative

o p
DB -

Leading
Zeros

Currency

op

Scientific

converted to PDF by HupBaH9I

Edit "SET"
Date


p ,
o S E T D A T E

British Date p po
p
Object Position , ,
. Float
,
, .
, .

- ,
Stretch with overflow.
.
, (,
), Float.
Stretch with overflow ,
o oo . , o
p op, .
Fix Relative to Top of Band
.
Fix Relative to Bottom of Band .
p Calculate p o o, p
p , .
p ooo Calculate o pp Reset,
p .
,
, . ,
, . 11.2.
, Report Expression, - Print When.
, ,
.
Print Repeated Values o - Yes No.
Yes , .
^ No p , ^ p.
Also Print
.
Remove Line If Blank ,
.
Print Only When Expression is True
.
o p, p ,
, pp, p , oo
p p p.
1 1 .2 .

Nothing

^
o ( )

Count

Sum
Average

, ^
,
o, p Reset
o
p
^
() ,
p o

Lowest

Highest

Std.
p
Deviation

converted to PDF by HupBaH9I

,
Variance ,

oo o
, ,

,
.
, ,
. . 11.7.

I
|2,4343

3
^

Hteit Dindl I* jii

Gaicel

: I:S 3 IG n ---------

J
J

E -*: |

O r E -1



. 11.7.
Page Setup File.
Page Setup p p. 11.8. ,
.
^ pp - p
Data Grouping Report. 20 p pp.
p pp pp,
pp p pp.
op:

p ;
;
p p o ;
o o o .

:
1.
2.

3.

p Data Grouping. , . 11.9.


oo , p p p ,
Group Expression. op
p o .
o o Group Properties (. . 11.9).

converted to PDF by HupBaH9I


|| PmpfilflFS----------------------------------------------------------------------------

" S:art Group onNev' CoUmn


S:art E a r h G r o jp on a N e w P a g e
R eset P age to 1 (or E a c n G roup

.Reprint Gr:u> Header on E-ith Page


ta rt G roup n N e w -'a g e w h e r I ess t h a n f o ir a ij

-c t i i o k


rrm n i- | . hi

soil
. 1 1.9 .
o o o , p o. p
Group Expression op . o oo
op p . oo
p p o Details. po
oo , opo p,
p. , o p o o opo
p.

, , , ,
, .
, Data Grouping
Start Each Group on a New Page.
Variables Report op p ,
p . p o
p p p ,
. op Variables ^ p Report
Variables, p p,
p (. 11.10).

converted to PDF by HupBaH9I



I__________________
R e p o rt V a riab le s

Variables:
OK
Cancel

In se rt

Delete
- C a lc u la te
(" N o th in g
C~ C o u n t

Sun
C~ A v e ra g e

Lowest
C" Highest
Std. D aviation
f * V a ria n c e

(. . 8.2)
,



. 1 1 .1 0 .
p p ,
, p p.
p
.
, po p Variables, o
. p . o
p o p p, p
o p p.
. ,
Report
Variables . nRec. Calculate
- Count ( ). Data Grouping
I N T ( n R e c / 1 0 ) .
Group Header Group Footer, ,
.
, , Preview View.
,
, ,
.
,
. , , .
,
- -
, , .

converted to PDF by HupBaH9I

.
.
Visual FoxPro .
,
.
:
1.

2.
3.

,
. , . , ,
,
,
.

.
.

. Project Manager
Documents, Reports New.
Report Wizard
- Report Wizard.
, . 11.11.
PROPMOD.FRX
. , . 11.12. ,
. : -
, , , .
.
, .

' Report W izard

Step 1 - Field Selection


W h ich fields do you want in your report?

1. Select a database or the Free Tables item.


2. Select a table or view.
3. Select the fields.

D atabases / Tables:
Free T ables
PFIOPMOD

A va ila b le Fields:

S ele cte d Fields:

N am e_m odel

-*-

j J

C ancel

S w e p t_ vo lu

Q uantity_d

__

C apacity

Next

d
Finish

. 1 1 .1 1 .

converted to PDF by HupBaH9I


n*f|radl
- ptDtHttfLdil
0. , . 1 . 1 l| . i . 1 .
:1

. 1,

<1

,l| . .

?
t l . i . | . i ,t | .
7
\ I

-
| ^ ___|
A Tlilc
1
.( H w t p
.
Key Moduli

b ttL 1

Home fflafieii
Swept Virtu

1
"

ISV^^r.YClJ

Q.i inniv (1

|iAPbci:v |

T diquo

|TCfiOUE_l

Tap !

[TpF^SPEElJ

EtuiJng
l.fingth

|c_L!-+j 111__

Width
"

HctuN

*_1

LiqfWjnK^J 9ft

lEKf&JSEj

NmteFffm
Nuiu Caufri

_ Tm* "

d
i

. 1 1 .1 2 . PROPMOD
Label Report
Controls .
, Picture/OLE Bound Control
Report Controls .
, . 11.13. ,
.
, ,
. ,
. ,
,
.
, .
, Scale Picture - Retain
Shape. .
, , .

converted to PDF by HupBaH9I

:
G eneral
BM P ICO
r '

Report Picture

ictuie From
( * i Fie:

OK

c:

book\sa m p le \re p o rt_ l. bmp


Cancel

- C Field: [

If Picture A n d Frame D iflerent S izer


- ( * Clip Picture
-

Scale P icture - R etain S hape


Scale P icture - Fill the Frame

0 b je c t P ositionr
FJoat
( * Fixed R elative to J o p of Band
C" Fixed R elative to B ottom of Band

Center Picture

Print W h e n ..

Comment


. 1 1 .1 3 .
. 11.14.

converted to PDF by HupBaH9I

' i.l.lij-if 1 -ipcapUKKf.


1 .. 1' ... 1J... . t >. .. , . t .

V.

. 1*. . 1

|'

'I

[19

|l<

lit

i'V

:1

|l!:

<

Tifle
Hfcudei

MODFL _

IPAME FIRM
[Same f oiTNTBY
|SWEPT VOLUME

P&lpn'iiirt
( )
.

DRlUil
IfAPAfllTV
|CrL'F


% iiu q d (IlM)
InruDFTtb

(kmj4)
]li jj mj i 100 / (

7-

j
i
1 1


IsTAKmc
I ItfAHE TTHE

I
.

. 1 1 .1 4 . PROPMOD

REPORT FORM FileNamel | ?
[Scope] [FO R lExpressionl] [lExpression2]
[H E A D IN G cHeadingText]
[N O C O N S O L E ] [N O O P T IM IZ E ]
[PLAIN]
[PREVIEW [N O W A I T ] ]
[ T O PRINTER [PROMPT] | T O FILE FileName2 [A S C II]]
[NAME ObjectName]
[SUMMARY]
FileName1 .
Scope.
.
FOR WHILE.
, .T..

HEADING. PLAIN
( ). ,
cHeadingText .
SUMMARY,
, Details, .
N O C O N S O L e
.
NAME Data Environment.
, ( )
. ,
.
,
, PREVIEW, T O PRINTER T O FILE .
,
N O W AIT.
PROMPT
. , T X T

.
, A S C II. ,
.

A S C IIC O L S = nExpression

converted to PDF by HupBaH9I

nExpression 80.

_ A S C IIR O W S = nExpression
nExpression 63.
, , ,
:
_ A S C IIC O L S = 60
_ A S C IIR O W S = 40
REPORT FORM Rep_price T O FILE D:\IN FO \PR IC E_TEXT A S C II


Windows
: , . .
, Visual FoxPro ,
, - . R E P O R T FO R M
T O PRINTER PROMPT,
. . 11.15.

Windows


-
-

[E p s o n F X -S 70

; > * 1 :

E p s a ri F X '7 0

LPT 1:

4 210 2 9 ?

1:

. 1 1 .1 5 . Visual FoxPro
,
G ETP R IN TE R ()
-
, . ,
, Visual FoxPro.

converted to PDF by HupBaH9I

expr, ,
.
, 16
:

D R IV E R - , W in d ow s
. ,
.

D E V IC E - .
O U T P U T - , .
O R I E N T A T I O N - .
P A P ER S IZE - .
P A P E R L E N G TH - .
P A P E R W ID T H - .
S C A L E - .
C O P IE S - , .
D E F A U L T S O U R C E - .
P R I N T Q U A L I T Y - .
C O L O R - , .
D U P LE X - , .
Y R E S O L U T I O N - .
T T O P T I O N - T r u e T y p e .
C O L L A T E - .

e xp r Propm od . 11.16.

PRTINFO(nPrinterSetting [, cPrinterName])
, W indows.
n P r i n t e r S e t t i n g :

l 2 3 4 5 6 7 8 910
11
l2
13






,



-
-
- T r u e T y p e
-


A PR IN TER S(A rra yN a m e )
.
. , :
AP R IN TER S(aC urrentP rn)
a CurrentP rn :
ACURRENTRRN
Pub
A
( 1, 1) C "Epson L Q -1 0 0 ESC/P 2"
( 1, 2 ) C "L P T 1 :"

P R IN TS TA TU S ()

converted to PDF by HupBaH9I

, .T.. ,
.
, ?

PRINTJOB

<< > >


ENDPRINTJOB
, . ,
,
Propmod.
_PBPAGE = 2
_PEPAGE = 4
PRINTJOB
REPORT FORM Propmod T O PRINTER
ENDPRINTJOB

11.2. Access
MS Access
, . ,
.
,
Access.
, ,
, ,
- .

. .
,
,
.
-
RecordSource ( ).
,
, .
,
Access , ,
. , .
, Properties
(),
.
,
.
. ,
, .
,
/, . 11.17.

converted to PDF by HupBaH9I

/
/

j
j

(* ^!
'

:
[
:
[

. 1 1 .1 7 .
, ,
, ,
.
, ,
, .
.
Windows. ,
, , Windows
. ,
. , , Access -
. ,
.

, , ,
.
, .

. , ,
,
. , , ,
.
, ,
.

.
,
, , .

. .
/ .
Access, Visual FoxPro, : ,
( ), , ( , ,
) . ,

converted to PDF by HupBaH9I

, .
.
,
, -
.
.
, " "
.
, SQL:
S E L E C T D IS T IN C T R O W country.country_name, model.name_model,
[automobile passenger car].date_issue, [automobile passenger car].cost
FROM country INN ER JOIN (firm INN ER JOIN (model INNER JOIN
[automobile passenger car] ON model.key_model = [automobile passenger
car].key_m odel) ON firm.key_firm = model.key_firm) ON country.key_country
= firm.key_country;
, " ".
, ,
,
. ,
. - ,
, -
, ,
. .
. 11.18.

an H ia ia M
| }

*Ula|

3 IP ^ ty r

<^
*4

.....

_i

btMUl

P_

.1
*-!_I

ifeHjtM

1. ................ :

DRffl


. 1 1 .1 8 .

, ,
. ,
.
, ,
. ,
, .

converted to PDF by HupBaH9I

. -

. -
. , ,
. .
,
. (ControlSource).
, . 11.19.
; - '!
fljjww fra
|1

I*
jN

1*" 2

r | [ AiiaJ Csr

Jl'ivrl ul'lu I

A
=

z
p
TF
a

^-,<
.

' IMfi
. 1 1 .1 9 .

country_name,
,
. .
. /
, country_name,
- , .
,
. . ,
.
- -
, .
- . , ,
, ,
, 1.
, , , ,
.
, .
- , ,
, . ,
, ,
. .
, . 11.20, , ,
.

converted to PDF by HupBaH9I

------
^--: /
i i - i - i + J 1 4 * I * i

L - i - if i a l - i

- i n i

^
v

j&S&Bmsi] - | 6s# |

Hi
.,.

<|1_.'^_
dWV.MH

....

mtmm

# (

-- (

>,1. JTr *I;-V**


|1


. 1 1 .2 0 .
, ,
country_name. , ,
.
.
,
:
= Sum(cost)
, .

.
, ,
. . ,
, .
, . 11.21.

. 1 1 .2 1 .
-
,
. .
Picture.
,
, . O n F o r m a t, OnPrint,
OnRetreat.
F o rm a t ( ) ,
, ,
. ,

, .
:
Private S u b 0 _ F o r m a t (C a n c e l As In te g e r, F o rm a tC o u n t As In te g e r)
Dim kolor As String
kolor = c o u n t r y _ n a m e
If T r i m ( k o lo r ) = " " T h e n
M e ! c o u n try _ n a m e .F o re C o lo r = 255
risrep.Picture = "c:\project_book\Flggerm .ico"
E n d If
If T r i m ( k o lo r ) = " " T h e n
M e ! c o u n try _ n a m e .F o re C o lo r = R G B ( 0 , 2 55, 0)
risrep.Picture = "c :\project_book\FlgItaly.ico"
E n d If
If T r i m ( k o lo r ) = " " T h e n
M e ! c o u n try _ n a m e .F o re C o lo r = R G B ( 0 , 0, 2 5 5 )
risrep.Picture = "c:\project_book\Flgusa01.ico"
E n d If
End Sub

c o u n t r y _ n a m e ForeColor (
) c o u n t r y _ n a m e Picture risrep,
,
. , . 11.22.

,
, ,
. , .
, , ,

.

Access:

;
;
, ;
,
(, - );
,
, ;
, .

Access .
.
- .
"". ,
. " ".
" ", - " ".
.
, , ,
cmdPrint.
, .
,
OnClick ( ), :
Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click
Dim stDocName As String
stDocName = "Account"
DoCmd.OpenReport stDocName, acNormal
Exit_cmdPrint_Click:

converted to PDF by HupBaH9I

Exit Sub
Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click
End Sub
OpenReport,
"" (OpenReport). :
DoCmd.OpenReport [, ] [, ][,]
, .

:

acNormal - ( );
acDesign - ;
acPreview - .

, ,
.
SQ L WHERE
WHERE
, Access ,
, . PrintOut,
"" (PrintOut).
:
DoCmd.PrintOut [ ] [, , ]
[, ] [, ] [, ]

:

acPrintAll - ( );
acSelection - ;
acPages - .
.

acHigh - ( ) - ;
acMedium - ;
acLow - ;
acDraft - .


1.
, T r u e ( - 1 ) ,
, False ( 0 ) - .
, (Tru e ).
, Access
, , .
,
.
, ,
OnClick ,
:
Private Sub cmdForm_Click()
DoCmd.PrintOut(acPrintAll,,3)

converted to PDF by HupBaH9I

End Sub

12

12.1.
12.2.
Visual FoxPro
Access
Access
Visual Basic
12.3.

12.1.
,
, , .
,
, ,
.
:

, ,
.
-
, , , . .
,
.
.
.


Visual FoxPro :

Trace .
Debug , ,
.
Command,

.
,
.
W A I T W I N D O W , ? M E S S A G E B O X ( ) .
L I S T M E M O R Y
T O F IL E .

Access Visual Basic .


.
Visual Basic, , Access

. ,
I f , , T h e n ,
, :
Sub Form_After_Update()
If m e ! [t x t T e a m ]> > "Boston"

converted to PDF by HupBaH9I

End If
End Sub
, , Visual FoxPro
.
, ERR,

S E T L O G E R R O R S O N | off
.
S E T D E V E L O P M E N T O N | off
,
, ( ),
.
, General Options,
Tools.

12.2.

Visual FoxPro, Access Visual Basic.

Visual FoxPro
,
, FoxPro ,
.
Trace Window Tools
S E T E C H O on | O FF
Trace
, . . 12.1
Trace . ,
, :

&

-'
Opt'.

13131
| .. - ;
O'l- ^ 5

Ifjul
~1

> . - ~ ,

,
*' ttw e e rt fchee^

"

J
I lo r e
. 1 2.1 .

converted to PDF by HupBaH9I

O p e n - .
Cancel - .
Line N u m b e rs - .
C lear Breakpoints - .
T r a c e Between Breaks - Trace.

Th ro ttle - .

Trace
:
1.
2.
3.

4.

Trace Window Tools.


Open Program Trace.

Throttle .
,
.
, Do Trace.


, ,
Step! Trace.
.
Out!
,
, . ,
.
p p pp Esc.
p pp p ,
. . p p
pp p , pp
, p p p ,
p p , p ( R e s u m e ) pp
(C a n c e l). p p .

S E T D E B U G O N | off
p p
p p ( Debug Windows
Tools). H p p p p, , p
, p p
E n t e r . p pp
p .
p p p pp
p , . H
p , p p p :
, , p .
,
Trace Debug , . 12.2.
:

converted to PDF by HupBaH9I


niTf-nca
______

._______________________________________________________

rn^|rftri F'-'-'.'I.i'1 Ij-Jl' i"r_-i' jjli'p"


flh m rt

ji-.SMf; ourcf?

Pm nnfurii-

| MnutuMtWf.'

LPftRflHETERS nButton. n S M ft. nXCoord. n

IF nButton = 1 : L*ft House


IF

M )S (n X tO O n 1 -

T H I S . P a r e n t . M d iiU S C )

> T H I S . P a r e n t . Q ra g W o ld

AB5(nVCDord - T H I S .P a re n t.M o u se V ) > T H I S . P a r e n t . DragH old


T H I S .Crag
ENDIF
ENDIF

. 12.2.
1.
2.

3.
4.
5.

Debug .
P R O G R A M ( ) = " M O U S E M O V E " ,
, .
.
Trace .
Do Trace .
MouseMove Trace
.

Visual FoxPro, ,
.
S E T A L T E R N A T E T O [FileName [ A D D I T I V E ] ]
FileName ( p p T X T ) ,
p p p , ^ ^ ,
p p p p pp p pp ( p
) p p p pp.
, p p p p p
p pp. pp p .
A D D I T I V E , p p p .
S E T A L T E R N A T E on | O FF
( O N ) ( O F F ) p p .
O N E R R O R [Command]
.
. ,
.
Visual FoxPro.
Visual FoxPro
Trace, , ,
. ,
, . .
,
O N E R R O R .
, , ,
. 12.3.

converted to PDF by HupBaH9I

. 12.3.
Visual FoxPro
- ,
. , ,
- , O N E R R O R ,
. Error.
PROCEDURE Object.Error
LPARAMETERS [nIndex,] nError, cMethod, nLine
nIndex
- (). nError
Visual FoxPro, cMethod - , , nLine -
, .
, Error
, Visual FoxPro , O N E R R O R , ,
, .
, Error , ,
,
:
LPARAMETERS nError, cMethod, nLine
* "File in use by another"
IF nError = 108
= MESSAGEBOX(" ! " + ;
" .")
ELSE
*
* ,
DO proc_error
ENDIF
,
, ,
.
, .
, - ,
Error , Error .
O N E R R O R ,
.

converted to PDF by HupBaH9I

,

ERROR nErrorNumber | nErrorNumber, cMessageText1

[cMessageText2]
Visual FoxPro. nErrorNumber ,
Visual FoxPro.
cMessageText1 , ,
. , ,
, Visual FoxPro .
cMessageText2 , .
nErrorNumber cMessageText2, Visual
FoxPro 1098 ( ).
, cMessageText2
C H R(13).
E R R O R
, . O N E R R O R ,
E R R O R Visual FoxPro ,
O N E R R O R . ,
Error .
E R R O R Command O N E R R O R ,
Visual FoxPro . E R R O R
O N E R R O R , Visual FoxPro
, .
, Visual FoxPro 12,
:
ERROR 12
"Variable not found" (" ").
:
ERROR 12, ' nVar1'
"Variable 'n V ar1 ' not found" (" 'n V a r1 '
").

.
AERRO R(ArrayName)
, Visual
FoxPro, OLE ODBC. ArrayName .
A E R R O R ( ) ,
.
:

. .
,
E R R O R ( ) .

.
. ,
M E S S A G E ( ) .

NULL.
,
.
,
S Y S (2 0 1 8 ).

NULL. ,

converted to PDF by HupBaH9I

,
,
.
5

NULL.
( 1539),

:
1 - ;
2 -
;
3 - .

NULL

NULL.

,
OLE 1427 1429:

. 1427
1429.

. FoxPro
.

. OLE
.

.
(, Microsoft Excel).

NULL .

,

.

NULL .


,
.

. OLE.

,
O D B C 1526 ( O D B C ).
- ODBC:

.
1526.

.
.

. O D B C
.

.
O D B C SQL.

. O D BC
.

.
ODBC.

NULL.

ERROR()
, ,
O N E R R O R .
L IN E N O ([1 ])

converted to PDF by HupBaH9I

,
. 1,
.
, .
, Debug
, , L I N E N O ( 1 ) = 1 00.
Debug .
M E S S A G E ([1 ])
, 1
, .
O N E R R O R .
PROGRAM([nLevel])
, .
, ,
nLevel = 1 , ( ),
, .
:
ON ERROR DO ^ ^ W IT H ;
E R R O R (),M E S S A G E (),M E S S A G E (1 ),P R O G R A M (),L IN E N O ()
RETURN
PROCEDURE proc_error
LPARAMETER nError, cMess, cMess1, cProg, nLineno
? " : " + L TR IM (S T R (n E rro r))
? " : " + cMess
? " , : " + cMess1
? " : " + LTR IM (STR (nLineno))
? " : " + cProg
RETURN

Access

Access. . 12.1. . 12.4
.

. 1 2 .4 . Access
1 2 .1 . Access

converted to PDF by HupBaH9I

F9

F8

S h ift+ 8


.
Access , :

.
Stop.
.

A c c e s s ,
. .
Access, .
, ,
:

, ;
.


.
, ,
.
,
, . ,
,
.
. , ,
, .

, Print (. 12.5).
, Print, ,
Print.

converted to PDF by HupBaH9I

[F o rm s m o d u le ]

?re t_n u m ()
2

. 12.5.
Print Debug,
.
.
, . ,
myvar:
Debug.Print " =" & myvar
, , (
m yvar) . , ,
vyvar, .
(Calls), . 12.6,
,
.

i-i

f I.I

IIIH J iy fin

. 1 2 .6 .
, :

. ,
.
.

, , , ,
- , , ,
.

. ,
. ,
, .

converted to PDF by HupBaH9I

, ,
, - ,
.
,
, . ,
, ,
, - .
, Access ,
, , , , . Access
, ,
.
:

.
, .
, ,
.
, .
.

?
, ,
.
:

. ,
, -
.
,
.
,

.

. Access
, O n E r r o r G o t o < < > > .
, ,
, - .
Access O n E r r o r G o to ,
Access ,
- .
.
. 12.2.
1 2 .2 . Access

O n Error Goto

Err
()

Err

Err ( )

Error
()

Error
( )

Resume


, ,

converted to PDF by HupBaH9I

Resume Next

,
,
,

Resume

, :

. ,
, O n E r r o r , Access,
. O n E r r o r
,
.
.
S e le c t C a s e ( ),
E r r .
. R e s u m e
, ,
.

:
On Error Goto 0
Access ,
:
1.
2.
3.

.
, (
).
Access,
.

Access
, , Error.
M ic r o s o f t J e t , Access.
Error,
Microsoft Access
,
.
O n E r r o r , Access,
Error. ,
.
, Error
:
Sub Form _Error(DataErr As Integer, Response As Integer)
DataErr , E r r
. DataErr E r r o r $ ,
. Response ,
.
:

D A T A _E R R C O N TIN U E - ,
.
.

converted to PDF by HupBaH9I

DATA_ERRDISPLAY - .
Microsoft Access.

Visual Basic
Visual Basic Debug.
, .
12.7.
^

CebugWi ico 'a'

fRecicy}


I h d i r r il T i

V a lu e

| Junbd.-..

F ^ p t f ir r i m n n l r l r : rifir: i r n r r

K|iih!-s i i i in

rnj (Jiiu i

Jji f lg E

0 u t f c n 1e - d

il i li-

riHi:

i i :i in h i iirn l
F rrn 1

- r rn _ _

jo

cd

D i * F l g E d i t As I n t e g < ?r

D ii

flg S e ro ll

fis I r t - i

iJ J

2\

. 1 2 .7 . Debug Visual Basic

. Watch,
,
.
Add Watch Tools.
, . 12.8.

converted to PDF by HupBaH9I

A d d Watch

* iression:

____

ffigEdit
1

- Qinlsjd----------

P ro c e d u r e :

|F o r m . L o s d

Module:

|F[3rm1

Prqject:

ifiwoice

Help

-W a lc tiT y p a -----------------------------

Wfllch ExpTsssian

f Greek Vrtiert Value Is True


<*[! Wheji Value Qiancjesj

True
(
)


. 1 2.8 .
Expression .
Context ,
. ,
( All Procedures All Modules) .
Watch Typ e Visual Basic
.
Immediate,
, ,
, Command Visual FoxPro.
Visual Basic
Access.

12.3.
,
, , ,
.

.

, .
, Visual
FoxPro. .
Project Manager
, Visual FoxPro PJX,
.
, Project Manager Visual
FoxPro, :
APP EXE (. 12.9). Project Manager

converted to PDF by HupBaH9I

Build. - ,
, ,
.

4H

O n to

Do j Passes

^ r P H l t l b H n U K

~ i\

Add.

T a b le s
I_[>i:ul V itF w ii

yodly

} <5 R e m u te V i e t
9 i S C a n n e c t io .i s

EXE

nun

i j f S S c D f u tl P r u c u d u f u t
0 3

F re e T a b le s

Q u e rie s

= [= ] Q i n t a r t i c
m id f l p H .

Fonni

O H

f f

PKojea
rfdd^pplctfion

Cqh^

*)

o u t lie

Code

e p o

I*

L e u a le

4- P . a L i b ' B i t a c

Cade
r'

P iD q fa n t
ca lc

^ !

c - i m r j i io q
m em

ftscumfHOrtJl Jikin
[n p ln y E n o n i

DcscnpiKjn:
Pali:

cM^[jyi1ic8lmain.pr5

_L


Bui id Options


*

. 1 2.9 .
Project Manager :
. ,
. Project
Manager. .
.
, , .
- ,
Project Project Info. Project
Information . 12.10. Files.
,
, . ,
, ,
.

converted to PDF by HupBaH9I

P r o je c t In fu r m u tio n - O ffic e

Pno|ad
: vpe

El

m
0

ra

m
m
m

File;

NftlTie
?
calc prg
clients fi>
client;.'.ex
currsntseJes to
arror_prog prg
first i.e.invoice, paid scx
Is Lip : bmp
rnein pic
mentis dbf
na prg
rufn_tq_etr prci
dbc

Lis tModified

Included

05,1&*
11.01 ae 12 -
17.02,9612:40
16.02,9615:51 52
180219612:10:40
22.08.9513:41 M
8 02 96 00 51 33
1.0.900):1
27.07.931
05 03.95 21 03 40
02.02,9610:31 1
21 08.9510:59:32
0509.9510:47:24
10.02.9614:27:16

9:27:24
A

Cancel

OK

Coda Page

El

?!

1251

1251

0
0
1251
0

MeIp

. 1 2 .1 0 .
Project , . 1 2 .1 1 ,
, , E X E -
.
D ebug Info,
,
Trace
. ,
.

LJ

V P fo iecl Information - Office


Files

P ro je c t

Aulhor:

Com pany.

Address

|:'., ' . 2 4

City

|-

Counlry:

Slate'
pQstalCode:

1? o10j

Home.

t\vii:.\ciifins

Lasi Built

2.t 96 09:44 42

Fjfes:

Icon

OK

Cancel

. 1 2 .1 1 .

Help

converted to PDF by HupBaH9I

Encrypted,
. ,
FoxPro , . ,

,
, .
, Project Manager
, . 12.9.
Set Main Project. ,
,
.
Visual FoxPro
B U IL D A P P .P R G , Visual FoxPro
T O O L S \ B U I L D A P P Visual FoxPro.
,
S C X V C X .
.
:
D O B U ILD A P P [ W I T H ProjectName [, AppFileName [, DebugMode [, BuildEXE]]]]
ProjectName . AppFileName -
, (APP E X E )
. DebugMode
( S E T D E B U G O N DebugMode
. T . , S E T D E B U G O F F - .F .). BuildEXE .T . ,
E X E - .
B U ILD A P P :
1.
2.
3.

4.
5.
6.
7.

.
.

,
S C X V C X .
.
VC X .
S C X V C X .
.
S C X V C X ,
.

,
Visual FoxPro.
A P P - . , ,
, Visual FoxPro.
E X E - AP P - ,
Visual FoxPro.
V F P 3 0 0 .E S L . E X E - , APP, , ,
.
,
. , ,
E X E - , .
Visual FoxPro :

Database
Form
Menu
Program
Project
Q uery

Ta b le

converted to PDF by HupBaH9I

,
"Feature not available" ( ).
, :
BUILD APP MODIFY FORM
BUILD EXE MOFIFY MENU
BUILD PROJECT MODIFY PROJECT
COMPILE MODIFY QUERY
CREATE FORM MODIFY S TO R ED PROCEDURE
CREATE MENU MODIFY STR U C TUR E
CREATE QUERY MODIFY VIEW
CREATE V IE W SUSPEND
FILER S E T
MODIFY C O N N E C T IO N S E T STEP
MODIFY DATABASE
,
.
ADDLABEL.APP
AUTONAME.PRG
BROWSER.APP
BUILDAPP.PRG
BUILDAPP.SCT
BUILDAPP.SCX
BUILDER.APP
CONPROCS.PRG
CONVERT.APP
C ONVERT.H
C O N V ER T.P JT
CONVERT.PJX
CONVERT.PRG
CVTALERT.H
C VTS CX .H
FD3.FLL
FDKEYWRD.CDX
FOREIGN.H
FOREIGN.PRG
FORMPARM.PRG
FOXHELP.DBF
FOXHELP.FPT
FOXHELP.HLP
FPCNEW.PRG
GENDBC.PRG
GENERIC.PRG
GENMENU.PRG
HC35.ERR
HC35.EXE
IM A G ED IT.EX E
IM A GED IT.H LP
JD.FKY
JD.PRG.
LOCWORD.H
LOCWORD.PRG
MIGDB4.H
MIGDB4.PRG
MIG NAVPR.TXT
MMSETUP.PRG
MRBC.EXE
MSGRAPH.HLP
MSINFO.EXE
PRO_EXT.H
PUTNAME.PRG
RESERVED.FLL
SHED.EXE

converted to PDF by HupBaH9I

SHED.HLP
SPELLCHK.APP
TRANSPRT.PRG
VFP.EXE
W INAPIM S.LIB
WIZARD.APP
W IZARD .FLL
WZFORM.APP
W ZFOXDOC.APP
WZGRAPH.APP
WZIMPORT.APP
WZMAIL.APP
WZPIVOT.APP
WZQUERY.APP
WZREPORT.APP
WZSETUP.APP
WZTABLE.APP
WZUPSIZE.APP
Visual Basic
Visual FoxPro. Visual Basic EXE- .
Make EXE File File.
Visual Basic - Application Setup Wizard,
. 12.12. Setup Wizard Visual
FoxPro
, .

'^Viiuol Basic 10 Selu|WnBid - Step 1 nl 7

Whee ia ibc ViflueJ Basic project liJe ipr ihe nppHcalion ibm you
went la dieliibl7 U;m 1in: thre-dcl butlpn la select an eixitliiig
prajpd file.

| 1Fife
|D ',My D c cumenl?\DOONew BDGk\VS\Cjeaf_D3 vtip

L i nl. 1lig P-ruted's. EXE File

Template

Help

tleils

. 1 2 .1 2 .

1

Visual FoxPro 5.0



Project Manager

converted to PDF by HupBaH9I




-

OLE

, ,
Visual FoxPro, 5.0. 4?
Visual FoxPro 3.0. ?
Microsoft . Visual FoxPro 5
Microsoft: Visual Basic 5.0 Visual
C + + 5.0. ,

.
Visual FoxPro
,
.


Visual FoxPro .
.
( A p p lic a t io n W i z a r d )
Visual FoxPro .
. .1.1 .
:

,
Visual FoxPro.
, . .1, Framework only.
.
, ,
.

, , .
, .

converted to PDF by HupBaH9I

.' A p p l i c a t i o n W i z a r d
Step 1 - C h o o s e Project Location

How would you like to set up your prated?


You can create a complete or just framework,
which you can add components to later. To hawelhs wizard
create ell the directories for you, dick the Create preset
(firectory structure option.

Project T y p e ---------------------

CompSste appfc^ton

Project name:
A u to _S to re

Framework gnty
Project tile:
d:lm y d o cu m e n ts W o cV ie w 1_31.

Browse...

Jv* g-eate project directory structure

Help

'.iSapc&.-i

Next>

Finish

. . 1 .1 .
O r a c le S e r v e r 7 .0 (O r a c le U p s i z in g W i z a r d )
Oracle,
, ,
Visual FoxPro Oracle. ,
O D B C Oracle Windows NT.
SQ L Net -
Oracle.
.
:

Form Wizard
.
Pivot Table Wizard Mail Merge Wizard 32-
O D B C Visual FoxPro.
Upsizing Wizard .

W e b - ( W o r l d W i d e W e b
S e a r c h P a g e W i z a r d ) ,
, , W e b - .


Visual FoxPro 5.0 CD -R O M ,
.
"" Visual C + + .
,
Online Documentation.
,
Visual FoxPro.
, ... "" ,
Access 70
. ,
. , 4 86 D X 2 -66 20
.

converted to PDF by HupBaH9I

Visual FoxPro 16- Windows 3..


Windows 95, Windows
N T 3.51 Windows N T 4.0.
Microsoft Visual
FoxPro 5.0 Windows 95:

486 50 MHz.
.
10 .
: 15
, 100 - 240 - .

Setup Wizard OLE Automation


Runtime Visual FoxPro. ,
Visual FoxPro.

Project Manager
Project Manager ,
, (. .1 .2).
Microsoft Visual SourceSave -
. Project Manager
.

k LProfecl -Aula_store

All

Data

| Documents

m\

Classes

|j

Code

Ottier

EJew wzabGuldialog
I B w za p p lic a lio n

Add..

3 wiquiclcsiftrtbrrri

<= aLito.stofe

Mc-tlirv

I H capplEcalion

"URarnovs..
Build...

Description:

Patti:

d:^vfpE\wizards\appwiz.vo:
. . 1 .2 . Project Manager


. -
, , Command, , Visual
Basic. , ,
, . . 1.3.

converted to PDF by HupBaH9I

avlo.pfg

SELEC T A

-1

LISE PODVSOST
IN D E X ON k :O d _a vto p TO
SELEC T

'POD KODf COMPACT

USE :: a y k ^ H
INDEX ON kod 3 . L TO 3AV COME
SELEC T

LfSE K U R S_V A L
in d e x o n k:od_ S t E TO TKUR__VAL 1 COME
SELEC T E

<1

BuiPd E xpt :

Do DMo.prg
EjsbcuIb Selection

LISE T O P L I V O
D EC LA R E d n (3

Copy
Paste

PioMdure/Funalicmj.isl...

Fgnl...
Eind,,.

_fiTo...___
Beautify...
Jndent
ynindsni
! .hj- ir-i !
Unconm enl
Properties...

. .1 .3 .
Build Expression .
, .
, , Execute Selection.
Procedure/Function List (. .1 .4 ), ,
,
.

EH

. r Procedures and Functions

DEL

E X fTjTM

U) HELPER
aKOD_ERRCR

GoTo
Close

a N E W JTM
aCMQQSBLUQ
jQ4Q0SeN2Q

E1RASCET
v ib i

zi
Sort by: | Name
I* Display/DEFINE definitions

. .1 .4 .

converted to PDF by HupBaH9I

, . .1.3, :

Comment Uncomment.
, , , ,
.
.


.
. . .1.5
. , ,
-
.

LJ

D t!^ii]iib !i - u ii^ lu m y r.ifbf

Fields | IrufswsE

Tsbfs |

key_customer
name_cu9tomer
artdreES

Widh

DBcimnl

Inc Bit

NULL

OK

fnteger

[Character

JO

Character

30
1?
l

tel

Ctiofocter

tat;

tDejcenctinij

I ms

lA ice n riin g

17

Display

Delete
H eld volidolpon-

Fcrrnet

Rl<b:

1 ut ma.A ;

Mbeso ^ e ;

Caption;

Mb^ m s*HO

Feld rnmmnnt

Map -fiteld iyp Id doss es-

library
Di9|jlsY das

Dataulhvalue;

,J
d

,



. .1 .5 .

, .

.
. Table
.

converted to PDF by HupBaH9I


.
, , ,
.
S E L E C T - S Q L :
S E L E C T [ALL | D I S T I N C T ] [TO P nExpression [PER CEN T]]
[Alias.] Select_Item [AS Column_Name]
[, [Alias.] Select_Item [AS Column_Name] ...]
FROM [FORCE]

[DatabaseName!] Table [Local_Alias]


[ [IN N E R | LEFT [O U T E R ] | R IG H T [O U T E R ] | FULL [O U T E R ] JOIN

DatabaseName!] Table [Local_Alias]


[ON JoinCondition]]
[ [ I N T O Destination] | [ T O FILE FileName [A D D I T IV E ] | T O PRINTER [PROMPT] | T O SC REEN ]]
[PREFERENCE PreferenceName]
[N O C O N S O L E ]
[PLAIN]
[N O W A I T ]
[W H ERE JoinCondition [AND JoinCondition ...] [AN D | OR FilterCondition [AN D | OR FilterCondition
...]]]
[GRO UP BY GroupColumn [, GroupColumn ...]]
[H A V IN G FilterCondition]
[U N IO N [ALL] SELEC TCom m a n d ]
[O R D ER BY Order_Item [ASC | DESC] [, Order_Item [A S C | DESC] ...]]
IN T O Destination

C UR SO R CursorName [N O FILTER ]
NOFILTER ,

. , ,
, .

, (, .
.).

-
, Visual FoxPro
, , .
, - ODBC
(Connection Designer).
.
Visual FoxPro 5.0
- Offline Views - . ?
, ,
,
.
, , ,
,
.
, . ,
, ,
. Visual FoxPro
.

.

converted to PDF by HupBaH9I

C REA TEOFFLIN E( ViewName [, cPath])


.T., .

ViewName . cPath
.
,
USE [[DatabaseName.]Table | SQLViewName | ?]
[IN nWorkArea | cTableAlias]
[O N L IN E ]
[A D M IN ]
[A G A IN ]
[n O R E Q U E R Y [nDataSessionNumber]]
[N O D A T A ]
[IN D E X IndexFileList | ?
[O R D ER [nIndexNumber | IDXFileName | [T A G ] TagName [O F CDXFileName] [A S C E N D IN G |
D E S C E N D IN G ]]]]
[ALIA S cTableAlias]
[EX CLU SIV E]
[SH AR ED]
[N O U P D A TE]
ADM IN
- .
ON LIN E ,
.


DROPOFFLINE(cViewName)


,
, ,
, .
:

( S D I ) , ( M D I) .
, ,
,
, .

, .
Properties,
T a b , P g D n , P g U p , H o m e E n d C trl.
C trl .

, .
Design,
Run,
.

Visual FoxPro
(shortcut m e n u ),
.
PightClick
:
D O e d ts h o rt.m p r

converted to PDF by HupBaH9I

Insert Bar,
Visual FoxPro
.
Copy Edit,
.
(Solutions), ,
Visual FoxPro ,
.
.

OLE
- Visual FoxPro O L E-. ,
, OLE 2.0, Visual FoxPro
. out-of-process
(E X E ), in-process (D L L) .
Visual FoxPro 5.0 ,
O L E -, Application. . .1.1
, . .1.2 - .
.1 .

. Application

ActiveForm .Property [ =
Setting ]

Property -

ActiveForm. Method

S e ttin g
Method
-

AutoYield [ = lExpr ]

lExpr -

Caption [ = cText ]

cText -

DefaultFilePath [ = cPath]

cPath -



_ S C R E E N


.T.,
Windows

Windows.
.F.

Visual
FoxPro.

Windows

,

FullName

Height [ = nHeight]

Left [ = nDist ]



Visual
FoxPro

nHeight -

nDist -

converted to PDF by HupBaH9I

Name [ = cName]

cName -

OLERequestPendingTimeout nMilliseconds [ = nMilliseconds]


.

5000 .

0,

OLEServerBusyRaiseError [ Expression -
= Expression]

.F.


.

.T.,

OLEServerBusyTimeout [

nMilliseconds -

nMilliseconds]

StartMode

,


OLE
Automation,


,
,

OLEServerBusyTimeout

,



OLE Automation,

StatusBar [ =

cMessageText -

cMessageText]

T o p [ = nDist ]

nDist

Version

Visible [ = E x p r]

lExpr -

Width [ = nWidth]

nWidth -


.F.,


.

.T. -

converted to PDF by HupBaH9I

,1.2. Application

DataTo

Clip([nWorkArea
| cTableAlias] [,
nRecords] [,
nClipFormat])

nWorkArea,

cTableAlias -

.
nRecords -

. nClipFormat
-
1,

.
3,

DoCmd
( cCommand )

cCommand -

Visual
FoxPro
,

OLE

Eval

cExpression -

(cExpression)

Help

([cFileName] [,
nContextID] [,
cHelpTopic])

Visual
FoxPro

Visual
FoxPro

cFileName -



. nContextID
-

. cHelpTopic
-

Quit()

RequestData

([nWorkArea |
cTableAlias] [,
nRecords])

Visual FoxPro

nWorkArea,

cTableAlias -

Visual
FoxPro
.
nRecords -

Application _VFP.
Visual FoxPro 5.0 , Application.
:

Forms - ;
Objects - ;
Controls - ;
Page - ;
Buttons - ;
Columns - .

converted to PDF by HupBaH9I

, O L E Application.
, .
Application :
oFrm = C R E A TE O B JE C T('Fo rm ')
? oFrm.Application.Forms[1].Controls.Count


Visual FoxPro
. Trace Debug
Debugger. ,
Visual FoxPro ,
. ,
. .1.6.

Watch
Trace
y+i:^if Hi

J.Hi>1141] u*t tfui !\ k.| f] utf

Debi g

Taels

Window

\ |irifu ^)JII- WJF-.it Pvi!i

F le

Edit

Help

r|

t\ *1 | : # | < ! | | e m i a l is I
^J d JjgJ

jiliect

Jffli mgpisuiew

"3

Piocedune:

| Click

LOCHXi lY e s
nsel = n ln it
FOR nCnt = 1 t o

ThisFoEin. 1 s t So u rce . L i s tC o un t

I F T h is Form . lg t S o u E c e . S e le c t e d (nCnt.)
VtfcJbch:

Locals far

buuliuuuunliul

(]

ndiuelDnn
nhraysDrrtnp
.DCrite
bachcolor
bosadaBS
borders^a

(]
.F.
.F.
12625
"Form"

,
n&p^H&HHhie. h^accwnhi


Locals
* ,

. .1 .6 .
, .
Trace . ,
,
.
:

converted to PDF by HupBaH9I

;
l ;
m ;
, ,
.


.
Watch .
E n te r , ,
.
,
.
. Visual FoxPro Watch.
.
, ,
Window :

Call Stack - , ;
Output - ,
.

2

Visual FoxPro Visual Basic

Microsoft.
: Visual FoxPro Visual
Basic. MS Access,
- MS SQ L Server, Windows
API.
.
,
. , Visual FoxPro
,
, Visual Basic .
, , Visual FoxPro .
Visual FoxPro Visual Basic
, Visual
FoxPro.
Visual Fox-Pro 5.0 Visual
Basic:
V is u a l F o x P r o
V is u a l Basic
# D E F IN E ... # U N D E F

# I F ... # E N D IF

# IN C L U D E

$
In S tr()
%

Mod
& ()

converted to PDF by HupBaH9I

:: ( )

? | ??
Print
???

ABS( )
A b s()
A C L A S S ()

ACO PY( )

ACOS( )

A D A TA B A S E S ()

A D B O B J E C T S ()

A D D CLASS

A D D T A B LE

A D E L( )

A D IR ( )

AELEM EN T( )

AERROR( )
Err DAO
A FIE L D S ( )

A FO N T()

A IN S( )

A I N S T A N C E ()

ALEN ( )

ALLTR IM ( )
Trim ()
A L T E R T A B L E - SQL

AMEMBERS( )

APPEND
AddNew RecordSet DAO
APPEND FROM

APPEND FROM ARRAY

APPEND MEMO

APPEND PROCEDURES

APR IN TER S ( )

ASC( )
A sc()
A S C A N ()

A S ELO B J( )

A S IN ( )

converted to PDF by HupBaH9I

ASORT( )

ASSERT

A S U B S C R IP T( )

AT( )
I n S t r ( ) .
A T A N ()

ATC( )
I n S t r ( ) .
A TC C ()

A T C L IN E ( )

A T L IN E ( )

A T N 2 ()

A T_C ()

AUSED( )

AVERAGE

BEGIN T R A N S A C T IO N
BeginTrans
B ETW EEN ( )

B I N T O C ()

B IT A N D ()

B ITC LEA R ()

B I T L S H I F T ()

B ITN O T()

B IT O R ()

B I T R S H I F T ()

B ITS E T()

B ITTE S T()

B IT X O R ()

BLANK

B O F()
BOF RecordSet DAO
CALCULATE

CANCEL
End
C A N D ID A T E ( )

CAPSLOCK( )

C D | C H D IR
ChDir
CDOW( )

converted to PDF by HupBaH9I

CDX( )

C E IL IN G ( )

C HR( )
C h r ()
C H R SA W ( )

C H R TR A N( )

C H R TR A N C ()

CLEAR RESOURCES

CLOSE

C LOSE INDEXES

C LOSE TA B LE S

CMONTH( )

COMPILE DATABASE

C OMPOBJ( )

C O N T IN U E

COPY FILE

COPY INDEXES

COPY MEMO

COPY PROCEDURES

COPY STR U C TU R E

COPY S TR U C TU R E EXTENDED

COPY T A G

COPY T O

COPY T O ARRAY

COS( )
Cos()
COUNT

C PC ON V ERT( )

CPCURRENT( )

CPDBF( )

CREATE

CREATE CLASS

CREATE CLASSLIB

CREATE C O N N E C T IO N
Connect DAO
CREATE DATABASE
CreateDatabase Work-space DAO

co n ve rte d to PDF by H u p B a H 9 I

CREATE FROM

CREATE QUERY
CreateQ ueryD ef DataBase DAO
CREATE SQ L VIEW
SQL QueryDef DAO
CREATE TABLE - SQL
Execute Database DAO
CREATE TRIG G ER

CREATEBINARY()

CREATEOBJECT( )
CreateObject()
CREATEOFFLINE( )

CTOBIN( )

CTOD( )
CDate()
CTOT( )

CURDIR( )
CurDir()
CURSORGETPROP( )

CURSORSETPROP( )

DATE( )
Date()
DATETIME( )

DAY( )
Day()
DBC( )

DBGETPROP( )

DBSETPROP( )

DBUSED( )

DEBUG

DEBUGOUT

DECLARE
Dim ReDim
DECLARE - DLL
Declare
DEFINE CLASS

DELETE
Delete RecordSet DAO
DELETE - SQL
Execute Database DAO
DELETE CONNECTION

DELETE DATABASE

DELETE FILE
Kill
DELETE TAG

DELETE TRIG GER

co n ve rte d to PDF by H u p B a H 9 I

DELETE VIEW

DELETED( )

DESCENDING( )

DIFFERENCE( )
Like
DIMENSION
Dim ReDim
DIR or DIRECTORY

DIRECTORY( )
Dir()
DISKSPACE( )

DISPLAY

DISPLAY CONNECTIONS

DISPLAY DATABASE

DISPLAY DLLS

DISPLAY FILES

DISPLAY MEMORY

DISPLAY OBJECTS

DISPLAY PROCEDURES

DISPLAY STATUS

DISPLAY STRUCTURE

DISPLAY TABLES

DISPLAY VIEW S

DMY( )

DO
Call
DO CASE ... ENDCASE
Select Case... End
DO WHILE ... ENDDO
Do While... End
DODEFAULT()

DOEVENTS
DoEvents
DOW( )
W eekDay()
DROPOFFLINE( )

DTOC( )
Str()
DTOR( )

DTOS( )

DTOT( )

DefaultExt( )

co n ve rte d to PDF by H u p B a H 9 I

DriveType( )

EJECT

EJECT PAGE

EMPTY( )
IsEmpty().
END TRANSACTION
Com m itTrans
EOF()
EOF RecordSet DAO
ERASE
Kill
ERROR
Error
ERROR( )
Number Err DAO
EVALUATE( )

EXIT
Exit
EXP( )
Exp()
EXPORT

FCHSIZE( )

FCLOSE( )
Close
FCOUNT( )

FCREATE( )
Open.
FDATE( )
FileDateTime()
FEOF( )
EOF()
FERROR( )

FFLUSH( )

F G E T S ()
Input #
FIELD( )

FILE( )
Dir()
FILTER( )

FKLABEL( )

F K M A X ()

FLOCK( )

FLOOR( )

FLUSH

FONTMETRIC( )

FOPEN( )
Open
FOR ... NEXT
For... Next

co n ve rte d to PDF by H u p B a H 9 I

FOR( )

FOUND()

F P U T S ()
Print #
FREAD( )
Input #
FREE TABLE

FSEEK( )
Seek()
FSIZE( )

FTIME( )
FileDateTime()
FULLPATH( )

FUNCTION
Function
FV( )
FV()
FWRITE( )
Print #
GATHER

GETCOLOR( )
Show Color ActiveX Com m onDialog
GETCP( )

GETDIR()

G E T E N V ()
Environ()
GETEXPR

GETFILE( )
ShowOpen ActiveX Com m onDialog
GETFLDSTATE( )

GETFONT( )
ShowFont ActiveX CommonDialog
GETNEXTMODIFIED( )

GETOBJECT( )
GetObject()
GETPEM()

GETPICT( )

GETPRINTER( )
ShowPrint ActiveX Com m onDialog
GO | GOTO
Move RecordSet DAO
GOMONTH( )

HEADER( )

HELP
ShowHelp ActiveX Com m onDialog
HOME( )

HOUR( )
Hour()
IDXCOLLATE( )

co n ve rte d to PDF by H u p B a H 9 I

IF ... ENDIF
If Then... Endif
IIF( )
IIf()
IMESTATUS()

IMPORT

INDBC()

INDEX

INKEY( )

INLIST( )

INSERT - SQL
Execute Recordset DAO
INSMODE( )

INT( )
Int()
ISALPHA( )

ISBLANK( )

ISDIGIT( )
IsNum eric()
ISEXCLUSIVE( )

ISFLOCKED( )

ISLEADBYTE( )

ISLOW ER( )
g = LCase(g)
ISNULL( )
IsNull()
ISREADONLY( )

ISRLOCKED( )

ISUPPER( )
g = LCase(g)
KEY( )

KEYBOARD

KEYMATCH( )

LASTKEY( )

LEFT( )
Left()
LEFTC()

LEN( )
Len()
LENC()

LIKE( )
Like
LIKEC()

LINENO( )

co n ve rte d to PDF by H u p B a H 9 I

LOADPICTURE( )
LoadPicture()
LOCAL
Private
LOCATE

LOCFILE( )

LOCK( )

LOG( )
Log()
LOG10( )

LOOKUP( )

LOWER( )
LCase()
LPARAMETERS

LTRIM( )
LTrim()
LUPDATE( )

MAX( )

MCOL( )

MD | MKDIR
MdDir
MDOWN( )

MDX( )

MDY( )

MEMLINES( )

M ESSAGE( )
Error()
M E S S A G E B O X ()
MsgBox()
MIN( )

MINUTE( )
Minute()
MLINE( )

MOD( )
Mod
MODIFY CLASS

MODIFY COMMAND

MODIFY CONNECTION

MODIFY DATABASE

MODIFY FILE

MODIFY GENERAL

MODIFY MEMO

MODIFY QUERY

co n ve rte d to PDF by H u p B a H 9 I

MODIFY STRUCTURE

MODIFY VIEW

MONTH( )
Month()
MOUSE

MROW( )

MTON( )
Val()
NDX( )

NODEFAULT

NORMALIZE( )

NOTE
Rem
NTOM( )
CCur()
NUMLOCK( )

NVL( )

OBJTOCLIENT( )

O CCURS( )

OLDVAL( )

ON ERROR
On Error
ON KEY LABEL

ON( )

OPEN DATABASE

ORDER( )

OS( )

PACK

PACK DATABASE

PADC( )

PADL( )

PADR( )

PARAMETERS

PARAMETERS( )

PAYMENT( )
Pmt()
PCOL( )

PEMSTATUS()

PI( )

co n ve rte d to PDF by H u p B a H 9 I

POP KEY

PRIMARY( )

PR IN TS T A T U S()

PRIVATE

PROCEDURE
Sub
P R O G R A M ()

PROPER( )

PROW( )

PRTINFO( )

PUBLIC
Public
PUSH KEY

PUTFILE( )
Show Save ActiveX CommonDialog
PV( )
PV()
RAND( )
Rnd()
RAT( )

RATC()

RATLINE( )

RD | RMDIR
RmDir
RECALL

REFRESH( )

REINDEX

RELATION( )

RELEASE

RELEASE CLASSLIB

REMOVE CLASS

REMOVE TABLE
Delete TableDefs
RENAME
Name
RENAME CLASS

RENAME CONNECTION

RENAME TABLE

RENAME VIEW

REPLACE

REPLACE FROM ARRAY

co n ve rte d to PDF by H u p B a H 9 I

REPLICATE( )
String()
REQUERY()

RESTORE FROM

RESUME
Resume
RETRY

RETURN
Return.
RGB()

RIGHT()
Right()
RIGHTC()

RLOCK()

ROLLBACK
Rollback
ROUND()

RTOD( )

RTRIM( )
RTrim()
RUN | !
Shell()
SAVE TO

SAVEPICTURE( )
SavePicture()
SCAN ... ENDSCAN

SCATTER

SEC( )
Second()
SECO NDS( )
Tim er()
SEEK
Seek RecordSet DAO
SEEK( )

SELECT

SELECT - SQL
Execute RecordSet DAO
SET ANSI

SET AUTOSAVE

SET BLOCKSIZE

SET CENTURY

SET CLASSLIB

SET COLLATE

SET CPDIALOG

SET CURRENCY

co n ve rte d to PDF by H u p B a H 9 I

SET DATABASE

SET DATASESSION

SET DATE

SET DELETED

SET EXACT

SET FDOW

SET FIELDS

SET FILTER

SET

SET FWEEK

SET HELP

SET INDEX

SET KEY

SET LOGERRORS

SET MEMOWIDTH

SET NEAR

SET NOCPTRANS

SET NULL

SET OLEOBJECT

SET OPTIMIZE

SET ORDER

SET PATH

SET RELATION
CreateField Relation DAO
SET RELATION OFF
Delete Relation
SET SKIP

SET SYSFORMATS

SET TRBETWEEN

SET TYPEAHEAD

SET UNIQUE

SET( )

SETFLDSTATE( )

SIGN( )
Sgn()
SIN( )
Sin()

co n ve rte d to PDF by H u p B a H 9 I

SKIP
MovePrevious MoveNext Recordset DAO
SORT

SOUNDEX( )

SPACE( )
Space()
SQ LCANCEL( )

SQLCOLUM NS( )

SQLCOMMIT( )

SQLCONNECT( )

SQLDISCONNECT( )

SQLEXEC( )

SQLGETPROP( )

SQLMORERESULTS( )

SQLPREPARE( )

SQLROLLBACK( )

SQLSETPROP( )

SQLSTRINGCONNECT( )

SQLTABLES( )

SQRT( )
Sqr()
STORE

STR( )
S tr() Format()
STRCONV()

STRTRAN( )

STUFF( )
Mid
STUFFC()

SUBSTR( )
Mid()
SUBSTRC()

SUM

SUSPEND

SYS(1)

SYS(10)

SYS(1037)

SYS(11)

SYS(1269)

co n ve rte d to PDF by H u p B a H 9 I

SYS(1270)

SYS(1271)

SYS(1272)

SYS(13)

SYS(14)

SYS(16)

SYS(17)

SYS(2000)

SYS(2001)

SYS(2002)

SYS(2007)

SYS(2014)

SYS(2015)

SYS(2018)

SYS(2020)

SYS(2021)

SYS(2022)

SYS(2029)

SYS(21)

SYS(3)

SYS(3051)

SYS(3052)

SYS(3053)

SYS(5)
CurDir() LEFT(CURDIR(),2)
SYS(6)

SYS(9)

SetClipD at( )

StrFilter( )

T A B LE R E V E R T ()

TABLEUPDATE( )

TAG( )

TAN( )
Tan()
TARGET( )

co n ve rte d to PDF by H u p B a H 9 I

TIME( )
Time().
TOTAL

T R A N S F O R M ()
Format()
TRIM( )
RTrim()
TTOC( )

TTOD( )

TXNLEVEL( )

T X T W ID T H ()

TYPE

TYPE( )
TypeNam e()
UNLOCK

UPDATE - SQL

UPPER( )
UCase()
USE

USED( )

VAL( )
Val()
VALIDATE DATABASE

VERSION( )

WAIT

W EEK( )

W EXIST( )

WITH ... ENDWITH
With... End With
WLAST( )

WLCOL( )

WLROW( )

WMAXIMUM( )

WMINIMUM( )

WONTOP( )

WOUTPUT( )

W VISIBLE( )

YEAR( )
Year()
ZAP

_TRIGGERLEVEL