home *** CD-ROM | disk | FTP | other *** search
/ Total C++ 2 / TOTALCTWO.iso / vfp5.0 / vfp / samples / csapp / sample.app (.txt) < prev    next >
Encoding:
MS Visual FoxPro App  |  1996-08-21  |  139.1 KB  |  3,323 lines

  1. PLATFORM
  2. UNIQUEID
  3. TIMESTAMP
  4. CLASS
  5. CLASSLOC
  6. BASECLASS
  7. OBJNAME
  8. PARENT
  9. PROPERTIES
  10. PROTECTED
  11. METHODS
  12. OBJCODE
  13. RESERVED1
  14. RESERVED2
  15. RESERVED3
  16. RESERVED4
  17. RESERVED5
  18. RESERVED6
  19. RESERVED7
  20. RESERVED8
  21.  COMMENT Class               
  22.  WINDOWS _RB81BUPH0 551974007wy
  23.  WINDOWS _RB81C5F37 551063946
  24.  WINDOWS _RB81C5F5P 550286697!
  25.  WINDOWS _RB81C5F5Z 550286697
  26.  WINDOWS _RB81C5F6J 550286697M
  27.  WINDOWS _RB81C5F6T 550286697
  28.  WINDOWS _RB81C5F7D 5502866975
  29.  WINDOWS _RB81C5F7N 550286697
  30.  WINDOWS _RB81C5F87 550286697d
  31.  WINDOWS _RB81C5F8H 550286697 
  32.  WINDOWS _RB81C5F91 551063946m
  33.  WINDOWS _RB81C5F9B 550286697
  34.  WINDOWS _RB81C5F9V 551063946
  35.  WINDOWS _RB81C5FA5 550286697V
  36.  WINDOWS _RB81C5FAP 551063946
  37.  WINDOWS _RB81C5FAZ 550286697a
  38.  WINDOWS _RB81C5FBJ 551063946#
  39.  WINDOWS _RB81C5FBT 550286697
  40.  WINDOWS _RB81C5FCD 551063946
  41.  WINDOWS _RB81C5FCN 550286697-
  42.  WINDOWS _RB81C5FD7 551063946X
  43.  WINDOWS _RB81C5FDR 550286697J
  44.  WINDOWS _RB81C5FE1 551063946
  45.  WINDOWS _RB81C5FEL 550286697-
  46.  WINDOWS _RB81C5FEV 551063946
  47.  WINDOWS _RB81C5FFF 550286697E
  48.  WINDOWS _RB81C5FFP 551063946
  49.  WINDOWS _RB81C5FG9 550286697
  50.  WINDOWS _RB81C5FGT 551063946
  51.  WINDOWS _RB81C5FH3 550286697`
  52.  WINDOWS _RB81C5FHN 551063946y
  53.  WINDOWS _RB81C5FHX 550286697
  54.  WINDOWS _RB81C5FIH 551063946
  55.  WINDOWS _RB81C5FIS 550286698A8
  56.  WINDOWS _RBK130QPS 551063946
  57.  WINDOWS _RBK130QQC 551063946B
  58.  WINDOWS _RB81C5FJC 5517769204
  59.  WINDOWS _RAI0SUHQO 551972400
  60.  WINDOWS _RB81C5FK6 551972400
  61.  WINDOWS _RB81C5FKQ 551002529
  62.  WINDOWS _RB81CEEZU 551974008
  63.  WINDOWS _RB81CEF0E 551974008
  64.  WINDOWS _RB81CEF0Y 551974008?
  65.  WINDOWS _RBC10RB93 551002529
  66.  WINDOWS _RBJ17BYTI 551387630
  67.  WINDOWS _RBJ17BYU2 551974008
  68.  COMMENT RESERVED            
  69.  WINDOWS _RAI0SUHQO 552634099
  70.  WINDOWS _RBK0SQ08Y 552634100
  71.  WINDOWS _RBK0ROA9G 552634100
  72.  WINDOWS _RBK0QKG3D 552634100
  73.  WINDOWS _RAY0WNWR1 552634100
  74.  WINDOWS _RAY0WNWRL 551715514q6
  75.  WINDOWS _RAY0WNWS5 551714305
  76.  WINDOWS _RAY0WNWSP 551714305
  77.  WINDOWS _RAY0WNWTJ 551714306|(
  78.  WINDOWS _RAI0SUHQO 551776892
  79.  WINDOWS _RAY0WNWUN 551714306
  80.  WINDOWS _RAY0WNWV7 551714306y#
  81.  WINDOWS _RAI0SUHQO 551776907
  82.  WINDOWS _RB316PM00 551776892
  83.  WINDOWS _RBK0QKGHA 552634100
  84.  WINDOWS _RBK0ROAR9 5526341009
  85.  WINDOWS _RBK0ROAS3 551714306*
  86.  WINDOWS _RBK0SQ0RB 552634100
  87.  WINDOWS _RBK0SQ0RV 551714306
  88.  COMMENT RESERVED            
  89.  WINDOWS _RAI0SUHQO 553740089e
  90.  WINDOWS _RAI0T68M8 553740089D
  91.  WINDOWS _RAL0323JK 553740089
  92.  WINDOWS _RB315XII0 553740089
  93.  WINDOWS _RB315XIJO 5537400909
  94.  WINDOWS _RAI0SUHQO 553740090q
  95.  WINDOWS _RB315XIN6 5537400905
  96.  WINDOWS _RAI0SUHQO 553740090j
  97.  WINDOWS _RAI1A7FXK 553740090
  98.  WINDOWS _RAI1A7FY4 553740090
  99.  WINDOWS _RAI1A7FYY 551972381>
  100.  WINDOWS _RAI1A7FZS 551387568
  101.  WINDOWS _RAI1A7FRQ 553740090
  102.  WINDOWS _RAI1A7FSA 551387568c
  103.  WINDOWS _RAI0SUHQO 551387568
  104.  WINDOWS _RAI1A7FU8 553740090
  105.  WINDOWS _RAI0SUHQO 551776974n
  106.  WINDOWS _RAL0323MC 551386684f{
  107.  WINDOWS _RAY0XTBHD 551387568
  108.  WINDOWS _RAZ0R6DWO 553740090
  109.  WINDOWS _RB315XJOP 551386684
  110.  WINDOWS _RB315XJVD 551776974cs
  111.  WINDOWS _RAI0T68M8 553740090
  112.  WINDOWS _RB803T5XB 553740090
  113.  WINDOWS _RAI0SUHQO 553740090so
  114.  WINDOWS _RAI0SUHQO 553740090
  115.  WINDOWS _RAK11Y0VV 551973154
  116.  WINDOWS _RAT0PSBBJ 549216314;h
  117.  WINDOWS _RAT0PSBC3 551386919
  118.  WINDOWS _RAT0PSBD7 549216314
  119.  WINDOWS _RAT0PSBDR 551386777Zf
  120.  WINDOWS _RAT0PSBEL 549216314
  121.  WINDOWS _RAT0PSBF5 551386919*e
  122.  WINDOWS _RAT0PSBG0 549216314
  123.  WINDOWS _RAT0PSBGK 5513867773c
  124.  WINDOWS _RAT0PSBHO 551063381
  125.  WINDOWS _RAT0PSBI8 551386778
  126.  WINDOWS _RAT0PSBJC 551063381ea
  127.  WINDOWS _RAT0PSBJW 551386919
  128.  WINDOWS _RAT0PSBKQ 5510633815`
  129.  WINDOWS _RAT0PSBLA 551386919"_
  130.  WINDOWS _RAT0PSBME 551063381
  131.  WINDOWS _RAT0PSBMY 551386919
  132.  WINDOWS _RAT0PSBNS 551063381
  133.  WINDOWS _RAT0PSBOM 551386920x\
  134.  WINDOWS _RAT0PSBPG 551063381
  135.  WINDOWS _RAT0PSBQA 551386920
  136.  WINDOWS _RAT0PSBR4 551063381KZ
  137.  WINDOWS _RAT0PSBRY 551386920
  138.  WINDOWS _RAT0PSBSS 551063381
  139.  WINDOWS _RAT0PSBTC 551386920
  140.  WINDOWS _RAT0PSBV0 551063381
  141.  WINDOWS _RAT0PSBVU 551386920[W
  142.  WINDOWS _RAT0PSBWY 551063381
  143.  WINDOWS _RAT0PSBXI 551386920*V
  144.  WINDOWS _RAT0PSBYC 551063381
  145.  WINDOWS _RAT0PSBYX 551386920
  146.  WINDOWS _RAT0PSC01 551063381bT
  147.  WINDOWS _RAT0PSC0L 551386920
  148.  WINDOWS _RBK12J71V 551063381
  149.  WINDOWS _RBK12J72F 551386920s.
  150.  WINDOWS _RAK11Y0WP 551387570
  151.  WINDOWS _RAK11Y0X9 551387570
  152.  WINDOWS _RAK11Y0Y3 551975940
  153.  WINDOWS _RAI0SUHQO 551387570
  154.  WINDOWS _RAK11Y0ZH 551386688
  155.  WINDOWS _RAK11Y115 551974275}
  156.  WINDOWS _RAK11Y11Z 551972384 
  157.  WINDOWS _RAK11Y12J 551386688T
  158.  WINDOWS _RAK11Y14R 553740092^
  159.  WINDOWS _RAK11Y15B 553740092
  160.  WINDOWS _RAK11Y165 553740092Y
  161.  WINDOWS _RB316DIXN 551776976
  162.  WINDOWS _RB803T75J 553740092
  163.  WINDOWS _RB803T76D 553740092
  164.  WINDOWS _RB803T76X 553740092A
  165.  WINDOWS _RB8106TK4 551386688
  166.  WINDOWS _RBJ1ATX66 553740093l
  167.  COMMENT RESERVED            
  168. VERSION =   3.00
  169. csdefs.h
  170. !Arial, 0, 9, 5, 15, 12, 13, 3, 0
  171. opendbc
  172. csdefs.h
  173. Pixels
  174. Class
  175. opendbc
  176. BorderStyle = 0
  177. Enabled = .F.
  178. Height = 47
  179. Left = 24
  180. ScrollBars = 0
  181. SpecialEffect = 1
  182. TabIndex = 15
  183. Top = 240
  184. Width = 420
  185. DisabledForeColor = 0,0,0
  186. Name = "edtDatabaseInfo2"
  187. opendbc
  188. edtDatabaseInfo2
  189. editbox
  190. editbox
  191. opendbc
  192. Label3
  193. csdefs.h
  194. !Arial, 0, 9, 5, 15, 12, 13, 3, 0
  195.     sampleapp
  196. csdefs.h
  197. Pixels
  198. Class
  199.     sampleapp
  200. kCaption = "label"
  201. Height = 17
  202. Left = 10
  203. Top = 58
  204. Width = 396
  205. TabIndex = 18
  206. Name = "lblCursorActive"
  207. label
  208. label
  209. label
  210. sampleapp.Pageframe1.Page2
  211. lblCursorActive
  212. label
  213. label
  214. BorderStyle = 0
  215. Enabled = .F.
  216. Height = 49
  217. Left = 9
  218. ScrollBars = 0
  219. SpecialEffect = 1
  220. TabIndex = 17
  221. Top = 14
  222. Width = 566
  223. DisabledForeColor = 0,0,0
  224. Name = "edtFunctionsInfo"
  225. sampleapp.Pageframe1.Page2
  226. edtFunctionsInfo
  227. editbox
  228. editbox
  229. mCaption = "Update Options:"
  230. Height = 17
  231. Left = 373
  232. Top = 269
  233. Width = 88
  234. TabIndex = 16
  235. Name = "Label3"
  236. sampleapp.Pageframe1.Page2
  237. Label3
  238. label
  239. label
  240. kCaption = "Update Scope:"
  241. Height = 18
  242. Left = 219
  243. Top = 269
  244. Width = 84
  245. TabIndex = 15
  246. Name = "Label2"
  247. sampleapp.Pageframe1.Page2
  248. Label2
  249. label
  250. label
  251. gCaption = "Buffering:"
  252. Height = 17
  253. Left = 28
  254. Top = 270
  255. Width = 54
  256. TabIndex = 14
  257. Name = "Label1"
  258. sampleapp.Pageframe1.Page2
  259. Label1
  260. label
  261. label
  262. Text1
  263. opendbc
  264. edtDatabaseInfo1
  265. Click,
  266. Click,
  267. /PROCEDURE Click
  268. HELP ID HELP_SAMPLE
  269. ENDPROC
  270. sampleapp.Pageframe1.Page2
  271. cmdHelp
  272. commandbutton
  273. commandbutton
  274. Text1
  275. editbox
  276. editbox
  277. label
  278. Click,
  279. iBorderStyle = 0
  280. Margin = 0
  281. ReadOnly = .T.
  282. ForeColor = 0,0,0
  283. BackColor = 255,255,255
  284. Name = "Text1"
  285. header
  286. header
  287. eTop = 312
  288. Left = 518
  289. Height = 27
  290. Width = 84
  291. Caption = "\<Help"
  292. TabIndex = 12
  293. Name = "cmdHelp"
  294. OENGINE
  295. SERVERISSTARTED
  296. SERVERSTART
  297. SERVERSTOP
  298. VALUE
  299. Click,
  300. chkRules
  301. _Caption = "3."
  302. Height = 15
  303. Left = 30
  304. Top = 223
  305. Width = 12
  306. TabIndex = 14
  307. Name = "Label3"
  308. BorderStyle = 0
  309. Enabled = .F.
  310. Height = 40
  311. Left = 24
  312. ScrollBars = 0
  313. SpecialEffect = 1
  314. TabIndex = 13
  315. Top = 134
  316. Width = 420
  317. DisabledForeColor = 0,0,0
  318. Name = "edtDatabaseInfo1"
  319. opendbc
  320. Label2
  321. opendbc
  322. Label1
  323. label
  324. label
  325. opendbc
  326. checkbox
  327. _Caption = "2."
  328. Height = 15
  329. Left = 30
  330. Top = 120
  331. Width = 12
  332. TabIndex = 12
  333. Name = "Label2"
  334. FontName = "MS Sans Serif"
  335. FontSize = 8
  336. Caption = "1."
  337. Height = 15
  338. Left = 30
  339. Top = 6
  340. Width = 12
  341. TabIndex = 11
  342. Name = "Label1"
  343. 0PROCEDURE Click
  344. HELP ID HELP_OPENDBC
  345. ENDPROC
  346. Command1
  347. opendbc
  348. PROCEDURE Click
  349. * start/stop the middle-tire server
  350. IF !oEngine.ServerIsStarted()
  351.     oEngine.ServerStart
  352.     oEngine.ServerStop
  353. ENDIF
  354. this.value = IIF(oEngine.ServerIsStarted(), 1, 0)
  355. ENDPROC
  356. sampleapp.Pageframe1.Page2
  357. Header1
  358. checkbox
  359. sampleapp.Pageframe1.Page2
  360. dTop = 330
  361. Left = 12
  362. Height = 24
  363. Width = 84
  364. Caption = "\<Help"
  365. TabIndex = 4
  366. Name = "Command1"
  367. Top = 358
  368. Left = 373
  369. Height = 17
  370. Width = 110
  371. Alignment = 0
  372. Caption = "\<Business Rules"
  373. TabIndex = 6
  374. Name = "chkRules"
  375. chkConflicts
  376. checkbox
  377. checkbox
  378. Text1
  379. LFORCE
  380. VALUE
  381. Click,
  382. Text1
  383. textbox
  384. Text1
  385. wTop = 327
  386. Left = 373
  387. Height = 17
  388. Width = 114
  389. Caption = "Re\<solve Conflicts"
  390. TabIndex = 5
  391. Name = "chkConflicts"
  392. /PROCEDURE Click
  393. lForce = this.value
  394. ENDPROC
  395. sampleapp.Pageframe1.Page2
  396. chkForce
  397. checkbox
  398. textbox
  399. commandbutton
  400. commandbutton
  401. fTop = 296
  402. Left = 373
  403. Height = 17
  404. Width = 60
  405. Caption = "\<Force"
  406. TabIndex = 4
  407. Name = "chkForce"
  408. checkbox
  409. sampleapp.Pageframe1.Page2
  410.     opgUpdate
  411. optiongroup
  412.     cmdCancel
  413. OENGINE
  414. ROWCONFLICT
  415. VALUE
  416. InteractiveChange,
  417. THISFORM
  418. REFRESHSTATUS
  419. Click,
  420. PROCEDURE InteractiveChange
  421. * test a single row conflict for Row and Table updates
  422. * test all table conflicts for Table All updates
  423. oEngine.RowConflict = (this.value <> 3)
  424. ENDPROC
  425. optiongroup
  426. iTop = 185
  427. Left = 518
  428. Height = 27
  429. Width = 84
  430. Caption = "\<Revert"
  431. TabIndex = 10
  432. Name = "cmdRevert"
  433. sampleapp.Pageframe1.Page2
  434.     cmdRevert
  435. commandbutton
  436. commandbutton
  437. sampleapp.Pageframe1.Page2
  438.     cmdUpdate
  439. commandbutton
  440. commandbutton
  441. commandbutton
  442. Requery succeded
  443. Requery failed
  444. NRESULT
  445. Click,
  446. commandbutton
  447. Text1
  448. iBorderStyle = 0
  449. Margin = 0
  450. ReadOnly = .T.
  451. ForeColor = 0,0,0
  452. BackColor = 255,255,255
  453. Name = "Text1"
  454. textbox
  455.  rows reverted
  456. LLREVERTTYPE
  457. LNROWS
  458. PARENT    
  459. OPGUPDATE
  460. VALUE
  461. OENGINE
  462. HADERROR
  463. SETERROROFF
  464. CMESSAGE
  465. ICON_EXCLAMATION
  466. CS_TITLE_TEXT
  467. Click,
  468.     opgBuffer
  469. ,PROCEDURE Click
  470. RELEASE THISFORM
  471. ENDPROC
  472. commandbutton
  473. opendbc
  474.     cmdBrowse
  475. commandbutton
  476. opendbc
  477. hTop = 155
  478. Left = 518
  479. Height = 27
  480. Width = 84
  481. Caption = "\<Update"
  482. TabIndex = 9
  483. Name = "cmdUpdate"
  484. sampleapp.Pageframe1.Page2
  485. optiongroup
  486. optiongroup
  487. gTop = 368
  488. Left = 517
  489. Height = 27
  490. Width = 84
  491. Caption = "\<Close"
  492. TabIndex = 13
  493. Name = "cmdClose"
  494. sampleapp.Pageframe1.Page2
  495. textbox
  496. Buffering
  497. employee
  498. employee
  499. OENGINE
  500. CURSORALIAS
  501. CURSORTYPE
  502. THISFORM
  503. LOCKSCREEN
  504. PAGEFRAME1
  505. ACTIVEPAGE
  506. Click,
  507. cmdClose
  508. commandbutton
  509. commandbutton
  510. tTop = 330
  511. Left = 371
  512. Height = 24
  513. Width = 84
  514. Cancel = .T.
  515. Caption = "Cancel"
  516. TabIndex = 3
  517. Name = "cmdCancel"
  518. commandbutton
  519. txtDatabaseFile
  520. textbox
  521. cmdRequery
  522. dTop = 82
  523. Left = 408
  524. Height = 25
  525. Width = 27
  526. Caption = ". . ."
  527. TabIndex = 5
  528. Name = "cmdBrowse"
  529. opendbc
  530. cmdOK
  531. sampleapp.Pageframe1.Page2
  532. CPROCEDURE Click
  533. RELEASE THISFORM
  534. oEngine.Start = .T.
  535. ENDPROC
  536. commandbutton
  537. commandbutton
  538. Shape2
  539. PROCEDURE Click
  540. LOCAL llRevertType, lnRows 
  541. llRevertType = (this.parent.opgUpdate.value <> 1)
  542. oEngine.HadError = .F.
  543. oEngine.SetErrorOff = .T.
  544. lnRows = TABLEREVERT(llRevertType)
  545. IF oEngine.HadError
  546.     =MESSAGEBOX(Oengine.cMessage, ICON_EXCLAMATION, CS_TITLE_TEXT)
  547.     lnRows = 0
  548. ENDIF
  549. oEngine.SetErrorOff = .F.
  550. * no conflicts
  551. wait window ALLTRIM(STR(lnRows)) + WAIT_REVERT2_LOC timeout CS_TIMEOUT
  552. ENDPROC
  553. kTop = 232
  554. Left = 518
  555. Height = 27
  556. Width = 84
  557. Caption = "Re\<query"
  558. TabIndex = 11
  559. Name = "cmdRequery"
  560. THISFORM
  561. Click,
  562. ^Top = 330
  563. Left = 275
  564. Height = 24
  565. Width = 84
  566. Caption = "OK"
  567. TabIndex = 2
  568. Name = "cmdOK"
  569. opendbc
  570. edtDatabaseInfo
  571. editbox
  572. editbox
  573. PARENT
  574. GRID1
  575. REFRESH
  576. Click,
  577. conflicts.grdConflicts.Column11
  578. commandbutton
  579. conflicts.grdConflicts.Column14
  580. conflicts.grdConflicts.Column15
  581. header
  582. commandbutton
  583. commandbutton
  584.     cmdDelete
  585. opendbc
  586. cmdOpenDatabase
  587. commandbutton
  588. commandbutton
  589. opendbc
  590. shape
  591. Buffering
  592. Buffering
  593. OENGINE
  594. HADERROR
  595. SETERROROFF
  596. LLRESULT
  597. VALUE
  598. CS_ERR_SET_BUFFERING
  599. ICON_EXCLAMATION
  600. CS_TITLE_TEXT
  601. PARENT    
  602. CMDUPDATE
  603. ENABLED    
  604. CMDREVERT    
  605. OPGUPDATE
  606. OPTION1
  607. OPTION2
  608. OPTION3
  609. CHKFORCE
  610. CHKCONFLICTS
  611. CHKRULES
  612. InteractiveChange,
  613. =PROCEDURE Click
  614. delete
  615. this.parent.grid1.refresh
  616. ENDPROC
  617. textbox
  618. cmdCloseDatabase
  619. commandbutton
  620. commandbutton
  621. opendbc
  622. cmdModifyConnection
  623. PARENT
  624. GRID1
  625. REFRESH
  626. Click,
  627. OENGINE
  628. SERVERISSTARTED
  629. SERVERSTOP
  630. THISFORM
  631. Click,
  632. textbox
  633. ControlSource = "OEngine.DatabaseFile"
  634. Enabled = .F.
  635. Height = 23
  636. Left = 25
  637. TabIndex = 6
  638. Top = 82
  639. Width = 347
  640. DisabledForeColor = 0,0,0
  641. Name = "txtDatabaseFile"
  642. fButtonCount = 3
  643. BackStyle = 0
  644. BorderStyle = 0
  645. Value = 1
  646. Height = 73
  647. Left = 213
  648. Top = 287
  649. Width = 120
  650. TabIndex = 3
  651. Name = "opgUpdate"
  652. Option1.Caption = "Row Update"
  653. Option1.Value = 1
  654. Option1.Height = 17
  655. Option1.Left = 5
  656. Option1.Top = 5
  657. Option1.Width = 103
  658. Option1.Name = "Option1"
  659. Option2.Caption = "Table Update"
  660. Option2.Value = 0
  661. Option2.Height = 17
  662. Option2.Left = 5
  663. Option2.Top = 24
  664. Option2.Width = 91
  665. Option2.Name = "Option2"
  666. Option3.Caption = "Table Update All"
  667. Option3.Value = 0
  668. Option3.Height = 17
  669. Option3.Left = 5
  670. Option3.Top = 43
  671. Option3.Width = 110
  672. Option3.Name = "Option3"
  673. NCOLINDEX$
  674. NERROR
  675. CMETHOD
  676. NLINE
  677. OENGINE
  678. ALERT
  679. AfterRowColChange,
  680. ErrorE
  681. conflicts.grdConflicts.Column10
  682. sampleapp.Pageframe1.Page2
  683. commandbutton
  684. header
  685. Header1
  686. |AutoSize = .F.
  687. Top = 187
  688. Left = 132
  689. Height = 24
  690. Width = 84
  691. Caption = "\<Open"
  692. TabIndex = 1
  693. Name = "cmdOpenDatabase"
  694. commandbutton
  695. commandbutton
  696. PROCEDURE Click
  697. LOCAL m.nResult
  698. m.nResult = -2            && to detect error events
  699. m.nResult = REQUERY()
  700. DO CASE
  701. CASE m.nResult == 1
  702.     wait window WAIT_REQUERYOK_LOC timeout CS_TIMEOUT
  703. CASE m.nResult == 0
  704.     wait window WAIT_REQUERYFAIL_LOC timeout CS_TIMEOUT
  705. ENDCASE
  706. ENDPROC
  707. commandbutton
  708. sampleapp.Pageframe1.Page2
  709.     cmdInsert
  710. commandbutton
  711. %Caption = "Photo"
  712. Name = "Header1"
  713. Header1
  714. textbox
  715. CPROCEDURE Click
  716. append blank
  717. this.parent.grid1.refresh
  718. ENDPROC
  719. Text1
  720. opendbc
  721. chkExclDatabase
  722. checkbox
  723. checkbox
  724. PROCEDURE Click
  725. * revert modified rows 
  726. IF USED(oEngine.CursorAlias)
  727.     SELECT (oEngine.CursorAlias)
  728.     IF CURSORGETPROP('Buffering') > 1
  729.         =TABLEREVERT(.T.)
  730.     ENDIF
  731. ENDIF
  732. IF oEngine.CursorType = LOCAL_VIEW_CURSOR
  733.     * Check if using offline
  734.     IF USED(CS_TABLE)
  735.         SELECT CS_TABLE
  736.         USE
  737.     ENDIF
  738. ENDIF
  739. * clean up
  740. oEngine.CursorAlias = ""
  741. oEngine.CursorType = NO_CURSOR
  742. thisform.lockscreen = .T.
  743. thisform.pageframe1.ActivePage = 1
  744. thisform.lockscreen = .F.
  745. ENDPROC
  746. THISFORM
  747. OFFLINE
  748. Click,
  749. header
  750. commandbutton
  751. )sampleapp.Pageframe1.Page2.Grid1.Column17
  752. header
  753. header
  754. BorderStyle = 0
  755. Enabled = .F.
  756. Height = 50
  757. Left = 24
  758. ScrollBars = 0
  759. SpecialEffect = 1
  760. TabIndex = 10
  761. Top = 20
  762. Width = 420
  763. DisabledForeColor = 0,0,0
  764. Name = "edtDatabaseInfo"
  765. Update succeded
  766. Conflicts
  767. Update failed
  768. LNUPDATETYPE
  769. LLFORCE
  770. LLUPDATE
  771. LNROW
  772. LCEMPLOYEE
  773. FRMCONFLICTS
  774. PARENT    
  775. OPGUPDATE
  776. VALUE
  777. CHKFORCE
  778. OENGINE
  779. SERVERISSTARTED
  780. SERVERVALIDATEROW
  781. HADERROR
  782. SETERROROFF
  783. CMESSAGE
  784. ICON_EXCLAMATION
  785. CS_TITLE_TEXT
  786. CHKCONFLICTS
  787. Click,
  788. hTop = 110
  789. Left = 517
  790. Height = 27
  791. Width = 84
  792. Caption = "\<Delete"
  793. TabIndex = 8
  794. Name = "cmdDelete"
  795. gTop = 80
  796. Left = 518
  797. Height = 27
  798. Width = 84
  799. Caption = "\<Insert"
  800. TabIndex = 7
  801. Name = "cmdInsert"
  802. *Caption = "Reports_to"
  803. Name = "Header1"
  804. textbox
  805. opendbc
  806. PROCEDURE Click
  807. LOCAL lnUpdateType, llForce, llUpdate, lnRow, lcEmployee, frmConflicts
  808. lnUpdateType = this.parent.opgUpdate.value - 1
  809. llForce = this.parent.chkForce.value
  810. * check business rules on the middle tire server
  811. * row update
  812. IF oEngine.ServerIsStarted() AND lnUpdateType = 0
  813.     IF !oEngine.ServerValidateRow()
  814.         RETURN
  815.     ENDIF
  816.     *table and table all updates
  817.     IF oEngine.ServerIsStarted() AND lnUpdateType <> 0
  818.         lnRow = 0
  819.         lnRow = GetNextModified(lnRow)
  820.         DO WHILE lnRow<>0
  821.             GO lnRow 
  822.             IF !oEngine.ServerValidateRow()
  823.                 RETURN
  824.             ENDIF
  825.             lnRow = GetNextModified(lnRow)
  826.         ENDDO
  827.     ENDIF            
  828. ENDIF
  829. oEngine.HadError = .F.
  830. oEngine.SetErrorOff = .T.
  831. llUpdate = TABLEUPDATE(lnUpdateType, llForce)
  832. IF oEngine.HadError
  833.     =MESSAGEBOX(Oengine.cMessage, ICON_EXCLAMATION, CS_TITLE_TEXT)
  834.     llUpdate = .F.
  835. ENDIF
  836. oEngine.SetErrorOff = .F.
  837. IF llUpdate
  838.     * no conflicts
  839.     wait window WAIT_UPDATEOK_LOC timeout CS_TIMEOUT
  840.     * update conflicts, handle conflicts resolution
  841.     IF this.parent.chkConflicts.value
  842.         frmConflicts = createobject('Conflicts')
  843.         frmConflicts.show
  844.     ELSE
  845.         wait window WAIT_UPDATEFAIL2_LOC timeout CS_TIMEOUT
  846.     ENDIF
  847. ENDIF
  848. ENDPROC
  849. OpenDBC
  850. oStartFormb
  851. OSTARTFORM
  852. THISFORM
  853. REFRESHSTATUS
  854. Click,
  855. create
  856. THISFORM
  857. OFFLINE
  858. Click,
  859. emp_init
  860. SAFETYv
  861. employee
  862. employee
  863. employee
  864. SET SAFETY &lcSave
  865. LCSAVE
  866. Click,
  867. Text1
  868. PROCEDURE InteractiveChange
  869. * the cursor should always be open in the current work area
  870. oEngine.HadError = .F.
  871. oEngine.SetErrorOff = .T.
  872. llResult = CURSORSETPROP('Buffering', this.value)
  873. IF oEngine.HadError OR !llResult THEN
  874.     this.value = CURSORGETPROP('Buffering')
  875.     oEngine.SetErrorOff = .T.
  876.     =MESSAGEBOX(CS_ERR_SET_BUFFERING, ICON_EXCLAMATION, CS_TITLE_TEXT)
  877. ENDIF
  878. * disable update scope,update options, update and revert for no buffering
  879. this.parent.cmdUpdate.enabled = !(this.value = 1)
  880. this.parent.cmdRevert.enabled = !(this.value = 1)
  881. this.parent.opgUpdate.enabled = !(this.value = 1)
  882. this.parent.opgUpdate.option1.enabled = !(this.value = 1)
  883. this.parent.opgUpdate.option2.enabled = !(this.value = 1)
  884. this.parent.opgUpdate.option3.enabled = !(this.value = 1)
  885. this.parent.chkForce.enabled = !(this.value = 1)
  886. this.parent.chkConflicts.enabled = !(this.value = 1)
  887. this.parent.chkRules.enabled = !(this.value = 1)
  888. oEngine.SetErrorOff = .F.
  889. ENDPROC
  890. ButtonCount = 5
  891. BorderStyle = 0
  892. Value = 1
  893. Height = 98
  894. Left = 22
  895. Top = 287
  896. Width = 156
  897. TabIndex = 2
  898. Name = "opgBuffer"
  899. Option1.Caption = "None"
  900. Option1.Value = 1
  901. Option1.Height = 17
  902. Option1.Left = 5
  903. Option1.Top = 5
  904. Option1.Width = 103
  905. Option1.Name = "Option1"
  906. Option2.Caption = "Pessimistic Row"
  907. Option2.Value = 0
  908. Option2.Height = 17
  909. Option2.Left = 5
  910. Option2.Top = 24
  911. Option2.Width = 139
  912. Option2.Name = "Option2"
  913. Option3.Caption = "Optimistic Row"
  914. Option3.Value = 0
  915. Option3.Height = 17
  916. Option3.Left = 5
  917. Option3.Top = 43
  918. Option3.Width = 139
  919. Option3.Name = "Option3"
  920. Option4.Caption = "Pessimistic Table"
  921. Option4.Value = 0
  922. Option4.Height = 17
  923. Option4.Left = 5
  924. Option4.Top = 62
  925. Option4.Width = 145
  926. Option4.Name = "Option4"
  927. Option5.Caption = "Optimistic Table"
  928. Option5.Value = 0
  929. Option5.Height = 17
  930. Option5.Left = 5
  931. Option5.Top = 81
  932. Option5.Width = 138
  933. Option5.Name = "Option5"
  934. THISFORM
  935. OENGINE
  936. START
  937. Click,
  938. RBorderStyle = 0
  939. Margin = 0
  940. OpenWindow = .T.
  941. ForeColor = 0,0,0
  942. Name = "Text1"
  943. )sampleapp.Pageframe1.Page2.Grid1.Column17
  944. RBorderStyle = 0
  945. Margin = 0
  946. OpenWindow = .T.
  947. ForeColor = 0,0,0
  948. Name = "Text1"
  949. )sampleapp.Pageframe1.Page2.Grid1.Column16
  950. textbox
  951. %Caption = "Notes"
  952. Name = "Header1"
  953. )sampleapp.Pageframe1.Page2.Grid1.Column16
  954. Header1
  955. header
  956. header
  957. RBorderStyle = 0
  958. Margin = 0
  959. OpenWindow = .T.
  960. ForeColor = 0,0,0
  961. Name = "Text1"
  962. )sampleapp.Pageframe1.Page2.Grid1.Column15
  963. textbox
  964. textbox
  965. %Caption = "Photo"
  966. Name = "Header1"
  967. )sampleapp.Pageframe1.Page2.Grid1.Column15
  968. Header1
  969. header
  970. header
  971. @BorderStyle = 0
  972. Margin = 0
  973. ForeColor = 0,0,0
  974. Name = "Text1"
  975. )sampleapp.Pageframe1.Page2.Grid1.Column14
  976. textbox
  977. textbox
  978. )Caption = "Extension"
  979. Name = "Header1"
  980. )sampleapp.Pageframe1.Page2.Grid1.Column14
  981. Header1
  982. header
  983. header
  984. @BorderStyle = 0
  985. Margin = 0
  986. ForeColor = 0,0,0
  987. Name = "Text1"
  988. )sampleapp.Pageframe1.Page2.Grid1.Column13
  989. Text1
  990. textbox
  991. textbox
  992. *Caption = "Home_phone"
  993. Name = "Header1"
  994. )sampleapp.Pageframe1.Page2.Grid1.Column13
  995. Header1
  996. header
  997. header
  998. @BorderStyle = 0
  999. Margin = 0
  1000. ForeColor = 0,0,0
  1001. Name = "Text1"
  1002. )sampleapp.Pageframe1.Page2.Grid1.Column12
  1003. Text1
  1004. textbox
  1005. textbox
  1006. 'Caption = "Country"
  1007. Name = "Header1"
  1008. )sampleapp.Pageframe1.Page2.Grid1.Column12
  1009. Header1
  1010. header
  1011. header
  1012. @BorderStyle = 0
  1013. Margin = 0
  1014. ForeColor = 0,0,0
  1015. Name = "Text1"
  1016. )sampleapp.Pageframe1.Page2.Grid1.Column11
  1017. Text1
  1018. textbox
  1019. textbox
  1020. *Caption = "Postalcode"
  1021. Name = "Header1"
  1022. )sampleapp.Pageframe1.Page2.Grid1.Column11
  1023. Header1
  1024. header
  1025. header
  1026. @BorderStyle = 0
  1027. Margin = 0
  1028. ForeColor = 0,0,0
  1029. Name = "Text1"
  1030. )sampleapp.Pageframe1.Page2.Grid1.Column10
  1031. Text1
  1032. textbox
  1033. textbox
  1034. &Caption = "Region"
  1035. Name = "Header1"
  1036. )sampleapp.Pageframe1.Page2.Grid1.Column10
  1037. Header1
  1038. header
  1039. conflicts.grdConflicts.Column15
  1040. conflicts.grdConflicts.Column16
  1041. textbox
  1042. header
  1043. @BorderStyle = 0
  1044. Margin = 0
  1045. ForeColor = 0,0,0
  1046. Name = "Text1"
  1047. (sampleapp.Pageframe1.Page2.Grid1.Column9
  1048. Text1
  1049. textbox
  1050. textbox
  1051. $Caption = "City"
  1052. Name = "Header1"
  1053. (sampleapp.Pageframe1.Page2.Grid1.Column9
  1054. Header1
  1055. header
  1056. header
  1057. @BorderStyle = 0
  1058. Margin = 0
  1059. ForeColor = 0,0,0
  1060. Name = "Text1"
  1061. (sampleapp.Pageframe1.Page2.Grid1.Column8
  1062. Text1
  1063. textbox
  1064. textbox
  1065. Header1
  1066. shape
  1067. opendbc
  1068. Shape3
  1069. shape
  1070. shape
  1071. opendbc
  1072. 'Caption = "Address"
  1073. Name = "Header1"
  1074. (sampleapp.Pageframe1.Page2.Grid1.Column8
  1075. header
  1076. header
  1077. @BorderStyle = 0
  1078. Margin = 0
  1079. ForeColor = 0,0,0
  1080. Name = "Text1"
  1081. (sampleapp.Pageframe1.Page2.Grid1.Column7
  1082. Text1
  1083. textbox
  1084. textbox
  1085. )Caption = "Hire_date"
  1086. Name = "Header1"
  1087. ~Top = 290
  1088. Left = 172
  1089. Height = 24
  1090. Width = 125
  1091. Caption = "\<Modify Connection"
  1092. TabIndex = 8
  1093. Name = "cmdModifyConnection"
  1094. (sampleapp.Pageframe1.Page2.Grid1.Column7
  1095. Header1
  1096. header
  1097. header
  1098. @BorderStyle = 0
  1099. Margin = 0
  1100. ForeColor = 0,0,0
  1101. Name = "Text1"
  1102. (sampleapp.Pageframe1.Page2.Grid1.Column6
  1103. Text1
  1104. textbox
  1105. textbox
  1106. *Caption = "Birth_date"
  1107. Name = "Header1"
  1108. (sampleapp.Pageframe1.Page2.Grid1.Column6
  1109. Header1
  1110. header
  1111. header
  1112. @BorderStyle = 0
  1113. Margin = 0
  1114. ForeColor = 0,0,0
  1115. Name = "Text1"
  1116. (sampleapp.Pageframe1.Page2.Grid1.Column5
  1117. Text1
  1118. textbox
  1119. textbox
  1120. &Caption = "Salary"
  1121. Name = "Header1"
  1122. (sampleapp.Pageframe1.Page2.Grid1.Column5
  1123. Header1
  1124. header
  1125. header
  1126. @BorderStyle = 0
  1127. Margin = 0
  1128. ForeColor = 0,0,0
  1129. Name = "Text1"
  1130. (sampleapp.Pageframe1.Page2.Grid1.Column4
  1131. Text1
  1132. textbox
  1133. textbox
  1134. %Caption = "Title"
  1135. Name = "Header1"
  1136. (sampleapp.Pageframe1.Page2.Grid1.Column4
  1137. Header1
  1138. header
  1139. header
  1140. @BorderStyle = 0
  1141. Margin = 0
  1142. ForeColor = 0,0,0
  1143. Name = "Text1"
  1144. Text1
  1145. Height = 360
  1146. Width = 470
  1147. DoCreate = .T.
  1148. AutoCenter = .T.
  1149. BorderStyle = 2
  1150. Caption = "Open Database"
  1151. MaxButton = .F.
  1152. WindowType = 1
  1153. Name = "opendbc"
  1154. header
  1155. header
  1156. (sampleapp.Pageframe1.Page2.Grid1.Column3
  1157. textbox
  1158. textbox
  1159. *Caption = "First_name"
  1160. Name = "Header1"
  1161. (sampleapp.Pageframe1.Page2.Grid1.Column3
  1162. Header1
  1163. header
  1164. header
  1165. @BorderStyle = 0
  1166. Margin = 0
  1167. ForeColor = 0,0,0
  1168. Name = "Text1"
  1169. (sampleapp.Pageframe1.Page2.Grid1.Column2
  1170. Text1
  1171. textbox
  1172. textbox
  1173. )Caption = "Last_name"
  1174. Name = "Header1"
  1175. (sampleapp.Pageframe1.Page2.Grid1.Column2
  1176. Header1
  1177. header
  1178. header
  1179. hBackStyle = 0
  1180. BorderStyle = 0
  1181. Margin = 0
  1182. ForeColor = 0,0,0
  1183. BackColor = 255,255,255
  1184. Name = "Text1"
  1185. (sampleapp.Pageframe1.Page2.Grid1.Column1
  1186. Text1
  1187. textbox
  1188. textbox
  1189. &Caption = "Emp_id"
  1190. Name = "Header1"
  1191. (sampleapp.Pageframe1.Page2.Grid1.Column1
  1192. Header1
  1193. header
  1194. header
  1195. cs.dbc
  1196. OENGINE
  1197. DATABASEISOPENED
  1198. DATABASENAME
  1199. THISFORM
  1200. REFRESHSTATUS
  1201. Click,
  1202. PROCEDURE AfterRowColChange
  1203. LPARAMETERS nColIndex
  1204. ENDPROC
  1205. PROCEDURE Error
  1206. LPARAMETERS nError, cMethod, nLine
  1207. oEngine.Alert(message(), MB_ICONEXCLAMATION + MB_OK)
  1208. ENDPROC
  1209. ColumnCount = 17
  1210. Height = 179
  1211. Left = 10
  1212. RecordSource = ""
  1213. RecordSourceType = 1
  1214. TabIndex = 1
  1215. Top = 80
  1216. Width = 492
  1217. Name = "Grid1"
  1218. Column1.Width = 50
  1219. Column1.Name = "Column1"
  1220. Column2.Width = 80
  1221. Column2.Name = "Column2"
  1222. Column3.Width = 80
  1223. Column3.Name = "Column3"
  1224. Column4.Width = 120
  1225. Column4.Name = "Column4"
  1226. Column5.Width = 80
  1227. Column5.Name = "Column5"
  1228. Column6.Width = 80
  1229. Column6.Name = "Column6"
  1230. Column7.Width = 80
  1231. Column7.Name = "Column7"
  1232. Column8.Width = 180
  1233. Column8.Name = "Column8"
  1234. Column9.Width = 80
  1235. Column9.Name = "Column9"
  1236. Column10.Width = 80
  1237. Column10.Name = "Column10"
  1238. Column11.Width = 80
  1239. Column11.Name = "Column11"
  1240. Column12.Width = 75
  1241. Column12.Name = "Column12"
  1242. Column13.Width = 90
  1243. Column13.Name = "Column13"
  1244. Column14.Width = 55
  1245. Column14.Name = "Column14"
  1246. Column15.Width = 40
  1247. Column15.Name = "Column15"
  1248. Column16.Width = 40
  1249. Column16.Name = "Column16"
  1250. Column17.Width = 70
  1251. Column17.Name = "Column17"
  1252. sampleapp.Pageframe1.Page2
  1253. Grid1
  1254. UTop = 276
  1255. Left = 10
  1256. Height = 120
  1257. Width = 177
  1258. SpecialEffect = 0
  1259. Name = "Shape1"
  1260. sampleapp.Pageframe1.Page2
  1261. Shape1
  1262. shape
  1263. shape
  1264. VTop = 276
  1265. Left = 200
  1266. Height = 120
  1267. Width = 144
  1268. SpecialEffect = 0
  1269. Name = "Shape2"
  1270. sampleapp.Pageframe1.Page2
  1271. Shape2
  1272. shape
  1273. shape
  1274. VTop = 276
  1275. Left = 357
  1276. Height = 120
  1277. Width = 145
  1278. SpecialEffect = 0
  1279. Name = "Shape3"
  1280. sampleapp.Pageframe1.Page2
  1281. Shape3
  1282. shape
  1283. shape
  1284. |AutoSize = .T.
  1285. Caption = "Offline Views:"
  1286. Height = 17
  1287. Left = 247
  1288. Top = 280
  1289. Width = 76
  1290. TabIndex = 17
  1291. Name = "Label1"
  1292. sampleapp.Pageframe1.Page1
  1293. Label1
  1294. label
  1295. label
  1296. sampleapp.Pageframe1.Page1
  1297. cmdHelp
  1298. eTop = 230
  1299. Left = 12
  1300. Height = 92
  1301. Width = 445
  1302. BorderStyle = 1
  1303. SpecialEffect = 0
  1304. Name = "Shape1"
  1305. %Caption = "Notes"
  1306. Name = "Header1"
  1307. conflicts.grdConflicts.Column16
  1308. Click,
  1309. /PROCEDURE Click
  1310. HELP ID HELP_SAMPLE
  1311. ENDPROC
  1312. eTop = 381
  1313. Left = 22
  1314. Height = 24
  1315. Width = 126
  1316. Caption = "\<Help"
  1317. TabIndex = 11
  1318. Name = "cmdHelp"
  1319. commandbutton
  1320. commandbutton
  1321. THISFORM
  1322. Click,
  1323. Text1
  1324. 2PROCEDURE Click
  1325. thisform.RefreshStatus
  1326. ENDPROC
  1327. =AutoSize = .F.
  1328. ButtonCount = 3
  1329. Value = 1
  1330. DragMode = 0
  1331. Enabled = .T.
  1332. Height = 134
  1333. Left = 82
  1334. SpecialEffect = 0
  1335. Top = 86
  1336. Width = 459
  1337. TabIndex = 1
  1338. Visible = .T.
  1339. Name = "opgCursorType"
  1340. Option1.Picture = table.bmp
  1341. Option1.Caption = "Table"
  1342. Option1.Value = 1
  1343. Option1.Height = 130
  1344. Option1.Left = 2
  1345. Option1.SpecialEffect = 0
  1346. Option1.Style = 1
  1347. Option1.Top = 2
  1348. Option1.Width = 150
  1349. Option1.Name = "Option1"
  1350. Option2.Picture = lview.bmp
  1351. Option2.Caption = "Local View"
  1352. Option2.Value = 0
  1353. Option2.Height = 130
  1354. Option2.Left = 154
  1355. Option2.Style = 1
  1356. Option2.Top = 2
  1357. Option2.Width = 150
  1358. Option2.Name = "Option2"
  1359. Option3.Picture = rview.bmp
  1360. Option3.Caption = "Remote View"
  1361. Option3.Value = 0
  1362. Option3.Height = 130
  1363. Option3.Left = 306
  1364. Option3.Style = 1
  1365. Option3.Top = 2
  1366. Option3.Width = 150
  1367. Option3.Name = "Option3"
  1368. sampleapp.Pageframe1.Page1
  1369. opgCursorType
  1370. optiongroup
  1371. optiongroup
  1372. jCaption = "label"
  1373. Height = 17
  1374. Left = 58
  1375. Top = 256
  1376. Width = 240
  1377. TabIndex = 16
  1378. Name = "lblCursorName"
  1379. sampleapp.Pageframe1.Page1
  1380. lblCursorName
  1381. label
  1382. label
  1383. pTop = 381
  1384. Left = 334
  1385. Height = 24
  1386. Width = 126
  1387. Caption = "\<Database..."
  1388. TabIndex = 9
  1389. Name = "cmdDatabase"
  1390. Header1
  1391. emp_connection
  1392. CONNECTION
  1393. emp_connection
  1394. emp_connection
  1395. Click,
  1396. header
  1397. Header1
  1398. sampleapp.Pageframe1.Page1
  1399. cmdDatabase
  1400. commandbutton
  1401. commandbutton
  1402. sampleapp.Pageframe1.Page1
  1403. edtCursorInfo
  1404. editbox
  1405. editbox
  1406. EXCLUSIVE
  1407. SHARED6
  1408. USE "employee" &lcExclusive
  1409. USE "emp_view_local"  &lcExclusive
  1410. USE "emp_view_remote"  &lcExclusive
  1411. LCEXCLUSIVE
  1412. PARENT
  1413. CHKEXCL
  1414. VALUE
  1415. PAGE2
  1416. GRID1
  1417. COLUMNCOUNT
  1418. THISFORM
  1419. PAGEFRAME1
  1420. PAGE1
  1421. OPGCURSORTYPE
  1422. OENGINE
  1423. CURSORALIAS
  1424. CURSORTYPE
  1425. ACTIVEPAGE
  1426. Click,
  1427. File Name:
  1428. LCOTHERDATABASE
  1429. OENGINE
  1430. DATABASEFILE
  1431. DATABASENAME    
  1432. JUSTFNAME
  1433. PARENT
  1434. TXTDATABASEFILE
  1435. REFRESH
  1436. Click,
  1437. OENGINE
  1438. CONFLICTALIAS
  1439. CURSORALIAS
  1440. THISFORM
  1441. RELEASE
  1442. Click,
  1443. PROCEDURE Click
  1444. * Create startup form to open DBC
  1445. oStartForm = createobj('OpenDBC')
  1446. IF TYPE('oStartForm')#'O' OR ISNULL(m.oStartForm)
  1447.     RETURN
  1448. ENDIF
  1449. oStartForm.Show
  1450. THISFORM.RefreshStatus
  1451. ENDPROC
  1452. BackStyle = 1
  1453. BorderStyle = 0
  1454. Enabled = .F.
  1455. Height = 49
  1456. Left = 22
  1457. ReadOnly = .F.
  1458. ScrollBars = 0
  1459. SpecialEffect = 1
  1460. TabIndex = 15
  1461. Top = 16
  1462. Width = 566
  1463. DisabledForeColor = 0,0,0
  1464. Name = "edtCursorInfo"
  1465. sampleapp.Pageframe1.Page1
  1466. cmdClose
  1467. commandbutton
  1468. commandbutton
  1469. conflicts.grdConflicts.Column17
  1470. *Caption = "PostalCode"
  1471. Name = "Header1"
  1472. iBorderStyle = 0
  1473. Margin = 0
  1474. ReadOnly = .T.
  1475. ForeColor = 0,0,0
  1476. BackColor = 255,255,255
  1477. Name = "Text1"
  1478. &Caption = "Region"
  1479. Name = "Header1"
  1480. conflicts.grdConflicts.Column9
  1481. conflicts.grdConflicts.Column1
  1482. PROCEDURE Click
  1483. * stop the middle-tire server, if active
  1484. IF oEngine.ServerIsStarted()
  1485.     oEngine.ServerStop
  1486. ENDIF
  1487. CLEAR EVENTS
  1488. RELEASE THISFORM
  1489. ENDPROC
  1490. hTop = 381
  1491. Left = 464
  1492. Height = 24
  1493. Width = 126
  1494. Caption = "\<Close"
  1495. TabIndex = 10
  1496. Name = "cmdClose"
  1497. hCaption = "Status:"
  1498. Height = 17
  1499. Left = 58
  1500. Top = 232
  1501. Width = 313
  1502. TabIndex = 14
  1503. Name = "lblStatus"
  1504. sampleapp.Pageframe1.Page1
  1505.     lblStatus
  1506. label
  1507. label
  1508. *Caption = "Home_phone"
  1509. Name = "Header1"
  1510. conflicts.grdConflicts.Column11
  1511. conflicts.grdConflicts.Column12
  1512. 'Caption = "Country"
  1513. Name = "Header1"
  1514. header
  1515. header
  1516. header
  1517. 4PROCEDURE Click
  1518. thisform.offline("drop")
  1519. ENDPROC
  1520. qTop = 328
  1521. Left = 246
  1522. Height = 24
  1523. Width = 125
  1524. Caption = "Dro\<p OffLine"
  1525. TabIndex = 6
  1526. Name = "cmdDropView"
  1527. cmdDropView
  1528. *Caption = "Reports_to"
  1529. Name = "Header1"
  1530. sampleapp.Pageframe1.Page1
  1531. commandbutton
  1532. commandbutton
  1533. &Caption = "Emp_id"
  1534. Name = "Header1"
  1535. conflicts.grdConflicts.Column2
  1536. textbox
  1537. textbox
  1538. conflicts.grdConflicts.Column4
  1539. Header1
  1540. header
  1541. conflicts.grdConflicts.Column3
  1542. 6PROCEDURE Click
  1543. thisform.offline("create")
  1544. ENDPROC
  1545. sampleapp.Pageframe1.Page1
  1546. cmdCreateView
  1547. PROCEDURE Click
  1548. IF OEngine.DatabaseIsOpened
  1549.     CLOSE DATABASE
  1550.     OEngine.DatabaseName = CS_DATABASE
  1551.     OEngine.DatabaseIsOpened = .F.
  1552.     thisform.RefreshStatus
  1553. ENDIF
  1554. ENDPROC
  1555. Shape1
  1556. uTop = 300
  1557. Left = 246
  1558. Height = 24
  1559. Width = 125
  1560. Caption = "Create O\<ffline"
  1561. TabIndex = 5
  1562. Name = "cmdCreateView"
  1563. commandbutton
  1564. commandbutton
  1565. sampleapp.Pageframe1.Page1
  1566.     chkOnView
  1567. checkbox
  1568. checkbox
  1569. chkExcl
  1570. shape
  1571. shape
  1572. textbox
  1573. oTop = 332
  1574. Left = 422
  1575. Height = 17
  1576. Width = 108
  1577. Caption = "Open On \<Line"
  1578. TabIndex = 8
  1579. Name = "chkOnView"
  1580. textbox
  1581. textbox
  1582. *Caption = "First_name"
  1583. Name = "Header1"
  1584. iBorderStyle = 0
  1585. Margin = 0
  1586. ReadOnly = .T.
  1587. ForeColor = 0,0,0
  1588. BackColor = 255,255,255
  1589. Name = "Text1"
  1590. Header1
  1591. textbox
  1592. iBorderStyle = 0
  1593. Margin = 0
  1594. ReadOnly = .T.
  1595. ForeColor = 0,0,0
  1596. BackColor = 255,255,255
  1597. Name = "Text1"
  1598. PROCEDURE Click
  1599. LOCAL lcSave
  1600. * check for CS_INITIALTABLE
  1601. * handle employee path
  1602. * check write access
  1603. SELECT 0
  1604. USE CS_INITIALTABLE
  1605. lcSave = SET('SAFETY')
  1606. SET SAFETY OFF
  1607. REMOVE TABLE CS_TABLE DELETE
  1608. COPY TO CS_TABLE
  1609. ADD TABLE CS_TABLE
  1610. SET SAFETY &lcSave
  1611. ENDPROC
  1612. sTop = 300
  1613. Left = 68
  1614. Height = 24
  1615. Width = 125
  1616. Caption = "\<Reset Initial Data"
  1617. TabIndex = 3
  1618. Name = "cmdReset"
  1619. sampleapp.Pageframe1.Page1
  1620. cmdReset
  1621. commandbutton
  1622. commandbutton
  1623. emp_connection
  1624. DROP TABLE 
  1625. employee
  1626. CREATE TABLE 
  1627. employee
  1628.  (emp_id char(6) NULL, last_name char(20)NULL, first_name char(10)
  1629.  NULL, title char(30) NULL, salary int NULL, birth_date datetime NULL, hire_date datetime NULL
  1630. , address char(60) NULL, city char(15) NULL, region char(15) NULL, postalcode 
  1631. char(10) NULL, country char(15) NULL, home_phone char(24) NULL, extension char(4)
  1632.  NULL, photo image NULL, notes text NULL, reports_to char(6) NULL)
  1633. Upsizing cannot continue because a connection error occurred
  1634. employee
  1635. Unable to open Employee table.
  1636. emp_view_remote
  1637. Buffering
  1638. APPEND FROM &lcAlias
  1639. Upsizing cannot continue because a connection error occurred
  1640. Upsizing table succeded.
  1641. SELECT &lcAlias
  1642. LNCONNHANDLE
  1643. LCSQL
  1644. LNRETVAL
  1645. LLRETVAL
  1646. LCERRMSG
  1647. LNSERVERERROR
  1648. LCMSG    
  1649. AERRARRAY
  1650. CONNHANDLE
  1651. OENGINE
  1652. ALERT
  1653. SQLCONN_FAIL_LOC
  1654. LCDATASOURCENAME
  1655. LNSERVERERR
  1656. LCALIAS
  1657. LLRESULT
  1658. Click,
  1659. iBorderStyle = 0
  1660. Margin = 0
  1661. ReadOnly = .T.
  1662. ForeColor = 0,0,0
  1663. BackColor = 255,255,255
  1664. Name = "Text1"
  1665. Text1
  1666. header
  1667. conflicts.grdConflicts.Column2
  1668. csdefs.h
  1669. !Arial, 0, 9, 5, 15, 12, 21, 3, 0
  1670.     conflicts
  1671. csdefs.h
  1672. Pixels
  1673. eTop = 12
  1674. Left = 12
  1675. Height = 105
  1676. Width = 445
  1677. BorderStyle = 1
  1678. SpecialEffect = 0
  1679. Name = "Shape2"
  1680. nTop = 328
  1681. Left = 68
  1682. Height = 24
  1683. Width = 125
  1684. Caption = "\<Upsize Table"
  1685. TabIndex = 4
  1686. Name = "cmdUpsize"
  1687. sampleapp.Pageframe1.Page1
  1688.     cmdUpsize
  1689. commandbutton
  1690. commandbutton
  1691. qTop = 303
  1692. Left = 422
  1693. Height = 17
  1694. Width = 120
  1695. Caption = "Open \<Exclusively"
  1696. TabIndex = 7
  1697. Name = "chkExcl"
  1698. sampleapp.Pageframe1.Page1
  1699. checkbox
  1700. checkbox
  1701. Revert failed
  1702. 1 row reverted6
  1703. LNROWS
  1704. OENGINE
  1705. HADERROR
  1706. SETERROROFF
  1707. CMESSAGE
  1708. OCSAPP
  1709. PAGEFRAME1
  1710. PAGE2
  1711. GRID1
  1712. REFRESH
  1713. THISFORM
  1714. Click,
  1715. Header1
  1716. textbox
  1717. ZTop = 220
  1718. Left = 211
  1719. Height = 27
  1720. Width = 84
  1721. Caption = "\<Update"
  1722. Name = "cmdUpdate"
  1723.     conflicts
  1724.     cmdUpdate
  1725. commandbutton
  1726. cmdHelp
  1727. )Caption = "Extension"
  1728. Name = "Header1"
  1729. TTop = 127
  1730. Left = 12
  1731. Height = 92
  1732. Width = 445
  1733. SpecialEffect = 0
  1734. Name = "Shape3"
  1735. eTop = 242
  1736. Left = 418
  1737. Height = 24
  1738. Width = 120
  1739. Caption = "\<Open"
  1740. TabIndex = 2
  1741. Name = "cmdOpen"
  1742. sampleapp.Pageframe1.Page1
  1743. cmdOpen
  1744. commandbutton
  1745. commandbutton
  1746. Shape1
  1747. shape
  1748. textbox
  1749. textbox
  1750. conflicts.grdConflicts.Column12
  1751. header
  1752. header
  1753. Header1
  1754. conflicts.grdConflicts.Column13
  1755. %Caption = "Title"
  1756. Name = "Header1"
  1757. conflicts.grdConflicts.Column4
  1758. iBorderStyle = 0
  1759. Margin = 0
  1760. ReadOnly = .T.
  1761. ForeColor = 0,0,0
  1762. BackColor = 255,255,255
  1763. Name = "Text1"
  1764. header
  1765. Header1
  1766. conflicts.grdConflicts.Column5
  1767. &Caption = "Salary"
  1768. Name = "Header1"
  1769. textbox
  1770. textbox
  1771. Text1
  1772. conflicts.grdConflicts.Column5
  1773. iBorderStyle = 0
  1774. Margin = 0
  1775. ReadOnly = .T.
  1776. ForeColor = 0,0,0
  1777. BackColor = 255,255,255
  1778. Name = "Text1"
  1779. header
  1780. header
  1781. Header1
  1782. conflicts.grdConflicts.Column6
  1783. *Caption = "Birth_date"
  1784. Name = "Header1"
  1785. textbox
  1786. textbox
  1787. Text1
  1788. conflicts.grdConflicts.Column6
  1789. header
  1790. header
  1791. Header1
  1792. Class
  1793. UTop = 288
  1794. Left = 230
  1795. Height = 76
  1796. Width = 156
  1797. SpecialEffect = 0
  1798. Name = "Shape1"
  1799. sampleapp.Pageframe1.Page1
  1800. shape
  1801. yAutoSize = .T.
  1802. Caption = "Maintenance:"
  1803. Height = 17
  1804. Left = 69
  1805. Top = 280
  1806. Width = 75
  1807. TabIndex = 13
  1808. Name = "Label2"
  1809. sampleapp.Pageframe1.Page1
  1810. Label2
  1811. label
  1812. label
  1813. textbox
  1814. textbox
  1815. Text1
  1816. oengine
  1817. *refreshstatus 
  1818. Text1
  1819. iBorderStyle = 0
  1820. Margin = 0
  1821. ReadOnly = .T.
  1822. ForeColor = 0,0,0
  1823. BackColor = 255,255,255
  1824. Name = "Text1"
  1825. conflicts.grdConflicts.Column17
  1826. commandbutton
  1827. commandbutton
  1828. Text1
  1829. Shape2
  1830. shape
  1831. textbox
  1832.     conflicts
  1833.     conflicts
  1834. lblConflicts
  1835. label
  1836. label
  1837.     conflicts
  1838. editbox
  1839. Top = 187
  1840. Left = 240
  1841. Height = 24
  1842. Width = 84
  1843. Caption = "\<Close"
  1844. Enabled = .T.
  1845. TabIndex = 7
  1846. Visible = .T.
  1847. Name = "cmdCloseDatabase"
  1848. iBorderStyle = 0
  1849. Margin = 0
  1850. ReadOnly = .T.
  1851. ForeColor = 0,0,0
  1852. BackColor = 255,255,255
  1853. Name = "Text1"
  1854. conflicts.grdConflicts.Column7
  1855. )Caption = "Hire_date"
  1856. Name = "Header1"
  1857. textbox
  1858. textbox
  1859. Text1
  1860. conflicts.grdConflicts.Column7
  1861. iBorderStyle = 0
  1862. Margin = 0
  1863. ReadOnly = .T.
  1864. ForeColor = 0,0,0
  1865. BackColor = 255,255,255
  1866. Name = "Text1"
  1867. header
  1868. header
  1869. Header1
  1870. conflicts.grdConflicts.Column8
  1871. 'Caption = "Address"
  1872. Name = "Header1"
  1873. textbox
  1874. textbox
  1875. Text1
  1876. eCaption = "Conflicts on row:"
  1877. Height = 17
  1878. Left = 10
  1879. Top = 84
  1880. Width = 170
  1881. Name = "lblConflicts"
  1882. BorderStyle = 0
  1883. Enabled = .F.
  1884. Height = 49
  1885. Left = 10
  1886. ScrollBars = 0
  1887. SpecialEffect = 1
  1888. Top = 14
  1889. Width = 590
  1890. DisabledForeColor = 0,0,0
  1891. Name = "edtConflictsInfo"
  1892. edtConflictsInfo
  1893. editbox
  1894. PROCEDURE Click
  1895. IF INDBC(CS_CONNECTION, 'CONNECTION')
  1896.     MODIFY CONNECTION CS_CONNECTION
  1897.     CREATE CONNECTION CS_CONNECTION
  1898. ENDIF
  1899. ENDPROC
  1900. textbox
  1901. header
  1902. header
  1903. )PROCEDURE Click
  1904. thisform.next
  1905. ENDPROC
  1906. XTop = 220
  1907. Left = 418
  1908. Height = 27
  1909. Width = 84
  1910. Caption = "\<Ignore"
  1911. Name = "cmdSkip"
  1912.     conflicts
  1913. cmdSkip
  1914. commandbutton
  1915. commandbutton
  1916. WCaption = "New value"
  1917. Height = 15
  1918. Left = 10
  1919. Top = 175
  1920. Width = 84
  1921. Name = "Label3"
  1922.     conflicts
  1923. Label3
  1924. label
  1925. label
  1926. [Caption = "Current value"
  1927. Height = 15
  1928. Left = 10
  1929. Top = 155
  1930. Width = 96
  1931. Name = "Label2"
  1932.     conflicts
  1933. Label2
  1934. label
  1935. label
  1936. WCaption = "Old value"
  1937. Height = 15
  1938. Left = 10
  1939. Top = 135
  1940. Width = 96
  1941. Name = "Label1"
  1942. PROCEDURE Click
  1943. LOCAL lcOtherDatabase
  1944. lcOtherDatabase = LOWER(GETFILE(DBC_TYPE,GETFILE_LOC,GETFILEBTN_LOC))
  1945. OEngine.DatabaseFile = lcOtherDatabase
  1946. OEngine.DatabaseName = OEngine.JustFName(lcOtherDatabase)
  1947. this.parent.txtDatabasefile.refresh
  1948. ENDPROC
  1949. Header1
  1950. textbox
  1951. PROCEDURE Click
  1952. LOCAL lcExclusive
  1953. lcExclusive = IIF(this.parent.chkExcl.value = 1, 'EXCLUSIVE', 'SHARED')
  1954. * reset grid
  1955. This.Parent.Parent.Page2.Grid1.ColumnCount = -1
  1956. DO CASE
  1957.     CASE thisform.pageframe1.page1.opgCursorType.Value = 1
  1958.         * local table
  1959.         SELECT 0
  1960.         USE CS_TABLE &lcExclusive
  1961.         oEngine.CursorAlias = TRIM(ALIAS())
  1962.         oEngine.CursorType = TABLE_CURSOR
  1963.     CASE thisform.pageframe1.page1.opgCursorType.Value = 2
  1964.         *local view
  1965.         SELECT 0
  1966.         USE CS_LOCAL_VIEW  &lcExclusive
  1967.         oEngine.CursorAlias = TRIM(ALIAS())
  1968.         oEngine.CursorType = LOCAL_VIEW_CURSOR
  1969.     CASE thisform.pageframe1.page1.opgCursorType.Value = 3
  1970.         *remote view
  1971.         SELECT 0
  1972.         USE CS_REMOTE_VIEW  &lcExclusive
  1973.         oEngine.CursorAlias = TRIM(ALIAS())
  1974.         oEngine.CursorType = REMOTE_VIEW_CURSOR
  1975. ENDCASE
  1976. IF EMPTY(ALIAS())
  1977.     * Failed to open data source
  1978.     RETURN
  1979. ENDIF
  1980. thisform.pageframe1.ActivePage = 2
  1981. ENDPROC
  1982. TTop = 287
  1983. Left = 52
  1984. Height = 77
  1985. Width = 156
  1986. SpecialEffect = 0
  1987. Name = "Shape2"
  1988. sampleapp.Pageframe1.Page1
  1989. Top = 195
  1990. Left = 25
  1991. Height = 17
  1992. Width = 70
  1993. Caption = "\<Exclusive"
  1994. TabIndex = 9
  1995. DisabledForeColor = 128,128,128
  1996. Name = "chkExclDatabase"
  1997. conflicts.grdConflicts.Column13
  1998. conflicts.grdConflicts.Column14
  1999. textbox
  2000. Text1
  2001. header
  2002. header
  2003. iBorderStyle = 0
  2004. Margin = 0
  2005. ReadOnly = .T.
  2006. ForeColor = 0,0,0
  2007. BackColor = 255,255,255
  2008. Name = "Text1"
  2009. YBorderStyle = 0
  2010. Margin = 0
  2011. ForeColor = 0,0,0
  2012. BackColor = 255,255,255
  2013. Name = "Text1"
  2014. shape
  2015. vAutoSize = .T.
  2016. Caption = "Options:"
  2017. Height = 17
  2018. Left = 420
  2019. Top = 280
  2020. Width = 48
  2021. TabIndex = 12
  2022. Name = "Label3"
  2023. sampleapp.Pageframe1.Page1
  2024. Label3
  2025. label
  2026. label
  2027. UTop = 288
  2028. Left = 406
  2029. Height = 76
  2030. Width = 156
  2031. SpecialEffect = 0
  2032. Name = "Shape4"
  2033. sampleapp.Pageframe1.Page1
  2034. Shape4
  2035. shape
  2036. shape
  2037. cTop = 76
  2038. Left = 22
  2039. Height = 298
  2040. Width = 567
  2041. BackStyle = 0
  2042. SpecialEffect = 0
  2043. Name = "Shape3"
  2044. sampleapp.Pageframe1.Page1
  2045. Shape3
  2046. shape
  2047. shape
  2048. fErasePage = .T.
  2049. PageCount = 2
  2050. Top = -12
  2051. Left = 0
  2052. Width = 640
  2053. Height = 480
  2054. Tabs = .F.
  2055. TabIndex = 1
  2056. TabStop = .T.
  2057. RightToLeft = .T.
  2058. Name = "Pageframe1"
  2059. Page1.FontName = "MS Sans Serif"
  2060. Page1.FontSize = 8
  2061. Page1.Caption = ""
  2062. Page1.Name = "Page1"
  2063. Page2.FontName = "MS Sans Serif"
  2064. Page2.FontSize = 8
  2065. Page2.Caption = "Page2"
  2066. Page2.Name = "Page2"
  2067.     sampleapp
  2068. Pageframe1
  2069.     pageframe
  2070.     pageframe
  2071. 2oengine
  2072. *refreshstatus 
  2073. *getstatus 
  2074. *offline 
  2075. Height = 400
  2076. Width = 615
  2077. ShowWindow = 0
  2078. DoCreate = .T.
  2079. AutoCenter = .T.
  2080. BorderStyle = 2
  2081. Caption = "Client/Server Application"
  2082. MaxButton = .F.
  2083. Movable = .T.
  2084. WindowState = 0
  2085. LockScreen = .F.
  2086. Name = "sampleapp"
  2087. (PROCEDURE Click
  2088. LOCAL llUpdate 
  2089. * force-update current row
  2090. oEngine.HadError = .F.
  2091. oEngine.SetErrorOff = .T.
  2092. llUpdate = TABLEUPDATE(.F., .T.)
  2093. IF oEngine.HadError
  2094.     =MESSAGEBOX(Oengine.cMessage, MB_ICONEXCLAMATION)
  2095.     llUpdate = .F.
  2096. ENDIF
  2097. oEngine.SetErrorOff = .F.
  2098. * Display whether update was successful or failed (e.g., primary key changed)
  2099. IF m.llUpdate
  2100.     wait window WAIT_UPDATEOK_LOC timeout CS_TIMEOUT
  2101.     wait window WAIT_UPDATEFAIL1_LOC timeout CS_TIMEOUT
  2102. ENDIF
  2103. Ocsapp.pageframe1.page2.grid1.refresh
  2104. thisform.next
  2105. ENDPROC
  2106. Text1
  2107. textbox
  2108. textbox
  2109. CPROCEDURE next
  2110. PARAMETERS lnStartRow
  2111. LOCAL lnRow, lcEmployee, lcUserField, aUserValues, lnBuffering, nCursorType
  2112. DIMENSION aUserValues[1]
  2113. * default start row is current row
  2114. IF PARAMETERS() = 0
  2115.     lnStartRow = RECNO()
  2116. ENDIF
  2117. * close form after single row conflicts
  2118. lcEmployee = oEngine.CursorAlias
  2119. lnBuffering = CURSORGETPROP('Buffering')
  2120. IF (oEngine.RowConflict OR lnBuffering < 4) AND lnStartRow <> 0
  2121.     this.cmdClose.click
  2122.     RETURN
  2123. ENDIF
  2124. nCursorType = CURSORGETPROP("SourceType",oEngine.CursorAlias)
  2125. * for table buffering move to next row
  2126. IF !oEngine.RowConflict AND lnBuffering > 3
  2127.     lnRow = GETNEXTMODIFIED(lnStartRow, lcEmployee)
  2128.     this.lblConflicts.caption = CS_ROWCONFLICT_LOC + LTRIM(STR(lnRow,10 , 0))
  2129.     IF lnRow = 0
  2130.         this.cmdClose.click
  2131.         RETURN
  2132.     ENDIF
  2133.     GO lnRow IN (lcEmployee)
  2134. ENDIF
  2135. * load original values
  2136. SELECT (oEngine.ConflictAlias)
  2137. GO TOP
  2138. FOR m.i = 1 TO ALEN(THIS.aEmployee, 1)
  2139.     REPLACE (THIS.aEmployee[m.i,1]) WITH OLDVAL(THIS.aEmployee[m.i,1], lcEmployee)
  2140. ENDFOR
  2141. * load current values
  2142. * add error code here
  2143. IF m.nCursorType # 3    && refresh if not a table
  2144.     REFRESH(1, 0, lcEmployee)
  2145. ENDIF
  2146. FOR m.i = 1 TO ALEN(THIS.aEmployee, 1)
  2147.     REPLACE (THIS.aEmployee[m.i,1]) WITH CURVAL(THIS.aEmployee[m.i,1], lcEmployee)
  2148. ENDFOR
  2149. * load user values
  2150. FOR m.i = 1 TO ALEN(THIS.aEmployee, 1)
  2151.     lcUserField = lcEmployee + '.' + THIS.aEmployee[m.i,1]
  2152.     REPLACE (THIS.aEmployee[m.i,1]) WITH EVALUATE(lcUserField)
  2153. ENDFOR
  2154. go top
  2155. this.grdConflicts.Refresh
  2156. SELECT (oEngine.CursorAlias)
  2157. ENDPROC
  2158. PROCEDURE Init
  2159. LOCAL aTmpEmp
  2160. DIMENSION aTmpEmp[1]
  2161. DIMENSION THIS.aEmployee[1]
  2162. this.edtConflictsInfo.value = CS_CONFLICTS_INFO_LOC
  2163. oEngine.CurrentPage = 3
  2164. * create conflict cursor
  2165. lcEmployee = oEngine.CursorAlias
  2166. AFIELDS(aTmpEmp)
  2167. ACOPY(aTmpEmp,THIS.aEmployee)
  2168. SELECT 0
  2169. CREATE CURSOR CS_CONFLICTS FROM ARRAY aTmpEmp
  2170. oEngine.ConflictAlias = TRIM(ALIAS())
  2171. * append conflict records
  2172. APPEND BLANK
  2173. APPEND BLANK
  2174. APPEND BLANK
  2175. this.grdConflicts.RecordSource = oEngine.ConflictAlias
  2176. * move on first conflict
  2177. thisform.next(0)
  2178. ENDPROC
  2179. conflicts.grdConflicts.Column8
  2180. iBorderStyle = 0
  2181. Margin = 0
  2182. ReadOnly = .T.
  2183. ForeColor = 0,0,0
  2184. BackColor = 255,255,255
  2185. Name = "Text1"
  2186. header
  2187. header
  2188. Header1
  2189. conflicts.grdConflicts.Column9
  2190. $Caption = "City"
  2191. Name = "Header1"
  2192. textbox
  2193. textbox
  2194. Text1
  2195. header
  2196. Height = 250
  2197. Width = 620
  2198. DoCreate = .T.
  2199. AutoCenter = .T.
  2200. Caption = "Resolve Conflicts"
  2201. ControlBox = .F.
  2202. MinButton = .F.
  2203. WindowType = 1
  2204. WindowState = 0
  2205. AlwaysOnTop = .T.
  2206. Name = "conflicts"
  2207. header
  2208. header
  2209. Header1
  2210. conflicts.grdConflicts.Column3
  2211.     conflicts
  2212. Label1
  2213. label
  2214. label
  2215. qPROCEDURE Click
  2216. SELECT (oEngine.ConflictAlias)
  2217. SELECT (oEngine.CursorAlias)
  2218. THISFORM.release
  2219. ENDPROC
  2220. XTop = 220
  2221. Left = 521
  2222. Height = 27
  2223. Width = 84
  2224. Caption = "\<Close"
  2225. Name = "cmdClose"
  2226.     conflicts
  2227. iBorderStyle = 0
  2228. Margin = 0
  2229. ReadOnly = .T.
  2230. ForeColor = 0,0,0
  2231. BackColor = 255,255,255
  2232. Name = "Text1"
  2233.     conflicts
  2234. wTop = 220
  2235. Left = 12
  2236. Height = 27
  2237. Width = 84
  2238. FontName = "Arial"
  2239. FontSize = 9
  2240. Caption = "\<Help"
  2241. Name = "cmdHelp"
  2242. commandbutton
  2243. Text1
  2244. *next 
  2245. ^aemployee[1,0] 
  2246. header
  2247. grdConflicts
  2248.     conflicts
  2249. header
  2250. header
  2251. 2PROCEDURE Click
  2252. HELP ID HELP_CONFLICTS
  2253. ENDPROC
  2254. )Caption = "Last_name"
  2255. Name = "Header1"
  2256. iBorderStyle = 0
  2257. Margin = 0
  2258. ReadOnly = .T.
  2259. ForeColor = 0,0,0
  2260. BackColor = 255,255,255
  2261. Name = "Text1"
  2262. GPROCEDURE Error
  2263. LPARAMETERS nError, cMethod, nLine
  2264. LOCAL  lcMsg
  2265. OEngine.DatabaseIsOpened = .F.
  2266. IF m.nError = 1705
  2267.     lcMsg = STRTRAN(CANT_OPEN_EXCLU_LOC, "|1", OEngine.DatabaseFile)
  2268.     lcMsg = STRTRAN(CANT_OPENDB_LOC, "|1" , OEngine.DatabaseFile)
  2269. ENDIF
  2270. =MESSAGEBOX(lcMsg, MB_ICONEXCLAMATION)
  2271. ENDPROC
  2272. PROCEDURE Click
  2273. LOCAL lcExclusive, lcMsg
  2274. IF EMPTY(OEngine.DatabaseFile)
  2275.     RETURN
  2276. ENDIF
  2277. IF !FILE(OEngine.DatabaseFile)
  2278.     * should not occur
  2279.     =MESSAGEBOX(NO_SUCH_FILE_LOC, 48)
  2280.     RETURN
  2281. ENDIF
  2282. * set database properties on OEngine
  2283. OEngine.DatabaseIsOpened = .T.
  2284. lcExclusive = IIF(this.parent.chkExclDatabase.value = 1, "EXCLUSIVE", "SHARED")
  2285. OPEN DATABASE (OEngine.DatabaseFile) &lcExclusive
  2286. * Check if failed to open DBC
  2287. IF !OEngine.DatabaseIsOpened THEN
  2288.     RETURN
  2289. ENDIF
  2290. thisform.RefreshStatus
  2291. ENDPROC
  2292. Header1
  2293. conflicts.grdConflicts.Column1
  2294. cmdClose
  2295. commandbutton
  2296. commandbutton
  2297.     conflicts
  2298.     cmdRevert
  2299. PROCEDURE Click
  2300. LOCAL lnConnHandle, lcSQL, lnRetVal, llRetVal, lcErrMsg, lnServerError, lcMsg, aErrArray
  2301. DIMENSION aErrArray[6]
  2302. *connect to SQL Server 
  2303. ConnHandle = SQLCONNECT(CS_CONNECTION)
  2304. DO CASE
  2305.     CASE ConnHandle = -1
  2306.         * connection failure
  2307.         lcMsg = message()
  2308.         OEngine.Alert(lcMsg, MB_ICONEXCLAMATION + MB_OK)
  2309.         RETURN .F.
  2310.     CASE ConnHandle = -2
  2311.         * invalid conn. handle (rare)
  2312.         lcMsg = STRTRAN(SQLCONN_FAIL_LOC, "|1", lcDataSourceName)
  2313.         OEngine.Alert(lcMsg, MB_ICONEXCLAMATION + MB_OK)
  2314.         RETURN .F.
  2315. ENDCASE
  2316. * drop the table if it exists, ignore error if it doesn't exist
  2317. lcSQL = "DROP TABLE " + CS_TABLE
  2318. lnRetVal = SQLEXEC(ConnHandle, lcSQL)
  2319. =AERROR(aErrArray)
  2320. IF lnRetVal <>1
  2321.     lnServerError = aErrArray[5]
  2322.     lcErrMsg = aErrArray[2]
  2323.     IF lnServerError <> 3701
  2324.         OEngine.Alert(lcErrMsg, MB_ICONEXCLAMATION + MB_OK)
  2325.         RETURN .F.
  2326.     ENDIF
  2327. ENDIF
  2328. * create remote table
  2329. lcSQL = "CREATE TABLE " + CS_TABLE + " (emp_id char(6) NULL, last_name char(20)NULL, first_name char(10)"
  2330. lcSQL = lcSQL + " NULL, title char(30) NULL, salary int NULL, birth_date datetime NULL, hire_date datetime NULL"
  2331. lcSQL = lcSQL + ", address char(60) NULL, city char(15) NULL, region char(15) NULL, postalcode "
  2332. lcSQL = lcSQL + "char(10) NULL, country char(15) NULL, home_phone char(24) NULL, extension char(4)"
  2333. lcSQL = lcSQL + " NULL, photo image NULL, notes text NULL, reports_to char(6) NULL)"
  2334. lnRetVal = SQLEXEC(ConnHandle, lcSQL)
  2335. =SQLDISCONN(ConnHandle)
  2336. IF lnRetVal <> 1
  2337.     DO CASE
  2338.         * Server error occurred
  2339.         CASE lnRetVal = -1
  2340.             =AERROR(aErrArray)
  2341.             lnServerError = aErrArray[1]
  2342.             lcErrMsg = aErrArray[2]
  2343.             IF lnServerError = 1526 AND !ISNULL(aErrArray[5])THEN
  2344.             lnServerError = aErrArray[5]
  2345.             ENDIF
  2346.         * Connection level error occurred
  2347.         CASE lnRetVal = -2
  2348.             lcErrMsg = STRTRAN(CONNECT_FAILURE_LOC, "|1", LTRIM(STR(lnServerErr)))
  2349.             OEngine.Alert(lcErrMsg, MB_ICONEXCLAMATION + MB_OK)
  2350.     ENDCASE
  2351.     RETURN .F.
  2352. ENDIF
  2353. * open Employee table
  2354. SELECT 0
  2355. USE CS_TABLE SHARED
  2356. lcAlias = TRIM(ALIAS())
  2357. IF lcAlias = ''
  2358.     OEngine.Alert(ERR_NOOPENEMP_LOC, MB_ICONEXCLAMATION + MB_OK)
  2359.     RETURN .F.
  2360. ENDIF        
  2361. * open local view
  2362. SELECT 0
  2363. USE CS_REMOTE_VIEW
  2364. =CURSORSETPROP('Buffering', 5)
  2365. * upsize Employee table using remote view
  2366. APPEND FROM &lcAlias
  2367. llResult = TABLEUPDATE(.T.)
  2368. IF !llResult
  2369.     OEngine.Alert(CONNECT_FAILURE_LOC, MB_ICONEXCLAMATION)
  2370.     TABLEREVERT(.T.)
  2371.     wait window WAIT_UPSIZEOK_LOC timeout CS_TIMEOUT
  2372. ENDIF
  2373. * clean up code
  2374. USE        && view
  2375. SELECT &lcAlias
  2376. USE        && table
  2377. ENDPROC
  2378. ZTop = 220
  2379. Left = 315
  2380. Height = 27
  2381. Width = 84
  2382. Caption = "\<Revert"
  2383. Name = "cmdRevert"
  2384. PROCEDURE Click
  2385. LOCAL lnRows 
  2386. oEngine.HadError = .F.
  2387. oEngine.SetErrorOff = .T.
  2388. lnRows = TABLEREVERT(.F.)
  2389. IF oEngine.HadError
  2390.     =MESSAGEBOX(Oengine.cMessage, MB_ICONEXCLAMATION)
  2391.     lnRows = 0
  2392. ENDIF
  2393. oEngine.SetErrorOff = .F.
  2394. * no conflicts, no row or one row reverted
  2395. wait window IIF(lnRows = 0,WAIT_REVERTFAIL_LOC,WAIT_REVERT1_LOC) timeout CS_TIMEOUT
  2396. Ocsapp.pageframe1.page2.grid1.refresh
  2397. thisform.next
  2398. ENDPROC
  2399. textbox
  2400. textbox
  2401. Header1
  2402. iBorderStyle = 0
  2403. Margin = 0
  2404. ReadOnly = .T.
  2405. ForeColor = 0,0,0
  2406. BackColor = 255,255,255
  2407. Name = "Text1"
  2408. conflicts.grdConflicts.Column10
  2409. THISFORM
  2410. REFRESHSTATUS<
  2411. Informations about updates functionality.
  2412. Table: 
  2413. Local View: 
  2414. Remote View: 
  2415. Buffering
  2416. oEngine.oServerb
  2417. LROWBUFFERING
  2418. LFORCE
  2419. LTABLEBUFFERING
  2420. NUPDATETYPE
  2421. AERRORS
  2422. LNPREVPAGE
  2423. EDTFUNCTIONSINFO
  2424. VALUE
  2425. OENGINE
  2426. CURSORTYPE
  2427. LBLCURSORACTIVE
  2428. CAPTION
  2429. CURSORALIAS
  2430. ONLINESTATUS
  2431. CURRENTPAGE
  2432. CMDREQUERY
  2433. ENABLED    
  2434. OPGBUFFER
  2435. OPTION1
  2436. OPTION2
  2437. OPTION4    
  2438. CMDUPDATE    
  2439. CMDREVERT    
  2440. OPGUPDATE
  2441. CHKFORCE
  2442. CHKCONFLICTS
  2443. CHKRULES
  2444. OSERVER
  2445. INTERACTIVECHANGE
  2446. GRID1
  2447. RECORDSOURCE
  2448. REFRESH
  2449. Page1.Activate,
  2450. Page2.ActivateV
  2451. Unable to open '|1' exclusively.
  2452. NERROR
  2453. CMETHOD
  2454. NLINE
  2455. LCMSG
  2456. OENGINE
  2457. DATABASEISOPENED
  2458. DATABASEFILE
  2459. CANT_OPENDB_LOC
  2460. File does not exist.
  2461. EXCLUSIVE
  2462. SHARED6
  2463. OPEN DATABASE (OEngine.DatabaseFile) &lcExclusive
  2464. LCEXCLUSIVE
  2465. LCMSG
  2466. OENGINE
  2467. DATABASEFILE
  2468. DATABASEISOPENED
  2469. PARENT
  2470. CHKEXCLDATABASE
  2471. VALUE
  2472. THISFORM
  2473. REFRESHSTATUS
  2474. Error,
  2475. Click3
  2476. Update succeded
  2477. Update failed, the primary key has changed
  2478. LLUPDATE
  2479. OENGINE
  2480. HADERROR
  2481. SETERROROFF
  2482. CMESSAGE
  2483. OCSAPP
  2484. PAGEFRAME1
  2485. PAGE2
  2486. GRID1
  2487. REFRESH
  2488. THISFORM
  2489. Click,
  2490. PROCEDURE refreshstatus
  2491. LOCAL llOffline
  2492. this.edtDatabaseInfo.value = CS_DATABASE_INFO_LOC
  2493. this.edtDatabaseInfo1.value = CS_DATABASE_INFO1_LOC
  2494. this.edtDatabaseInfo2.value = CS_DATABASE_INFO2_LOC
  2495. IF OEngine.DatabaseIsOpened
  2496.     this.cmdBrowse.Enabled = .F.
  2497.     this.cmdOpenDatabase.Enabled = .F.
  2498.     this.chkExclDatabase.Enabled = .F.
  2499.     this.cmdCloseDatabase.Enabled = .T.
  2500.     this.cmdModifyConnection.Enabled = .T.
  2501.     this.cmdBrowse.Enabled = .T.
  2502.     this.cmdOpenDatabase.Enabled = .T.
  2503.     this.chkExclDatabase.Enabled = .T.
  2504.     this.cmdCloseDatabase.Enabled = .F.
  2505.     this.cmdModifyConnection.Enabled = .F.
  2506.     this.cmdOpenDatabase.Setfocus
  2507. ENDIF
  2508. ENDPROC
  2509. PROCEDURE Init
  2510. LOCAL lcFile
  2511. IF EMPTY(OEngine.DatabaseFile)
  2512.     lcFile = LOWER(fullpath(CS_DATABASE))
  2513.     if (FILE(lcFile))
  2514.         OEngine.DatabaseFile = lcFile
  2515.     ENDIF
  2516. ENDIF
  2517. this.RefreshStatus
  2518. ENDPROC
  2519. PROCEDURE Load
  2520. IF TYPE("m.oEngine") # "O" OR ISNULL(m.oEngine)
  2521.     RETURN .F.
  2522. ENDIF
  2523. ENDPROC
  2524. CS.DBC is the database required by this sample. Make 
  2525. sure the full path to CS.DBC is displayed in the text box.
  2526.  If it isn't, choose the dialog button beside the text box 
  2527. and locate CS.DBC.
  2528. Choose Open to open the CS.DBC database. Make sure Exclusive 
  2529. is selected if you want to be able to modify the database in the sample.
  2530. In order to upsize and view remote data you need to set up a connection 
  2531. to a back end database. You only need to setup the connection the first 
  2532. time you run this sample.
  2533. LLOFFLINE
  2534. EDTDATABASEINFO
  2535. VALUE
  2536. EDTDATABASEINFO1
  2537. EDTDATABASEINFO2
  2538. OENGINE
  2539. DATABASEISOPENED    
  2540. CMDBROWSE
  2541. ENABLED
  2542. CMDOPENDATABASE
  2543. CHKEXCLDATABASE
  2544. CMDCLOSEDATABASE
  2545. CMDMODIFYCONNECTION
  2546. SETFOCUSe
  2547. cs.dbc
  2548. LCFILE
  2549. OENGINE
  2550. DATABASEFILE
  2551. REFRESHSTATUS6
  2552. m.oEngineb
  2553. OENGINE
  2554. refreshstatus,
  2555. ColumnCount = 17
  2556. Height = 90
  2557. Highlight = .F.
  2558. HighlightRow = .F.
  2559. Left = 110
  2560. ReadOnly = .T.
  2561. RecordSource = ""
  2562. ScrollBars = 1
  2563. Top = 115
  2564. Width = 492
  2565. Name = "grdConflicts"
  2566. Column1.ControlSource = ""
  2567. Column1.ReadOnly = .T.
  2568. Column1.Name = "Column1"
  2569. Column2.ControlSource = ""
  2570. Column2.ReadOnly = .T.
  2571. Column2.Name = "Column2"
  2572. Column3.ControlSource = ""
  2573. Column3.ReadOnly = .T.
  2574. Column3.Name = "Column3"
  2575. Column4.ControlSource = ""
  2576. Column4.ReadOnly = .T.
  2577. Column4.Name = "Column4"
  2578. Column5.ControlSource = ""
  2579. Column5.Width = 80
  2580. Column5.ReadOnly = .T.
  2581. Column5.Name = "Column5"
  2582. Column6.ControlSource = ""
  2583. Column6.Width = 80
  2584. Column6.ReadOnly = .T.
  2585. Column6.Name = "Column6"
  2586. Column7.ControlSource = ""
  2587. Column7.Width = 80
  2588. Column7.ReadOnly = .T.
  2589. Column7.Name = "Column7"
  2590. Column8.ControlSource = ""
  2591. Column8.Width = 180
  2592. Column8.ReadOnly = .T.
  2593. Column8.Name = "Column8"
  2594. Column9.ControlSource = ""
  2595. Column9.Width = 80
  2596. Column9.ReadOnly = .T.
  2597. Column9.Name = "Column9"
  2598. Column10.ControlSource = ""
  2599. Column10.Width = 80
  2600. Column10.ReadOnly = .T.
  2601. Column10.Name = "Column10"
  2602. Column11.ControlSource = ""
  2603. Column11.Width = 80
  2604. Column11.ReadOnly = .T.
  2605. Column11.Name = "Column11"
  2606. Column12.ControlSource = ""
  2607. Column12.ReadOnly = .T.
  2608. Column12.Name = "Column12"
  2609. Column13.ControlSource = ""
  2610. Column13.Width = 90
  2611. Column13.ReadOnly = .T.
  2612. Column13.Name = "Column13"
  2613. Column14.ControlSource = ""
  2614. Column14.Width = 55
  2615. Column14.ReadOnly = .T.
  2616. Column14.Name = "Column14"
  2617. Column15.ControlSource = ""
  2618. Column15.Width = 40
  2619. Column15.ReadOnly = .T.
  2620. Column15.Name = "Column15"
  2621. Column16.ControlSource = ""
  2622. Column16.Width = 40
  2623. Column16.ReadOnly = .T.
  2624. Column16.Name = "Column16"
  2625. Column17.Width = 70
  2626. Column17.ReadOnly = .T.
  2627. Column17.Name = "Column17"
  2628. VPROCEDURE Page1.Activate
  2629. * refresh table and view info
  2630. thisform.RefreshStatus
  2631. ENDPROC
  2632. PROCEDURE Page2.Activate
  2633. PUBLIC lRowBuffering, lForce, lTableBuffering, nUpdateType, aErrors, lnPrevPage
  2634. DIMENSION aErrors[1]
  2635. this.edtFunctionsInfo.value = CS_FUNCTIONS_INFO_LOC
  2636. *set cursor name opened
  2637. DO CASE
  2638.     CASE oEngine.CursorType = 1
  2639.         * local table
  2640.         this.lblcursorActive.caption = CS_STATTBL_LOC  + oEngine.CursorAlias
  2641.     CASE oEngine.CursorType = 2
  2642.         *local view
  2643.         this.lblcursorActive.caption = CS_STATLV_LOC  + oEngine.CursorAlias + " " + oEngine.OnlineStatus
  2644.     CASE oEngine.CursorType = 3
  2645.         *remote view
  2646.         this.lblcursorActive.caption = CS_STATRV_LOC  + oEngine.CursorAlias + " " + oEngine.OnlineStatus
  2647. ENDCASE
  2648. * don't initialize after conflict resolution
  2649. lnPrevPage = oEngine.CurrentPage
  2650. oEngine.Currentpage = 2
  2651. IF lnPrevPage = 3
  2652.     RETURN
  2653. ENDIF
  2654. this.cmdRequery.enabled = !(oEngine.CursorType = TABLE_CURSOR)
  2655. * initialize buffering options
  2656. this.opgBuffer.value = CURSORGETPROP('Buffering')
  2657. IF Oengine.CursorType = TABLE_CURSOR
  2658.     this.opgBuffer.option1.enabled = .T.
  2659.     this.opgBuffer.option2.enabled = .T.
  2660.     this.opgBuffer.option4.enabled = .T.
  2661.     this.cmdUpdate.enabled = !(this.opgBuffer.value = 1)
  2662.     this.cmdRevert.enabled = !(this.opgBuffer.value = 1)
  2663.     this.cmdRequery.enabled = !(oEngine.CursorType = TABLE_CURSOR)
  2664.     this.opgBuffer.option1.enabled = .F.
  2665.     this.opgBuffer.option2.enabled = .F.
  2666.     this.opgBuffer.option4.enabled = .F.
  2667. ENDIF
  2668. this.opgUpdate.value = 1        && row update
  2669. this.chkForce.value = .F.        && optimistic conflict resolution
  2670. this.chkConflicts.value = .T.    && conflict resolution on
  2671. * local business rule checking
  2672. this.chkRules.value = !(TYPE('oEngine.oServer') <> 'O' OR ISNULL(oEngine.oServer))
  2673. this.opgBuffer.interactivechange
  2674. this.grid1.RecordSource = oEngine.CursorAlias
  2675. this.grid1.refresh
  2676. ENDPROC
  2677. Select a cursor type based on a Table, Local View or Remote View. For Table cursors you can reload the initial data and upsize the table. For View cursors you can 
  2678. toggle between the online and offline modes. Then select the concurrency option and open the cursor.
  2679. Table: C
  2680. employeef
  2681. employee
  2682. TABLE
  2683. emp_connection
  2684. CONNECTION
  2685. emp_init
  2686. TABLE
  2687. Local View: C
  2688. emp_view_localf
  2689. emp_view_local
  2690. emp_view_local
  2691. offlinepath
  2692. Remote View: C
  2693. emp_view_remotef
  2694. emp_view_remote
  2695. emp_connection
  2696. CONNECTION
  2697. emp_view_remote
  2698. offlinepath
  2699. LLOFFLINE
  2700. PAGEFRAME1
  2701. PAGE1
  2702. EDTCURSORINFO
  2703. VALUE    
  2704. GETSTATUS
  2705. OPGCURSORTYPE
  2706. LBLCURSORNAME
  2707. CAPTION
  2708. CMDCREATEVIEW
  2709. ENABLED
  2710. CMDDROPVIEW    
  2711. CHKONVIEW
  2712. OENGINE
  2713. DATABASEISOPENED
  2714. CMDOPEN
  2715. CHKEXCL    
  2716. CMDUPSIZE
  2717. CMDRESET
  2718. employee
  2719. employee
  2720. OPEN  EXCLUSIVE
  2721. OPEN  SHARED
  2722. NOT  OPEN
  2723. emp_view_local
  2724. emp_view_remote6
  2725. offlinepath
  2726. ONLINE
  2727. OFFLINE
  2728. OPEN  EXCLUSIVE
  2729. OPEN  SHARED
  2730. NOT  OPEN
  2731. Status: 
  2732. LCSTATUS
  2733. LCVIEW
  2734. OENGINE
  2735. SETERROROFF
  2736. HADERROR
  2737. PAGEFRAME1
  2738. PAGE1
  2739. OPGCURSORTYPE
  2740. VALUE
  2741. ONLINESTATUS    
  2742. LBLSTATUS
  2743. CAPTION
  2744. emp_view_local
  2745. emp_view_remote6
  2746. create
  2747. LCMODE
  2748. LCVIEW
  2749. OENGINE
  2750. SETERROROFF
  2751. HADERROR
  2752. PAGEFRAME1
  2753. PAGE1
  2754. OPGCURSORTYPE
  2755. VALUE
  2756. REFRESHSTATUS
  2757. m.oEngineb
  2758. AERRARRAY
  2759. OENGINE
  2760. refreshstatus,
  2761. getstatus
  2762. offline]
  2763. QueryUnload
  2764. Destroy
  2765. Activate
  2766. Buffering
  2767. SourceType
  2768. Conflicts on row:  CC
  2769. LNSTARTROW
  2770. LNROW
  2771. LCEMPLOYEE
  2772. LCUSERFIELD
  2773. AUSERVALUES
  2774. LNBUFFERING
  2775. NCURSORTYPE
  2776. OENGINE
  2777. CURSORALIAS
  2778. ROWCONFLICT
  2779. CMDCLOSE
  2780. CLICK
  2781. LBLCONFLICTS
  2782. CAPTION
  2783. CONFLICTALIAS
  2784. AEMPLOYEE
  2785. GRDCONFLICTS
  2786. REFRESH
  2787. Informations about conflict resolution.
  2788. conflicts
  2789. ATMPEMP
  2790. THIS    
  2791. AEMPLOYEE
  2792. EDTCONFLICTSINFO
  2793. VALUE
  2794. OENGINE
  2795. CURRENTPAGE
  2796. LCEMPLOYEE
  2797. CURSORALIAS
  2798. CONFLICTALIAS
  2799. GRDCONFLICTS
  2800. RECORDSOURCE
  2801. THISFORM
  2802. next,
  2803. #PROCEDURE refreshstatus
  2804. LOCAL llOffline
  2805. this.pageframe1.page1.edtCursorInfo.value = CS_CURSOR_INFO_LOC
  2806. this.getStatus
  2807. *refresh status for all three type of cursors
  2808. DO CASE
  2809.     CASE this.pageframe1.page1.opgCursorType.value = 1
  2810.         * refresh table info
  2811.         this.pageframe1.page1.lblCursorName.caption = CS_STATTBL_LOC + UPPER(CS_TABLE)
  2812.         this.pageframe1.page1.cmdCreateView.Enabled = .F.
  2813.         this.pageframe1.page1.cmdDropView.Enabled = .F.
  2814.         this.pageframe1.page1.chkOnView.Enabled = .F.
  2815.         IF oEngine.DatabaseIsOpened AND INDBC(CS_TABLE,'TABLE')
  2816.             this.pageframe1.page1.cmdOpen.Enabled = .T.
  2817.             this.pageframe1.page1.chkExcl.Enabled = .T.
  2818.             this.pageframe1.page1.cmdUpsize.Enabled = INDBC(CS_CONNECTION,'CONNECTION')
  2819.             this.pageframe1.page1.cmdReset.Enabled = INDBC(CS_INITIALTABLE,'TABLE')
  2820.         ELSE
  2821.             this.pageframe1.page1.cmdOpen.Enabled = .F.
  2822.             this.pageframe1.page1.chkExcl.Enabled = .F.
  2823.             this.pageframe1.page1.cmdUpsize.Enabled = .F.
  2824.             this.pageframe1.page1.cmdReset.Enabled = .F.
  2825.         ENDIF
  2826.     CASE this.pageframe1.page1.opgCursorType.value = 2 
  2827.         * refresh local view info
  2828.         this.pageframe1.page1.lblCursorName.caption = CS_STATLV_LOC + UPPER(CS_LOCAL_VIEW)
  2829.         this.pageframe1.page1.cmdUpsize.Enabled = .F.
  2830.         this.pageframe1.page1.cmdReset.Enabled = .F.
  2831.         IF oEngine.DatabaseIsOpened AND INDBC(CS_LOCAL_VIEW,'VIEW')
  2832.             this.pageframe1.page1.cmdOpen.Enabled = .T.
  2833.             this.pageframe1.page1.chkExcl.Enabled = .T.
  2834.             llOffline = !EMPTY(DBGETPROP(CS_LOCAL_VIEW, 'view', 'offlinepath'))
  2835.             this.pageframe1.page1.cmdCreateView.Enabled = !llOffline
  2836.             this.pageframe1.page1.cmdDropView.Enabled = llOffline
  2837.             this.pageframe1.page1.chkOnView.Enabled = llOffline
  2838.         ELSE
  2839.             this.pageframe1.page1.cmdOpen.Enabled = .F.
  2840.             this.pageframe1.page1.chkExcl.Enabled = .F.
  2841.             this.pageframe1.page1.cmdCreateView.Enabled = .F.
  2842.             this.pageframe1.page1.cmdDropView.Enabled = .F.
  2843.             this.pageframe1.page1.chkOnView.Enabled = .F.
  2844.         ENDIF
  2845.     CASE this.pageframe1.page1.opgCursorType.value = 3
  2846.         * refresh remote view info
  2847.         this.pageframe1.page1.lblCursorName.caption = CS_STATRV_LOC  + UPPER(CS_REMOTE_VIEW)
  2848.         this.pageframe1.page1.cmdUpsize.Enabled = .F.
  2849.         this.pageframe1.page1.cmdReset.Enabled = .F.
  2850.         IF oEngine.DatabaseIsOpened AND INDBC(CS_REMOTE_VIEW, 'VIEW') AND INDBC(CS_CONNECTION, 'CONNECTION')
  2851.             this.pageframe1.page1.cmdOpen.Enabled = .T.
  2852.             this.pageframe1.page1.chkExcl.Enabled = .T.
  2853.             llOffline = !EMPTY(DBGETPROP(CS_REMOTE_VIEW, 'view', 'offlinepath'))
  2854.             this.pageframe1.page1.cmdCreateView.Enabled = !llOffline
  2855.             this.pageframe1.page1.cmdDropView.Enabled = llOffline
  2856.             this.pageframe1.page1.chkOnView.Enabled = llOffline
  2857.         ELSE
  2858.             this.pageframe1.page1.cmdOpen.Enabled = .F.
  2859.             this.pageframe1.page1.chkExcl.Enabled = .F.
  2860.             this.pageframe1.page1.cmdCreateView.Enabled = .F.
  2861.             this.pageframe1.page1.cmdDropView.Enabled = .F.
  2862.             this.pageframe1.page1.chkOnView.Enabled = .F.
  2863.         ENDIF
  2864. ENDCASE
  2865. ENDPROC
  2866. PROCEDURE getstatus
  2867. LOCAL lcStatus, lcView
  2868. lcStatus = ""
  2869. oEngine.SetErrorOff = .T.
  2870. oEngine.HadError = .F.
  2871. IF this.pageframe1.page1.opgCursorType.value = 1
  2872.     * Table
  2873.     USE CS_TABLE EXCLUSIVE
  2874.     IF oEngine.HadError
  2875.         oEngine.HadError = .F.
  2876.         USE CS_TABLE SHARED
  2877.         IF oEngine.HadError
  2878.             lcStatus = CS_STATOPENEX_LOC 
  2879.         ELSE
  2880.             lcStatus = CS_STATOPENSH_LOC 
  2881.         ENDIF
  2882.     ELSE
  2883.         lcStatus = CS_STATNOOPEN_LOC 
  2884.     ENDIF
  2885.     * View (local and remote)
  2886.     lcView = IIF(this.pageframe1.page1.opgCursorType.value = 2, CS_LOCAL_VIEW, CS_REMOTE_VIEW)
  2887.     IF EMPTY(DBGETPROP(lcView, 'view', 'offlinepath'))
  2888.         lcStatus = CS_STATONLINE_LOC
  2889.         oEngine.OnlineStatus = lcStatus
  2890.     ELSE
  2891.         lcStatus = CS_STATOFFLINE_LOC
  2892.         oEngine.OnlineStatus = lcStatus
  2893.         USE (lcView) EXCLUSIVE
  2894.         IF oEngine.HadError
  2895.             oEngine.HadError = .F.
  2896.             USE (lcView) SHARED
  2897.             IF oEngine.HadError
  2898.                 lcStatus = m.lcStatus + ", " + CS_STATOPENEX_LOC 
  2899.             ELSE
  2900.                 lcStatus = m.lcStatus + ", " + CS_STATOPENSH_LOC 
  2901.             ENDIF
  2902.         ELSE
  2903.         lcStatus = m.lcStatus + ", " + CS_STATNOOPEN_LOC 
  2904.         ENDIF
  2905.         USE
  2906.     ENDIF
  2907. ENDIF
  2908. oEngine.SetErrorOff = .F.
  2909. this.pageframe1.page1.lblStatus.caption = CS_STATUS_LOC  + m.lcStatus
  2910. ENDPROC
  2911. PROCEDURE offline
  2912. PARAMETERS lcMode
  2913. LOCAL lcView
  2914. oEngine.SetErrorOff = .T.
  2915. oEngine.HadError = .F.
  2916. lcView = IIF(this.pageframe1.page1.opgCursorType.value = 2, CS_LOCAL_VIEW, CS_REMOTE_VIEW)
  2917. IF lcMode = "create"
  2918.     =createoffline(lcView)
  2919.     =dropoffline(lcView)
  2920. ENDIF
  2921. IF oEngine.HadError
  2922.     oEngine.HadError = .F.
  2923. ENDIF
  2924. oEngine.SetErrorOff = .F.
  2925. this.RefreshStatus
  2926. ENDPROC
  2927. PROCEDURE QueryUnload
  2928. CLEAR EVENTS
  2929. ENDPROC
  2930. PROCEDURE Destroy
  2931. CLEAR EVENTS
  2932. ENDPROC
  2933. PROCEDURE Activate
  2934. READ EVENTS
  2935. ENDPROC
  2936. PROCEDURE Load
  2937. PUBLIC aErrArray
  2938. DIMENSION aErrArray[5]
  2939. IF TYPE("m.oEngine") # "O" OR ISNULL(m.oEngine)
  2940.     RETURN .F.
  2941. ENDIF
  2942. *set multilocks on for buffering
  2943. SET MULTILOCK ON
  2944. ENDPROC
  2945. classlibv
  2946. procedurev
  2947. sample
  2948. csprocs
  2949. csengine
  2950. oEngineb
  2951. OpenDBC
  2952. oStartFormb
  2953. sampleapp
  2954. oCSAppb
  2955. CCLASSLIB    
  2956. CSAVEPROC
  2957. CCSDIR
  2958. OENGINE
  2959. OCSAPP
  2960. SAMPLE
  2961. CSPROCS
  2962. RESETENV
  2963. OSTARTFORM
  2964. START
  2965. SET CLASSLIB TO &cClassLib
  2966. CONNECTION DESIGNER - emp_connection
  2967. CONNECTION DESIGNER - emp_connection
  2968. SET PROCEDURE TO &cSaveProc 
  2969. OCSAPP
  2970. OENGINE    
  2971. CCLASSLIB    
  2972. CSAVEPROC
  2973. resetenv1
  2974. Bizrules.Salaryrule
  2975. /N BIZRULES.EXE /RegServer
  2976. Bizrules.Salaryrule
  2977. OSERVER
  2978. SERVERISSTARTED
  2979. OSERVER-
  2980. this.oServerb
  2981. OSERVER
  2982. Business Rule Violation Error
  2983. LLRETURN
  2984. LCERROR
  2985. CTITLE
  2986. NSALARY
  2987. DBIRTH
  2988. DHIRE
  2989. CCOUNTRY
  2990. TITLE
  2991. SALARY
  2992. BIRTH_DATE    
  2993. HIRE_DATE
  2994. COUNTRY
  2995. OSERVER
  2996. VALIDATE
  2997. ALERT
  2998. CLEANUP
  2999. SETUP
  3000. TALKv
  3001. escape
  3002. escapev
  3003. compatiblev
  3004. exclusivev
  3005. message
  3006. safetyv
  3007. pathv
  3008. fieldsv
  3009. fields
  3010. error
  3011. pointv
  3012. deletedv
  3013. databasev
  3014. exactv
  3015. echov
  3016. memowidthv
  3017. udfparmsv
  3018. nearv
  3019. uniquev
  3020. ansiv
  3021. carryv
  3022. cpdialogv
  3023. status barv
  3024. m.cCSDirb
  3025. datev
  3026. oEngine.Help
  3027. oEngine.Error
  3028. AENVIRONMENT
  3029. CCSDIR
  3030. JUSTPATH
  3031. set compatible &aEnvironment[4,1]
  3032. set exclusive &aEnvironment[7,1]
  3033. set message to [&aEnvironment[8,1]]
  3034. set safety &aEnvironment[9,1]
  3035. set path to &aEnvironment[10, 1]
  3036. set fields &aEnvironment[12,1]
  3037. set fields &aEnvironment[13,1]
  3038. on error &aEnvironment[14,1]
  3039. set point to "&aEnvironment[15,1]"
  3040. set deleted &aEnvironment[16,1]
  3041. set database to &aEnvironment[18,1]
  3042. set exact &aEnvironment[19,1]
  3043. set echo &aEnvironment[20,1]
  3044. set udfparms to &aEnvironment[22,1]
  3045. set near &aEnvironment[23,1]
  3046. set unique &aEnvironment[24,1]
  3047. set ansi &aEnvironment[25,1]
  3048. set carry &aEnvironment[26,1]
  3049. set cpdialog &aEnvironment[27,1]
  3050. set status bar &aEnvironment[28,1]
  3051. set date to &aEnvironment[30,1]
  3052. set escape &aEnvironment[3,1]
  3053. on escape &aEnvironment[2,1]
  3054. set talk &aEnvironment[1,1]
  3055. AENVIRONMENT
  3056. m.oObjectb
  3057. RETRY
  3058. &cAction
  3059. IGNORE
  3060. NERROR
  3061. CMETHOD
  3062. NLINE
  3063. OOBJECT
  3064. CMESSAGE
  3065. CACTION
  3066. HADERROR
  3067. IERROR
  3068. SETERROROFF
  3069. ALERT!
  3070. m.cMessage = [&cMessage]
  3071. Microsoft Visual FoxPro
  3072. CANCEL
  3073. ABORT
  3074. RETRY
  3075. IGNORE
  3076. CMESSAGE
  3077. COPTIONS
  3078. CTITLE
  3079. CPARAMETER1
  3080. CPARAMETER2    
  3081. CRESPONSE
  3082. _screen.ActiveFormb
  3083. _screen.ActiveForm.HelpContextIDb
  3084. ACTIVEFORM
  3085. HELPCONTEXTID
  3086. IHELPCONTEXTID
  3087. Windows 3C
  3088. Windows NTC
  3089. NCURRENTOS
  3090. FILNAME
  3091. CDIRSEP
  3092. FILNAME
  3093. PNAME
  3094. JUSTPATH    
  3095. JUSTFNAME
  3096. ADDBS
  3097. FILNAME
  3098. CLOCALFNAME
  3099. CDIRSEP
  3100. PATHNAME    
  3101. SEPARATOR
  3102. FILNAME
  3103. FILNAME
  3104. THIS    
  3105. JUSTFNAME
  3106. m.cDBCb
  3107. ADBCTMP
  3108. CGETDBC
  3109. select uid from sysobjects where uid = user_id() and name =
  3110. LCTABLENAME
  3111. DUMMY
  3112. LCSQUOTE
  3113. LCSQL
  3114. LCFIELD
  3115. EXECUTETEMPSPT:
  3116. lcReturnValue=&lcCursor..&lcFieldName
  3117. LCSQL
  3118. LCRETURNVALUE
  3119. LCFIELDNAME
  3120. LLRETURNEDONEVALUE
  3121. LCMSG
  3122. LCERRMSG
  3123. LLRETVAL
  3124. LCCURSOR    
  3125. LNOLDAREA
  3126. LNSERVERERROR
  3127. UNIQUECURSORNAME
  3128. EXECUTETEMPSPT
  3129. QUERY_FAILURE_LOC
  3130. ICON_EXCLAMATION
  3131. TITLE_TEXT_LOC
  3132. drop table C
  3133. LCTABLE
  3134. LCSQL
  3135. USERNAME
  3136. LNRETVAL
  3137. EXECUTETEMPSPTl
  3138. Upsizing cannot continue because a connection error occurred
  3139. LCSQL
  3140. LNSERVERERROR
  3141. LCERRMSG
  3142. LCCURSOR
  3143. NRETVAL
  3144. LCMSG
  3145. MASTERCONNHAND    
  3146. AERRARRAY
  3147. LNSERVERERR
  3148. ICON_EXCLAMATION
  3149. TITLE_TEXT_LOC
  3150. ServerStart,
  3151. ServerStop
  3152. ServerIsStarted%
  3153. ServerValidateRowe
  3154. Destroy
  3155. Setup+
  3156. Cleanup
  3157. ErrorW
  3158. Alertf
  3159. GetOS
  3160. JustPath
  3161. ForceExt
  3162. JustFname(
  3163. AddBS(
  3164. JustStem
  3165. justext
  3166. GetDbcAliast
  3167. TableExists
  3168. SingleValueSPTw
  3169. DropTable
  3170. ExecuteTempSPT&
  3171. cs.dbc
  3172. START
  3173. IHELPCONTEXTID
  3174. CDBCNAME    
  3175. CDBCALIAS    
  3176. CDBCTABLE
  3177. SETERROROFF
  3178. HADERROR
  3179. IERROR
  3180. CMESSAGE
  3181. THERMREF
  3182. NCURRENTOS
  3183. OSERVER
  3184. DATABASENAME
  3185. DATABASEFILE
  3186. DATABASEISOPENED
  3187. SHOWOPENDATABASE
  3188. CURSORALIAS
  3189. CURSORTYPE
  3190. ROWCONFLICT
  3191. CONFLICTALIAS
  3192. CURRENTPAGE
  3193. ONLINESTATUS
  3194. AENVIRONMENT
  3195. CSEngine
  3196. custom
  3197. DDDDDDDDDDDDDDDDDDDDDDDDD
  3198. DDDDDDDDDDDDDDDDDDDDDDDDDK
  3199. DDDDDDDDDDDDDDDDDDDDDDDK
  3200. DDDDDDDDDDDDDDDDDDDDDDDDDK
  3201. TIMESTAMP
  3202. OUTFILE
  3203. HOMEDIR
  3204. EXCLUDE
  3205. MAINPROG
  3206. SAVECODE
  3207. DEBUG
  3208. ENCRYPT
  3209. NOLOGO
  3210. CMNTSTYLE
  3211. OBJREV
  3212. DEVINFO
  3213. SYMBOLS
  3214. OBJECT
  3215. CKVAL
  3216. OSTYPE
  3217. OSCREATOR
  3218. COMMENTS
  3219. RESERVED1
  3220. RESERVED2
  3221. SCCDATA
  3222. LOCAL
  3223. H           555050546    
  3224.   TTFF1  260
  3225.                    
  3226.  SAMPLE                          
  3227. V 548498288 555050546
  3228. F        543
  3229.  59221 1252        
  3230. TSAMPLE                          
  3231. P 548624043 555047313
  3232. FT  F    543
  3233.  28342 1252        
  3234. TCSMAIN                          
  3235. P 548631440 555047313
  3236. FF  F    543
  3237.   4931 1252        
  3238. TCSDEFS                          
  3239. P 549808336 555047314
  3240. FF  F    543B
  3241.  44377 1252        
  3242. TCSPROCS                         
  3243. x 550076762 555047317
  3244. F           
  3245.  28289 1252        
  3246. TTABLE                           
  3247. x 550076762 555050545
  3248. F           
  3249.  38773 1252        
  3250. TSAMPLE                          
  3251. x 550076762 555047315
  3252. F           
  3253.  48890 1252        
  3254. TLVIEW                           
  3255. x 550076762 555047315
  3256. F           
  3257.  37493 1252        
  3258. TRVIEW                           
  3259. x 550076762 555047315
  3260. F           
  3261.  39228 1252        
  3262. TRVIEW                           
  3263. x 550540681 555047317
  3264. F           
  3265.  26056 1252        
  3266. TTABLE                           
  3267. x 550540681 555047315
  3268. F           
  3269.  46515 1252        
  3270. TLVIEW                           
  3271. DDDDDDDDDDDDDDDDDDDDD@
  3272. DDDDDDDDDDDDDDDDDDDDD@
  3273. DDDDDDDDDDDDDDDDDDDDD@
  3274. DDDDDDDDDDDDDDDDDDDDDO
  3275. wwwwwwwwwwwp
  3276. wwwwwwwp
  3277. DDDDDD
  3278. DDDDDD
  3279. wwwwwwwp
  3280. DDDDDD
  3281. DDDDDD
  3282. wwwwwwwp
  3283. wwwwwwwp
  3284. DDDDDD
  3285. DDDDDD
  3286. wwwwwwwwwwwwwwwwwwwwwwwww
  3287. wwwwww
  3288. wwwwwww
  3289. wwwwwww
  3290. wwwwww
  3291. wwwwwww
  3292. wwwwwww
  3293. wwwwwwwwwwwwwwwwwwwwwwwwp
  3294. wwwwwww
  3295. wwwwww
  3296. wwwwwwwp
  3297. wwwwwww
  3298. wwwwww
  3299. wwwwwwwp
  3300. wwwwwwwwwwwwwwwwwwwwwwwwp
  3301. wwwwwww
  3302. wwwwww
  3303. wwwwwwwp
  3304. wwwwwww
  3305. wwwwww
  3306. wwwwwwwp
  3307. sample.vcx
  3308. sample.vct
  3309. csmain.prg
  3310. d:\temp\
  3311. csmain.fxp
  3312. csdefs.h
  3313. csdefs.fxp
  3314. csprocs.prg
  3315. csprocs.fxp
  3316. table.bmp
  3317. sample.pjx
  3318. lview.msk
  3319. rview.bmp
  3320. rview.msk
  3321. table.msk
  3322. lview.bmp
  3323.