Professional Documents
Culture Documents
. , . , . .
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
;
;
;
;
;
.
,
.
.
,
.
.
, , ,
. ,
.
.
, .
.
,
, -
, .
,
, , .
, ,
.
,
.
.
, .
(, , ,
).
( ,
, ..) .
(,
).
.
, ,
, , , , ,
, , , ,
, , , .
, .
.
(, , - )
(, , ). ,
,
. - , , . .
,
.
, , ,
.
,
.
, ,
, , . ,
,
, .
. ,
, .
- .
.
, , ,
, , , . . ,
, , , , , , ,
. . -
, .
, . 1.1.
. 1 .1 .
- ,
. .
,
"" "" .
( !) ,
.
,
.
.
.
. , ,
, .
, - 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 .2 . MODEL
.
. ,
, , (,
), (, ,
.). ,
.
,
.
,
.
, ,
, ,
"" .
"", . ,
"" (. 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
CusL
JSS
4illik
+:5
. 1 .3 .
- (
).
,
.
- .
,
.
. "" ,
, (
).
:
(, , / ,
);
;
() ;
(cordiality);
(null) .
,
( ) . ,
, .
.
,
, . ,
,
.
. ,
, 1:n.
- (),
( , . .) .
,
. , , ,
.
,
.
() .
- .
, ,
. .
,
,
.
- ,
,
.
,
, .
.
"".
, ,
, .
:
, .
, ,
. (,
- ),
(, ).
, ,
.
.
.
,
.
.
, ,
.
, ,
- .
-
.
, .
, .
:
;
;
;
;
(NULL) .
-
.
,
. ,
, ,
, .
- ,
, , , ,
.
1.2. ,
,
, 77 100 , , 99 100
,
, . ,
, ,
,
.
.
, ,
. ,
, ,
. ,
, ,
, , .
,
.
"" ( -,
: "",
"") .
.
, .
- ( ). ""
- .
""
.
- "" .
1.4.
; .
. ,
, . , ,
, , ,
.
,
, .
- 6 : , , , ,
.
. 1 .4 . -
: " ?", ,
.
:
;
();
;
;
;
.
: " ?" , .
:
;
;
;
;
;
;
;
.
: " ?"
. , ,
, ,
.
.
, ,
. ,
, ,
, .
, ,
.
: " ?" .
"" . 1.5.
. 1.5.
: " ?"
-
.
:
- ;
- ;
- 20 .
: " ?"
. - "" :
" - " ;
;
;
.
- .
- -,
. 1.6.
E R - (Entity-relationship diagram (ERD) - "-"). ER
.
, ,
.
. 1 .6 . - -
.
:
"AUTO STORE".
:
.
:
.
, .
() .
(): ,
, , .
.
( ).
.
- :
10 .
3 , , .
-
.
9%
, .
4 .
""
0,1% , .
2 ,
.
:
Windows 95 Windows
NT.
:
;
, 3;
;
, . .;
, ;
, /;
100 /, ;
;
;
, ;
, ;
, ;
90 /, /100 ;
120 /, /100 ;
, /100 ;
;
, ;
;
;
;
;
;
;
;
;
;
, ;
;
;
;
;
;
;
, .
;
;
;
;
.
2
2.1.
2.2.
1.
2.
3. ,
4.
5.
2.3.
2.4.
, , ,
, . , -
"" .
.
2.1.
. .
.
:
;
, ;
.
.
.
(. 2.1).
(), .
,
, ,
.
" ". .
, , , .
.
. ,
. ,
, , .
,
. ,
.
. ,
, .
, .
,
( ),
. ,
,
,
.
, , , - .
, ,
, .
,
, .
. ,
,
. -
. . 2.1. ,
.
.
, . ,
,
( ) .
.
""
. ,
.
, ,
. ,
.
.
.
.
(,
) .
,
.
.
" ", " " " ".
, ,
.
, . ,
,
( ). ,
, , , , , , .
, " ",
" ", " " . .
- .
" ", " " . .
- . " ", "
" " ".
- . "
", " ", "" "".
" " ( )
- . ,
.
" ",
, . 2.2,.
, , ,
. . 2.3 . ,
, -
.
1ITA
------ >
-------------------------
> 34
-------------------------
> 56
. 2 .3 . " "
" " ( )
, .
" "
"" "", . 2.2,6.
(
) (
). " "
. ,
.
,
.
, ,
. 2.4. , - ,
, .
, () . ,
, .
. 2 .4 . " "
,
, (. . 2.4).
, .
" " ( )
.
, ,
.
" ". ,
. 2.2,. . 2.5 ,
. ,
.
.
.
. ,
, ,
.
1 IT
<
>
1 [
. 2 .5 . " "
" "
:
( ).
, . 2.6.
-I
. 2 .6 .
.
. " ", " " "
".
" " ( )
, () ,
.
(, ),
" ". . 2 .7 ,
.
" " ( )
.
, . .
, . "
" ""
"" (. 2 .7 ,).
" " ( )
.
- .
60- . 70- .
.
,
, , , (. 2.8).
" ". ,
.
. ,
: ()
() .
. 2.8 .
, .
( ). .
( ) , . .
1
V.
/
'\
V
/" ' \
. 2 .8 .
.
(
" ", - " ").
, .
, .
. 2.9.
, . 2.10.
.
.
( ) - ,
.
.
.
. 2 .9 .
2.2.
- . ?
,
, .
,
.
.
:
;
;
.
- .
.
. , ,
.
:
.
.
,
.
.
.
.
.
.
, ,
.
. 2.11.
.
,
.
.
.
.
,
. ,
.
,
( ).
1.
, , :
1.
2.
3.
4.
5.
6.
7.
;
;
;
;
;
;
.
2.
, .
. 2.12.
. 2.2,
, " ".
, ,
. ,
. 2.12
" ".
. 2 .1 2 .
3. ,
, .
,
. , ,
, ,
. , ,
,
. , ,
. ,
.
, , . 2.1.
. 2.13.
. 2 .1 3 .
2 .1 .
100 /
90 /
120 /
4.
.
,
. ,
, ,
, .
, - , ,
,
. .
, ,
.
,
, . ,
.
, ,
(
, ), .
, .
.
,
, ,
.
,
, , ,
. ,
, ,
.
,
.
.
,
, ,
.
. A, B C C B, B A, , C
A, . 2.14,.
, . 2.14,6.
,
,
, .
. ,
, ,
, .
,
.
,
:
-
.
.
. ,
. " " .
, ,
. - - " ",
. ,
.
- ,
.
- . ,
, .
, -
, .
, , , , ,
(. 2.15).
,
( , .
.).
.
:
,
. ,
.
.
,
, .
,
. .
(, ),
. ,
, , . ,
? ( )
.
, , .
2.2.
2 .2 .
100
/
90
/
120
/
5.
,
. .
2.3.
2 .3 .
Model ( )
+
1
/
1
Key_model
2
Name_model
3
Key_firm
4
Swept_volume
,
3
c3
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
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
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
,
, .
.
,
.
, .
.
, ,
.
.
.
. ,
.
, . ,
: " !"
, .
, .
. .
. ,
. ,
.
.
, , : "
, ".
, ,
,
. ,
.
,
.
- ,
.
. ,
30 . .
: (),
, , . .
:
.
Date ..
. 31,
- 12.
, , .
( ),
- : ( ).
"" ,
- .
,
. ,
: , . .
- .
.
, ,
, .
.
2.3.
().
,
.
.
. , ,
, .
,
.
:
;
;
;
;
.
, ,
,
. ,
, ,
.
.
, , ,
,
, .
, ,
.
,
,
.
.
,
. .
: " !",
, , ,
.
,
, , .
" ",
.
.
, ,
, .
.
. ,
.
, -,
.
.
, ,
.
. , ,
- , - .
. ,
, ,
, , " ", ""
"" .
, ,
.
.
.
"". ?
.
, "".
, ,
: " ", " ",
" " " ". "
" , ,
(
), " " .
"".
.
,
,
,
.
, .
, - ,
.
, , .
"",
: ,
, .
. , " ".
-
, .
.
. ,
. , ,
, ,
. ,
.
.
.
- - ,
. ""
.
, .
,
.
. , ,
.
. .
,
,
.
.
,
. ,
.
.
,
.
, ,
. ,
.
,
.
, ,
, .
.
.
, .
, . ,
.
.
.
,
, .
,
,
,
.
.
,
.
.
, .
AUTO STORE.
,
Auto_Store.
, : , ,
, , , , ,
, NULL, ,
, .
Auto_Store MS SQL Server,
MS SQL Server
Auto_Store , , .
, ""
" ".
. , .
2.16. .
, .
"". ,
(. 2.17). , .
. 2 .1 6 .
_1
*1
I i d
LJ
[id
. 2 .1 7 .
. . " "
" "
"". . 2.18 .
"" .
.
. .
" " " "
"". . 2.19
. ""
.
. 2.18.
. 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).
51
I ;
:
:
. 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.
, , .
,
, .
.
, ,
,
.
, .
,
.
"" .
, .
.
.
.
() ,
.
- "" , "".
.
.
"" ,
, , .
,
.
.
.
, , - , .
, .
.
,
. ,
. ,
,
.
.
,
.
.
. ,
,
.
,
, .
, .
. ,
.
,
. ,
, , ,
.
.
.
, .
. ,
, ,
.
,
.
, .
,
. ,
.
. , ,
, , .
,
. ,
,
, ,
"".
.
,
.
:
;
,
;
;
;
,
(, , );
,
.
,
.
, " " .
, .
, "" ,
.
"" ,
.
, , , -, , .
, ,
.
, ,
.
,
.
, ,
(
) , .
, .
,
, ,
, . ,
,
. ,
, .
Auto_Store,
, : , ,
, , ,
. . 2.24 2.25 ,
.
_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
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
1 1^1
!
cG:p^0(1 _
Delete
^ IH lS a le s n ia n
. 2.25.
,
, . 2.26.
. 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.
, ,
.
.
, , ,
. ,
,
. .
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
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++, , ,
, .
,
? - , 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..
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 .
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.
'
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 - .
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 - .
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
. , , .
.
.
.
,
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 "
F. *"
: 5' 'ii
HcwB_p4."fci
i 'J
Tis"
I 3.V K'U iC' 2lT"
-L I
i 5. j
'|
. 3 .5 . Browse
,
, , ,
, .
Edit ,
. 3.6.
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
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 - ,
.
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
|,| [ .
itniwi
iCItajiS :W4S25"
Windows J .T d s C
'- .'ii
'
3 1 pjc
Upf
1|2.'52?-'
VAido^fOfWcikgiKHjes 5.1 l5bctftj&Kk.|
ii i
__
1 ^ j
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
_ l
20122
250-051100
20130
016-051AV611________________
20160
. 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 -
.
, ,
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
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.
y iv e
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.
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
FoxPro
. , Visual Class Designer.
Visual FoxPro
, .
- VCX. Visual Class Designer
.
, Propeties. Visual Class
Designer , Form Designer,
.
, F1.
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.
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 .
E l
Form Wizard
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 -
, , ,
.
, 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.
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
.
,
,
.
, .
,
,
,
. Access
, .
Access
.
. (-,
), . 3.13.
,
. ,
, .
/.
2,499
12,499
12,499
12,499
:
|c:\Sport
:
(
"
. 3 .1 3 .
, - .
,
.
. 3.6.
3 .6 . Access
,
. Access
,
. ,
,,
,
.
.
,
,
, ,
, .
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 ), , , -.
, , ,
.
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- .
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, . ,
,
. , ,
.
, , ,
,
, ,
.
. 3.23- 3.27.
.
.
/:
|: automobile passenger - |
:
key_auto
.--------- j
1^ 1
kei)_model
datejssue
_ ^ l
>
. 3 .2 3 .
(*
<
. 3.24.
>
__________________
>
<
. 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 .
, ,
,
. ,
.
, , ,
.
,
.
, .
. .
, ,
90% , . ,
28 ,
(. 3.28).
,
.
.
>
. 3 .2 8 .
, ,
, , ,
, Access Grid, Visual FoxPro.
.
, .
.
: , .
: , .
, - ,
, .
Access ,
, ,
,
.
, - ,
- . .
, ,
.
,
, ,
.
.
,
.
,
. 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 .
,
, .
, , ,
.
, ( ...)
.
, -
.
Access
. , ,
, . ,
. Access ,
.
. .
, .
Admin,
Security, Access Developer Toolkit.
.
^uu hiljV ih iM l U tnjt
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
, :
Ed it ,
, .
V ie w
.
:
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.
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,
,
.
,
( );
;
;
- ;
, ;
/
;
: ,
, .
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. , ,
: " ?"
,
(, , ),
.
, .
,
: " , ?"
.
, ,
. 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
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, ,
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-
++ + +
+
,
+
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
++
+
++
++
16 16
32- 32
+
+
+
++
++
++
++
++
++
++
++
++
++
+
+
+
+
+
++
++
++
++
++
++
++
++
++
++
+
+
++
++
Visual Basic .
.
.
.
.
.
Cristal Reports.
Windows.
OLE OLE-.
.
, .
.
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
.
2
3.
,
.
. 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.
" "
, , ,
. ,
, , ,
, - .
,
, ,
.
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 - .
FOR
, , .
,
. ,
, ,
, .
.
4 .1 .
,
()
,
,
,
,
-
, .
:
. ,
, : "".
, . 4.2.
, . 3.2.
, !
. 4.2
. .
"$" -
.
.
" ==" , "=".
"",
"". , cName = "",
Visual FoxPro , "",
"", "".
" ==",
"".
, .
, , ,
.
:
1.
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
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#
(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]]
- .
(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.
,
Visual FoxPro. .
, ,
, .
- . Options
Tools. Edit.
. 4.1.
-LifiCTM ,
cwm&d\& a
ngpe^i
lexnoitoi
)!
C o x p riH t H H u
mm
Rrn|i4 I.
'
rwfll
tnfcl1||-||
-'
t Jil
1 1iw^bu-iiJ'
P IJrau-aiNJ-LiiHjp
.I- ^UrdW-BFi'
I- ..uliiprivEjLhiu
tKl'UIIH.J L- . *
Aliqr4T.*n*
| Ll-^i
^
P
I-T|*T/rr||KfV>p.-.-LBH-J.
P'Prr
F
P
&
*
Tab
. 4 .1 .
, , FoxPro
, "p-",
. "p-"
.
.
, , - ,
. .
, Visual FoxPro
, , ,
Options ,
. ,
, Options , . 4.2. ,
, , .
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
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^
Seifl-oDefault
OK
Cinc.fl
Kelp f
. 4 .2 .
, Edit
Format. ,
. 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 .
,
.
, .
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
. ,
ON KEY LABEL .
, , Ctrl+F
:
FOR
NEXT
FoxPro - , ,
.
(), ,
.
PROCEDURE ProcedureName
, :
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)
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
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. ,
. 4 .6 , - Main,
Sub, - Public. OK
, .
Insert Procedure
OK
Name: |Main|
-T y p e -------------------------------------
(* Sub
Function
Cancel
Properly
-Scope-
(* Public
Private
. 4 .6 .
, Visual Basic
Visual FoxPro. Visual Basic
, , .
. .
, . 4 .7 ,
Options, Editor.
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
Background:
J
| A ula m nJtic
3
OK
AaBbCcXxYyZz
Cancel
Help
: * '
. 4 .7 .
,
Visual FoxPro. Proc
(declarations), . 4.8.
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 .
, , ,
, ,
. ,
, , .
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 - .
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 :
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.
:
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
W A IT ,
- ,
TO.
Visual Basic
:
Do [{W hile | Until} Expression] [Commands] [Exit Do] [Commands]
Loop
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. ,
Expression_n Expression. ,
, ELSE.
,
Visual
FoxPro, Visual Basic
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.
:
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 () ,
. 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 -
:
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
uReturnValue
, ,
.
. : "
?"
5
-
5.1.
5.2.
-
OLE
5.3.
5.4.
- , .
:
, ,
.
"-
" ().
, RAD,
, ,
, + + .
Visual FoxPro. ,
,
.
5.1.
, ,
,
.
, - Windows 95. ,
, ? , , , .
,
.
:
.
, .
Visual FoxPro.
Visual Basic.
- ,
. , , ,
, . , ,
, . .
, ,
(, ). ,
.
, ,
.
, ,
.
, . .
, ,
.
, ,
.
, , , ,
, .
. ,
, " " ,
.
, . 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 .
() ,
.
, - - ,
, .
C R E A T E O B JE C T ().
- , .
, , , ,
. .
- , .
, .
.
, ,
. ,
, .
, . ,
,
.
- , .
, . .
, O B JEC T.D R A W .
. ,
. , ,
. , ,
.
- ,
.
&
^
. 5 .1 .
, ,
.
, ,
.
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
Imarje
F o rm S ftt
Line
List B^ir
L b B o u n d C o n tro l
Shape
PageFrame
I?
P ag a
Spinner
Teyt Boy
Custom
Timer
H e . .
. 5 .2 .
5 .1 . Visual FoxPro
CheckBox
,
.
Column
Grid.
,
- .
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
.
,
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
,
.
,
.
:
, ,
. .
,
(, ).
.
,
,
.
-
.
,
.
.
-
ToolBar
,
-
.
.
,
.
,
.
,
.
.
, -
, -. -
, .
,
"". - , ,
,
.
,
( 5.2 ).
, ,
, .
, -
.
, . ,
. . 5.1,
,
, , .
,
, .
, .
.
.
,
. :
cClassName:: Method
-
- .
- ,
" ".
, . ,
,
. :
.
,
, -
.
.
,
, , ,
.
.
-
, .
.
, 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 .
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.
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]
,
, .
-
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 ,
.
, . 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 ,
*
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, .
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.
Label
Text Box
EditBox
Command Button Group
Co mm and Button
I*
ComboBox
Spinner
ListBox
Grid
-H
Image
PageFrame
Timer
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 . . ,
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 . ,
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 nColor
0, 0, 0
0
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.
, - ,
, , ,
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
.
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.
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.
, ,
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 - .
,
- .
,
, , ,
, . . - -
. - ,
, ,
.
, ,
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.
.
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
( );
;
;
;
;
.
-
,
, , 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
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 ,
.
.
, ,
.
.
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
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
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
.
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 (
).
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
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;
;
;
;
.
8.
Visual FoxPro ActiveX
, OLE Container Control,
Insert Object Insert Control.
, . 5.6.
In-sort O bject
Contrd JypBj
OK
Creale Ngw
Cancel
Add Coniroi..
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
gnowse..
Help
Show-------------------
1senable Objects
F ontrals
^elected items On^
I__________________________________________________________
. 5.7.
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,...]
. 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
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 , :
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
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, , , , ,
,
.
(
) :
0
1
2
3
.
.
.
.
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.
,
.
Visual FoxPro - -,
, C R E A T E O B JE C T (),
-,
Object. Refresh
. ,
,
, PageFrame,
Page.
Control.SetFocus
.
[Object.]ZOrder([nValue])
.
nValue 0, 2. nValue 0 ( ),
, 2 - .
( ,
. .), - . , ,
.
nLeft nTop .
nWidth nHeight. nLeft,
, ,
.
-,
-, 0, 0. ,
, ,
, :
ThisForm.Move(20, 5)
Object.Hide
Visible .F..
, , ,
.
Object. Show([nStyle])
, nStyle, .
nStyle 1 (0 Visual Basic), ,
, Show. nStyle
2 (1 Visual Basic), ,
.
. nStyle ,
WindowType.
OLE-
-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.
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.
,
, .
;
FoxPro ;
.
, , ,
Visual FoxPro C R EA TE D ATABASE.
, ,
Project Manager.
Project Manager Data, Databases.
New. , . 6.1.
.
Vfciim *
*
wic ;plH Vi qih | >
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
OPEN DATABASE
COPY
PROCEDURES
DELETE VIEW
PACK DATABASE
CREATE
CONNECTION
DISPLAY
DATABASE
REMOVE TABLE
CREATE
DATABASE
INDBC()
SET DATABASE
VALIDATE
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
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
D USE.
M O D IFY STRU CTU R E.
,
AUTO_STORE .DBC:
USE AUTO_STORE. DBC EXCLUSIVE
MODIFY STRUCTURE
"U_"
.
DBC.
DBC.
.
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 ,
.
,
.
.
:
,
.
,
("") .
,
.
. 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:
, .
, , , , ,
.
, 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.
. 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
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 .
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
, , .
,
, .
- ,
, .
,
,
.
.
, General.
, ,
Default Value, Field
Properties (. 6.3), DEFAULT C R EA TE TA B LE.
able D esicjner
Jable Name:
| customer
Database:________________________
"
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
-"
|
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 ;
"-"
,
, , .
-
,
.
. , ,
.
,
, . ., , .
.
.
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.
Database:________________________
| model
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'
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.
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
.
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, .
CDX-, ,
Visual FoxPro.
CDX-:
.
.
,
.
(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.
Database:________________________
| model
~
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-, -.
, , ,
, .
, ,
, ,
, .
"" ,
; ,
- .
, .
.
(Regular) - , ,
-.
,
.
" " .
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-,
, -
.
,
.
-.
,
.
,
. -
.
- ,
. ,
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
, . ,
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 .
Database:________________________
account
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 _
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', ; ' ')
6.2. Access
, Microsoft Access
, .
,
. - "", . ,
, , Access .
MS Access.
.
, : Excel,
, . ,
, Excel,
Microsoft Excel. ,
,
. ,
, , - . - ,
, , , , ,
, ODBC.
Access 90 % "",
, .
- " ". , ,
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.
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 , , ,
.
. ,
. . . -
. .
, ,
. ,
, ,
, .
, ,
.
- ----
/:
|;;;
(*
1
1
11
11|||!*!
. 6 .1 2 . Access
- - .
, , :
(812)259-4277, , .
:
(000)00-00000
, ,
-.
. - .
,
8125250495. .
, . Access ,
:
\(0\-000\)000\-00\-00
,
, -
.
.
.
" ".
- , Caption, ,
. - .
, 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
,
. ,
.
,
, ,
, .
, .
.
, . 6.14,
. .
. ,
, . ,
,
.
. 6 .1 4 . Access
,
. ,
, Microsoft Visual
Basic.
, , ,
, -, ,
, . , ,
,
.
, ,
, . Access
, , -
, . ,
, .
Excel
Access.
;
(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 , :
,
, , ,
. . 6.15.
. 6 .1 5 . Visual Basic
, "
". ,
. ,
. , ,
. , Indexes Index.
, DAO .
, - , -
, .
, . ,
:
Dim oWksp As Workspace
Workspace,
oWksp.
,
, ""
, "". , , ,
" Database" " Database".
. 6.15,
, . - ,
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.
,
.
,
.
,
,
. . 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
, .
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.
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
+ ++
+
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+
+
+
++
++
+
++
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.
, .
OIb
iiyidow tldp
. 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 .
, 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")
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")
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 - , ;
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)
'
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.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
:-.!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.
. 6 .1 8 . SQL Server
M,. ii.-.nll I5QI {w
F_itc
L riil
Q uery
W indo w
Help
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
0 &
C o n n e c ts 11
1 l^/H
. 6 .1 9 . SQL Server
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 . ,
, Device
. :
DISK INIT
NAME = cLogicalName,
PHYSNAME = cPhysicalName,
VDEVNO = nValuel,
S IZ E = nValue2
[, VSTART = Adress]
:
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
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
. , :
. 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
auto store
IP MB
. 6 .2 4.
S e rv e r M a n a g e r
Server:
RU BEN 2
Microsoft S Q L Servers
= fj Mygroup
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
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)
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-
S e r v e i M anager
ZR
5. |ftuaEN2~
(^
1=
Mygrcup
L-i
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. ,
, ( -
).
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.
Server Manager
ID
Seiran RUGEN2
^
0
= 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.
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
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_
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
Help
. 6 .3 1 .
by Utet
Object
E 3 cusitofner )
Group
Sei
User Name
Selecl
pitei_group
Elena
Grant All
_4
Revoke All
Ira
Kaina
Lena
Rub^n
_____
public
dbo
____
____
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.
,
-, , .
, ,
,
.
, 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.
, 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.
. Upsizing Wizard
11
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 ,
. ,
.
, ,
.
, 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,
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 ().
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)
* 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
7
7.1. ,
Visual FoxPro
Microsoft Access
7.2. SQL-
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.
*
*
*
*
,
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)
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 ; ,
, ,
. ,
, ,
- . 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.
:
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 " ". ,
, ,
- " ".
, ,
:
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 .
, " ", ,
, .
:
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 '*'"
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 .
. ,
. ,
, .
- . .
, , , . ,
. , , .
, , ,
. , ,
,
- . ,
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) - .
.
, 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
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
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
.
- (= ), -
:
;
;
- ;
- ;
<<>> - .
, -
, :
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 "*'"
, 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 ) -
.
,
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)
, , ,
.
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 :
, 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
.
. ,
.
D ELETE FROM Account W HERE Account.key_auto = 100008
, , .
7.3. SQL
SQ L
,
.
:
;
;
.
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 ... ]
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]
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 ,
. , ,
.
, .
.
Project Manager,
, Local Views
New. ,
. -
, .
New ,
Local View.
,
,
,
.
, , ,
, Add Table,
. 7.1.
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). , , ,
,
.
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
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 . .
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. ,
:
,
: .
, .
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
poo"
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
Show Lo^in:
Se : as Defa Jt
F
F
foo"
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",; "
")
,
"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
.
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",;
= 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 (), .
. .
:
1.
2.
3.
4.
.
.
.
, , ,
.
1.
2.
. , Access
, . ,
, ,
.
3 4 .
. ,
, ,
, . 7.6.
. ,
.
. .!
. !i_i!.:____
; ;-[jj
'
. 7 .6 .
, ,
. ,
.
: , .
, , ,
, , (. 7.7).
|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 .
. , ,
, . ,
, .
, - .
.
, , ,
. ,
, .
, ,
.
, ,
, .
, .
. ,
" " "", 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
. , ,
, HAVING.
1 : ()
kei> customer ^ 1
key_auto
date write
selled
summa
AJ
:
:
:
account
account
:
:
:
:
. 7 .1 0 .
,
,
.
, . 7.11. ,
, Access
.
Custpar
. 7 .1 1 .
. 7.12 ,
IKNOWWHATIWANTIWANTITNOW ,
. , ,
Forms! [IknowwhatIwantIwantitnow]. [account]
, ,
. SKOLKO
,
- , .
( )
acccuni
hieyjcuslomei
kej^aula
daiej.-viile ^
1
acrajnl
- account
-1
. 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.
[acco u n t
~3
(* iB ;
"
:
: |~
'
'
. 7 .1 3 .
, , ,
.
.
, ,
, . 7.14.
1? 2
233
__
Ltt-
1'
*
4 1
. 7 .1 4 .
-
,
. ,
, .
,
:
...INTO << >>
, ,
.
,
. .
- ,
, .
, "".
"". ,
, , ,
,
. ,
(. 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
. .
, 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 ,
.
(, 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
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.
,
.
, , ,
, , , ,
, , , , .
-
. - , ,
, , , , .
,
.
,
.
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 , ,
, .
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 .,
.
,
.
. -
. :
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 .
,
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
. 7 .1 7 .
:
DO FORM justmadeformforbufferingvalidate NAME f1
,
DO FORM justmadeformforbufferingvalidate NAME f2
W ork A re a Properties
Data Buffering Options----
OK
'Lock Records
(*
When Edited
When Written
"Buffer
Cancel
Current Record
Modify...
Data Filter
Index Order
<no order>
rAllow Access to
(*
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 .
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 () :
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 ( )
. :
G E T N E X T M O D IF IE D ()
:
.
- ,
, 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 .
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.
, ,
, .
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
. .
, . 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 .
, ,
.
. ,
. ,
,
.
,
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 . , ,
.
.
: .
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 .
,
.
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.
ODBC
,
.
S Q L C o n n e c t (),
,
,
.
,
, .
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 ):
$$
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.
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.
,
.
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.
,
-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.
,
, .
-
,
(, ) , ,
.
:
[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)
, ,
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]
, ,
( ), .
, 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
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 ,
.
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.
, ,
, ,
.
,
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
, , , , , -
, , ,
, .
OK
Cancel
H I
Help
J
d
. 8 .2 . ODBC
Data Source,
. "Data Source"
Data Source ( ),
UserID PassWord. , ,
, "Connection String".
Connection String, , -
, - ,
Visual FoxPro. - (. 8 .3 ):
D jia
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
(*
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
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')
.
, , 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 () :
, 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
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'
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')
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.
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.
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 ).
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 .
| 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.
, 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.
, .
, -
, , .
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 ,
.
Qd3.ReturnsRecords = False
Qd3.Execute
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
' 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)
. 8 .1 2 .
8 .6 . ODBC API
SQLAllocEnv
.
.
SQLAllocConnect
SQLConnect
SQL
,
,
.
SQLAllocStm t .
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, _
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, _
. 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.
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.
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.
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
,
,
.
Readonly - ,
.
Connect - , .
ODBC
.
, ,
, , ,
.
,
.
rdoConnection,
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
. 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 ,
,
.
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,
:
rdOpen rdoResultset,
ForwardOnly
(
).
,
.
rdOpenStatic
. ,
,
,
.
RdOpenKeyset
.
.
,
,
.
.
RdOpenDynamic
.
.
,
,
.
.
.
, rdOpenForwardOnly.
- , ,
.
,
. ,
.
LockType ,
.
Integer, :
rdConcurLock
,
,
Edit.
.
RdConcur-
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 . ,
, ,
. , ,
, .
,
, , SQL-DMO
. QueryResults,
.
. 8.15 SQL-DMO , . 8.8
.
:. 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
.
, ,
,
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 .
.
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
.
.
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")
.
, ,
.
, 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
'
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 - -.
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.
.
,
.
.
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" ]
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]
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 - ;
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
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.
* 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)
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 ) + ;
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.
, ,
,
.
.
,
.
, ( ).
.
, ,
, .
.
, 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.
.
.
"" .
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
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 - .
.
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
F o r m C o n t r o l s
. . 9.4
.
ue rjftw?imoR i;y ?
View ClaSSSS
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-:
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
Button Lcck
^ |1- ^
-
. 9 .4 .
,
Options Tools. Forms
(. 9.5).
.
- 6 10.
- Pixels. Maximum Design Area 640x480 - ,
,
VGA. ,
,
.
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.
Propcihes - ra lc_sq l sc h
J a l* J
bject:
I Forml
*3 ~
id
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
.
, ,
,
.
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), ,
(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.
mygo ,
, , ,
, , ,
, . . 9.8
mygo. . 9.1 mygo
ToolTipText .
>
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
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
,
.
))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')
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 .)
&& ,
&&
= 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.
,
, .
. ,
. 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
! 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
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
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-
{? I*
Ml a
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.
"
"
"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 .
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,
.
*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
'
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
.
, .
" , , ", "
". 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
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 .
. ,
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.
" ".
,
- . .
\ < < . ,
, ,
\ < < . . ,
, " "
. ,
, ,
.
.
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
OK
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 -
.
- , ,
, 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 - .
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.
m
:
< >
. 9 .2 0 .
, O K ,
. , . 9.21.
, .
,
.
- [ ]
QK
J9KCT :
BcToDHTb
- ! I
. 9 .2 1 .
, - "
", " " " ".
, ,
, .
" ",
, .
:
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.
,
.
, 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 .
, , , ,
,
.
:
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 .
- ,
( ) .
, , .
, ,
.
, .
, , .
, ( , ),
. .
,
. ""
, ,
,
.
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 - .
O u t - o f -P r o c e s s
Microsoft Schedule+ 7.0
Microsoft Graph 5.0
VBA_GRP.HLP
WRDBASIC.HLP
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:
, 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
- 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.
. 10.2.
OLE Automation
.
Application
! 1
Workbook
Chart
Sheet
Add-in
---------
. 10.3.
, , ,
OLE Automation Visual FoxPro ,
Visual FoxPro -
C REATEOBJECT(ClassNam e [, eParameter1, eParameter2, ...])
O L E - ,
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
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 ,
.
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.
| 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.
, 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
Series
SeriesLines
TickLabels
TrendLine
UpBars
Walls
27
, , .
10.4. Application ( , ),
Creator ( , - Apple Macintosh)
Parent ( ), .
1 0 .4 . MS Graph 5.0
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
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
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
Delete
D o w n B a rs B order, Interior, N am e
Delete
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
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
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
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
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
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 ,
,
,
.
' (
> 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
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.
RowSourceType = 5 - ;
RowSource = aType - ;
BoundColumn = 2 - Value .
Init cmbType
:
This.Value = 1
InteractiveChange cmbType
:
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.
.
.
*
,
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
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.
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
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
3
- J tjJ jjJ \ & \ ^
JbaTL I
____ >''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
'
tn
'I
"
n r1
~ r~
. "
" 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.
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
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
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()
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 ,
. ,
. ,
. 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, :
ml
Options
V ie w
jj
General
Edit
D ata
R em ote D ata
File Locations
Forms
P rojects
Controls
International
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.
ml
Insert Object
Control Iv p e :
Create N ew
C- Create
from File
(* Insert Control
C ancel
A d d Control..
Result-----------------Inserts a n e w 'O utline Control' control into your
docum ent.
Form: | Forml
Page: f
. 1 0 .1 5 . Outline
Properties Pictures, PictureClosed PictureOpen
. ,
Browse (. 10.16).
: Outline Control
G eneral
Property N ame:
Preview:
[P ictureC iosed
Browse...
Clear
Colors |
Property N ame:
[ForeColor
System Color:
I M _ lJ
a a
. 1 0 .1 7 .
. 10.18 , Outline Control
ForeColor, PictureClosed PictureOpen.
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
,
. . 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.
| 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
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 .
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. , Details,
,
, .
. , , . .
( R e p o r t D e s i g n e r )
- . . 11.2
.
Details
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
,
.
,
.
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" . ,
,
, 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:
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
. 11.6.
o ( )
, ^ T O p h ^ , ,
, , p oo.
, p , p,
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
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
,
Variance ,
oo o
, ,
,
.
, ,
. . 11.7.
I
|2,4343
3
^
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.
|| PmpfilflFS----------------------------------------------------------------------------
-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).
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.
,
, ,
.
,
. , , .
,
- -
, , .
.
.
Visual FoxPro .
,
.
:
1.
2.
3.
,
. , . , ,
,
,
.
.
.
. Project Manager
Documents, Reports New.
Report Wizard
- Report Wizard.
, . 11.11.
PROPMOD.FRX
. , . 11.12. ,
. : -
, , , .
.
, .
D atabases / Tables:
Free T ables
PFIOPMOD
A va ila b le 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 .
. 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. .
, , .
:
G eneral
BM P ICO
r '
Report Picture
ictuie From
( * i Fie:
OK
c:
- C Field: [
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.
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
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.
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 ()
, .T.. ,
.
, ?
PRINTJOB
11.2. Access
MS Access
, . ,
.
,
Access.
, ,
, ,
- .
. .
,
,
.
-
RecordSource ( ).
,
, .
,
Access , ,
. , .
, Properties
(),
.
,
.
. ,
, .
,
/, . 11.17.
/
/
j
j
(* ^!
'
:
[
:
[
. 1 1 .1 7 .
, ,
, ,
.
, ,
, .
.
Windows. ,
, , Windows
. ,
. , , Access -
. ,
.
, , ,
.
, .
. , ,
,
. , , ,
.
, ,
.
.
,
, , .
. .
/ .
Access, Visual FoxPro, : ,
( ), , ( , ,
) . ,
, .
.
,
, -
.
.
, " "
.
, 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 .
, ,
. ,
.
, ,
. ,
, .
. -
. -
. , ,
. .
,
. (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, , ,
.
------
^--: /
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 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:
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)
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 .
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 .
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.
, ,
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.
:
._______________________________________________________
ji-.SMf; ourcf?
Pm nnfurii-
| MnutuMtWf.'
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
. 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.
. 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 ,
.
,
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. ,
,
,
.
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 ])
,
. 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
F9
F8
S h ift+ 8
.
Access , :
.
Stop.
.
A c c e s s ,
. .
Access, .
, ,
:
, ;
.
.
, ,
.
,
, . ,
,
.
. , ,
, .
, Print (. 12.5).
, Print, ,
Print.
[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 .
, :
. ,
.
.
, , , ,
- , , ,
.
. ,
. ,
, .
, ,
, - ,
.
,
, . ,
, ,
, - .
, 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
, ,
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 - ,
.
.
DATA_ERRDISPLAY - .
Microsoft Access.
Visual Basic
Visual Basic Debug.
, .
12.7.
^
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.
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
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
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.
,
, . ,
, ,
.
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
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
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
,
"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
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
, .
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
Template
Help
tleils
. 1 2 .1 2 .
1
Visual FoxPro 5.0
Project Manager
-
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.
.
, ,
.
, , .
, .
.' 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
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...
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
.
486 50 MHz.
.
10 .
: 15
, 100 - 240 - .
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.
avlo.pfg
SELEC T A
-1
LISE PODVSOST
IN D E X ON k :O d _a vto p TO
SELEC T
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
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 .
, . .1.3, :
Comment Uncomment.
, , , ,
.
.
.
. . .1.5
. , ,
-
.
LJ
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
library
Di9|jlsY das
Dataulhvalue;
,J
d
,
. .1 .5 .
, .
.
. Table
.
.
, , ,
.
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]
C UR SO R CursorName [N O FILTER ]
NOFILTER ,
. , ,
, .
, (, .
.).
-
, Visual FoxPro
, , .
, - ODBC
(Connection Designer).
.
Visual FoxPro 5.0
- Offline Views - . ?
, ,
,
.
, , ,
,
.
, . ,
, ,
. Visual FoxPro
.
.
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
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 -
Name [ = cName]
cName -
.
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. -
,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 - .
, 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
Debi g
Taels
Window
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 . ,
,
.
:
;
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
& ()
:: ( )
? | ??
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 ( )
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( )
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