Content Supported by Sourcelens Consulting

(VERSION =   3.00csdefs.h��lI$!Arial, 0, 9, 5, 15, 12, 13, 3, 0
opendbccsdefs.hPixelsClass19formopendbc�BorderStyle = 0
Enabled = .F.
Height = 47
Left = 24
ScrollBars = 0
SpecialEffect = 1
TabIndex = 15
Top = 240
Width = 420
DisabledForeColor = 0,0,0
Name = "edtDatabaseInfo2"
opendbcedtDatabaseInfo2editboxeditboxopendbcLabel3csdefs.h��lI$!Arial, 0, 9, 5, 15, 12, 13, 3, 0
	sampleappcsdefs.hPixelsClass78form	sampleappkCaption = "label"
Height = 17
Left = 10
Top = 58
Width = 396
TabIndex = 18
Name = "lblCursorActive"
46labellabellabelsampleapp.Pageframe1.Page2lblCursorActivelabellabel�BorderStyle = 0
Enabled = .F.
Height = 49
Left = 9
ScrollBars = 0
SpecialEffect = 1
TabIndex = 17
Top = 14
Width = 566
DisabledForeColor = 0,0,0
Name = "edtFunctionsInfo"
sampleapp.Pageframe1.Page2edtFunctionsInfoeditboxeditboxmCaption = "Update Options:"
Height = 17
Left = 373
Top = 269
Width = 88
TabIndex = 16
Name = "Label3"
sampleapp.Pageframe1.Page2Label3labellabelkCaption = "Update Scope:"
Height = 18
Left = 219
Top = 269
Width = 84
TabIndex = 15
Name = "Label2"
sampleapp.Pageframe1.Page2Label2labellabelgCaption = "Buffering:"
Height = 17
Left = 28
Top = 270
Width = 54
TabIndex = 14
Name = "Label1"
sampleapp.Pageframe1.Page2Label1labellabelText1opendbcedtDatabaseInfo1���� ���%%CXR�U$I��	s*���UClick,��11$)����� ���%%CXR�U$I��	s*���UClick,��11$)�/PROCEDURE Click
HELP ID HELP_SAMPLE
ENDPROC
sampleapp.Pageframe1.Page2cmdHelp
commandbutton
commandbuttonText1editboxeditboxlabel���� ���%%CXR�U$I��	s*���UClick,��11%)�iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
headerheadereTop = 312
Left = 518
Height = 27
Width = 84
Caption = "\<Help"
TabIndex = 12
Name = "cmdHelp"
H��� //��%����UW%�C��
���
�����.�
�����"T���CC������6��UOENGINESERVERISSTARTEDSERVERSTART
SERVERSTOPTHISVALUEClick,��1"���A!2�)/chkRulesgrid_Caption = "3."
Height = 15
Left = 30
Top = 223
Width = 12
TabIndex = 14
Name = "Label3"
�BorderStyle = 0
Enabled = .F.
Height = 40
Left = 24
ScrollBars = 0
SpecialEffect = 1
TabIndex = 13
Top = 134
Width = 420
DisabledForeColor = 0,0,0
Name = "edtDatabaseInfo1"
opendbcLabel2opendbcLabel1labellabelopendbccheckbox_Caption = "2."
Height = 15
Left = 30
Top = 120
Width = 12
TabIndex = 12
Name = "Label2"
�FontName = "MS Sans Serif"
FontSize = 8
Caption = "1."
Height = 15
Left = 30
Top = 6
Width = 12
TabIndex = 11
Name = "Label1"
0PROCEDURE Click
HELP ID HELP_OPENDBC
ENDPROC
Command1opendbc�PROCEDURE Click
* start/stop the middle-tire server
IF !oEngine.ServerIsStarted()
	oEngine.ServerStart
ELSE
	oEngine.ServerStop
ENDIF
this.value = IIF(oEngine.ServerIsStarted(), 1, 0)

ENDPROC
sampleapp.Pageframe1.Page2Header1checkboxsampleapp.Pageframe1.Page2dTop = 330
Left = 12
Height = 24
Width = 84
Caption = "\<Help"
TabIndex = 4
Name = "Command1"
Top = 358
Left = 373
Height = 17
Width = 110
Alignment = 0
Caption = "\<Business Rules"
TabIndex = 6
Name = "chkRules"
chkConflictscheckboxcheckboxText1���� ��6v%Xmg�UT������ULFORCETHISVALUEClick,��11$)�Text1textboxText1wTop = 327
Left = 373
Height = 17
Width = 114
Caption = "Re\<solve Conflicts"
TabIndex = 5
Name = "chkConflicts"
/PROCEDURE Click
lForce = this.value
ENDPROC
sampleapp.Pageframe1.Page2chkForcecheckboxtextbox
commandbutton
commandbuttonfTop = 296
Left = 373
Height = 17
Width = 60
Caption = "\<Force"
TabIndex = 4
Name = "chkForce"
checkboxsampleapp.Pageframe1.Page2	opgUpdateoptiongroup	cmdCancel���� ��t%n���UT��������UOENGINEROWCONFLICTTHISVALUEInteractiveChange,��1�1�)����� ��Q%Vke�U

����UTHISFORM
REFRESHSTATUSClick,��1�1')��PROCEDURE InteractiveChange
* test a single row conflict for Row and Table updates
* test all table conflicts for Table All updates
oEngine.RowConflict = (this.value <> 3)
ENDPROC
optiongroupiTop = 185
Left = 518
Height = 27
Width = 84
Caption = "\<Revert"
TabIndex = 10
Name = "cmdRevert"
sampleapp.Pageframe1.Page2	cmdRevert
commandbutton
commandbuttonsampleapp.Pageframe1.Page2	cmdUpdate
commandbutton
commandbuttongrid
commandbutton���� ��8�%e|t�U�������UTHISPARENTGRID1REFRESHClick,��1A12)�conflicts.grdConflicts.Column10Header1textboxtextbox	cmdRevert	conflictsgrid
commandbuttonText1iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
textbox���� ���%p�
�U�����T���������T���-��T���a��T��C����%���������C��	�
��x��
T������T���-��&R,�����CC�Z�� rows reverted��ULLREVERTTYPELNROWSTHISPARENT	OPGUPDATEVALUEOENGINEHADERRORSETERROROFFCMESSAGEICON_EXCLAMATION
CS_TITLE_TEXTClick,��1����Q�A�c1�)�	opgBuffer,PROCEDURE Click
RELEASE THISFORM
ENDPROC

commandbuttonopendbc	cmdBrowse
commandbuttonopendbchTop = 155
Left = 518
Height = 27
Width = 84
Caption = "\<Update"
TabIndex = 9
Name = "cmdUpdate"
sampleapp.Pageframe1.Page2optiongroupoptiongroupgTop = 368
Left = 517
Height = 27
Width = 84
Caption = "\<Close"
TabIndex = 13
Name = "cmdClose"
sampleapp.Pageframe1.Page2textbox��� ���1%l�{�U�%�C�����N�
F�����%�C�	Buffering����F�
��Ca����Q��%��������%�C�employee�����F��employee��Q���T������T������T���a��T�������T���-��UOENGINECURSORALIAS
CURSORTYPETHISFORM
LOCKSCREEN
PAGEFRAME1
ACTIVEPAGEClick,��1"���AAABrAAA�1�2�)�cmdClose
commandbutton
commandbuttontTop = 330
Left = 371
Height = 24
Width = 84
Cancel = .T.
Caption = "Cancel"
TabIndex = 3
Name = "cmdCancel"

commandbuttontxtDatabaseFiletextbox
cmdRequerydTop = 82
Left = 408
Height = 25
Width = 27
Caption = ". . ."
TabIndex = 5
Name = "cmdBrowse"
opendbccmdOKsampleapp.Pageframe1.Page2formCPROCEDURE Click
RELEASE THISFORM
oEngine.Start = .T.

ENDPROC

commandbutton
commandbuttonShape2�PROCEDURE Click
LOCAL llRevertType, lnRows 

llRevertType = (this.parent.opgUpdate.value <> 1)

oEngine.HadError = .F.
oEngine.SetErrorOff = .T.
lnRows = TABLEREVERT(llRevertType)
IF oEngine.HadError
	=MESSAGEBOX(Oengine.cMessage, ICON_EXCLAMATION, CS_TITLE_TEXT)
	lnRows = 0
ENDIF
oEngine.SetErrorOff = .F.

* no conflicts
wait window ALLTRIM(STR(lnRows)) + WAIT_REVERT2_LOC timeout CS_TIMEOUT
ENDPROC
kTop = 232
Left = 518
Height = 27
Width = 84
Caption = "Re\<query"
TabIndex = 11
Name = "cmdRequery"
���� ��;%DYS�U
<��UTHISFORMClick,��1q1!)�^Top = 330
Left = 275
Height = 24
Width = 84
Caption = "OK"
TabIndex = 2
Name = "cmdOK"
opendbcedtDatabaseInfoeditboxeditbox���� ����%Zoi�U��C�drop����UTHISFORMOFFLINEClick,��1A1))�Text1conflicts.grdConflicts.Column11
commandbuttonconflicts.grdConflicts.Column14conflicts.grdConflicts.Column15header
commandbutton
commandbutton	cmdDeleteopendbccmdOpenDatabase
commandbutton
commandbuttonopendbcshapev��� ]]��%���U�T���-��T���a��T��C�	Buffering�����%�����
����T���C�	Buffering���T���a����C����x���T��	�
�����
��T��	������
��T��	�
�����
��"T��	�
������
��"T��	�
������
��"T��	�
������
��T��	������
��T��	������
��T��	������
��T���-��UOENGINEHADERRORSETERROROFFLLRESULTTHISVALUECS_ERR_SET_BUFFERINGICON_EXCLAMATION
CS_TITLE_TEXTPARENT	CMDUPDATEENABLED	CMDREVERT	OPGUPDATEOPTION1OPTION2OPTION3CHKFORCECHKCONFLICTSCHKRULESInteractiveChange,��1������!A���!!!����2�)]=PROCEDURE Click
delete
this.parent.grid1.refresh
ENDPROC
textboxcmdCloseDatabase
commandbutton
commandbuttonopendbccmdModifyConnectiona��� HH�w%����U�	��
��T�
�������T�
��C���
H�5�����
����i�!R,������Requery succeeded����
������R,������Requery failed���UNRESULTClick,��1���11�A2)HiBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"

commandbuttonlabeltextbox�ControlSource = "OEngine.DatabaseFile"
Enabled = .F.
Height = 23
Left = 25
TabIndex = 6
Top = 82
Width = 347
DisabledForeColor = 0,0,0
Name = "txtDatabaseFile"
fButtonCount = 3
BackStyle = 0
BorderStyle = 0
Value = 1
Height = 73
Left = 213
Top = 287
Width = 120
TabIndex = 3
Name = "opgUpdate"
Option1.Caption = "Row Update"
Option1.Value = 1
Option1.Height = 17
Option1.Left = 5
Option1.Top = 5
Option1.Width = 103
Option1.Name = "Option1"
Option2.Caption = "Table Update"
Option2.Value = 0
Option2.Height = 17
Option2.Left = 5
Option2.Top = 24
Option2.Width = 91
Option2.Name = "Option2"
Option3.Caption = "Table Update All"
Option3.Value = 0
Option3.Height = 17
Option3.Left = 5
Option3.Top = 43
Option3.Width = 110
Option3.Name = "Option3"
���� ����%f}u�U�������UTHISPARENTGRID1REFRESHClick,��1Q18)�
commandbuttoncmdCloseconflicts.grdConflicts.Column1Header1conflicts.grdConflicts.Column10sampleapp.Pageframe1.Page2
commandbuttonheaderHeader1|AutoSize = .F.
Top = 187
Left = 132
Height = 24
Width = 84
Caption = "\<Open"
TabIndex = 1
Name = "cmdOpenDatabase"

commandbutton
commandbuttonPROCEDURE Click
LOCAL m.nResult

m.nResult = -2			&& to detect error events
m.nResult = REQUERY()

DO CASE
CASE m.nResult == 1
	wait window WAIT_REQUERYOK_LOC timeout CS_TIMEOUT
CASE m.nResult == 0
	wait window WAIT_REQUERYFAIL_LOC timeout CS_TIMEOUT
ENDCASE

ENDPROC

commandbuttonsampleapp.Pageframe1.Page2	cmdInsert
commandbutton%Caption = "Photo"
Name = "Header1"
Header1textboxCPROCEDURE Click
append blank
this.parent.grid1.refresh
ENDPROC
Text1opendbcchkExclDatabasecheckboxcheckbox�PROCEDURE Click
* revert modified rows 
IF USED(oEngine.CursorAlias)
	SELECT (oEngine.CursorAlias)
	IF CURSORGETPROP('Buffering') > 1
		=TABLEREVERT(.T.)
	ENDIF
	USE
ENDIF

IF oEngine.CursorType = LOCAL_VIEW_CURSOR
	* Check if using offline
	IF USED(CS_TABLE)
		SELECT CS_TABLE
		USE
	ENDIF
ENDIF

* clean up
oEngine.CursorAlias = ""
oEngine.CursorType = NO_CURSOR
thisform.lockscreen = .T.
thisform.pageframe1.ActivePage = 1
thisform.lockscreen = .F.

ENDPROC
���� ��Ҥ%\qk�U��C�create����UTHISFORMOFFLINEClick,��1a1+)�header
commandbutton)sampleapp.Pageframe1.Page2.Grid1.Column17headerheader�BorderStyle = 0
Enabled = .F.
Height = 50
Left = 24
ScrollBars = 0
SpecialEffect = 1
TabIndex = 10
Top = 20
Width = 420
DisabledForeColor = 0,0,0
Name = "edtDatabaseInfo"
��� ��Ɍ%A�(P�U"��������T������	���T�����
�	��%�C�����	����%�C��

��}�B����%�C�����	���
T�����T��C����+������	#����%�C��

����B��T��C�������T���-��T���a��T��C�����%�����r���C�����x��T��-���T���-��
%������ R,������Update succeeded����%�����	����T��C�	Conflicts�N��
������R,������
Update failed����ULNUPDATETYPELLFORCELLUPDATELNROW
LCEMPLOYEEFRMCONFLICTSTHISPARENT	OPGUPDATEVALUECHKFORCEOENGINESERVERISSTARTEDSERVERVALIDATEROWHADERRORSETERROROFFCMESSAGEICON_EXCLAMATION
CS_TITLE_TEXTCHKCONFLICTSSHOWClick,��1��a�!AA���!�!AAAAA��1Q�A���b����AA1�)�hTop = 110
Left = 517
Height = 27
Width = 84
Caption = "\<Delete"
TabIndex = 8
Name = "cmdDelete"
gTop = 80
Left = 518
Height = 27
Width = 84
Caption = "\<Insert"
TabIndex = 7
Name = "cmdInsert"
*Caption = "Reports_to"
Name = "Header1"
textboxopendbcform�PROCEDURE Click
LOCAL lnUpdateType, llForce, llUpdate, lnRow, lcEmployee, frmConflicts

lnUpdateType = this.parent.opgUpdate.value - 1
llForce = this.parent.chkForce.value

* check business rules on the middle tire server
* row update
IF oEngine.ServerIsStarted() AND lnUpdateType = 0
	IF !oEngine.ServerValidateRow()
		RETURN
	ENDIF
ELSE
	*table and table all updates
	IF oEngine.ServerIsStarted() AND lnUpdateType <> 0
		lnRow = 0
		lnRow = GetNextModified(lnRow)
		DO WHILE lnRow<>0
			GO lnRow 
			IF !oEngine.ServerValidateRow()
				RETURN
			ENDIF
			lnRow = GetNextModified(lnRow)
		ENDDO
	ENDIF			
ENDIF

oEngine.HadError = .F.
oEngine.SetErrorOff = .T.
llUpdate = TABLEUPDATE(lnUpdateType, llForce)

IF oEngine.HadError
	=MESSAGEBOX(Oengine.cMessage, ICON_EXCLAMATION, CS_TITLE_TEXT)
	llUpdate = .F.
ENDIF
oEngine.SetErrorOff = .F.

IF llUpdate
	* no conflicts
	wait window WAIT_UPDATEOK_LOC timeout CS_TIMEOUT
ELSE
	* update conflicts, handle conflicts resolution
	IF this.parent.chkConflicts.value
		frmConflicts = createobject('Conflicts')
		frmConflicts.show
	ELSE
		wait window WAIT_UPDATEFAIL2_LOC timeout CS_TIMEOUT
	ENDIF
ENDIF
ENDPROC
=��� $$�R%����U
���U	NCOLINDEX$�������CCE�0����UNERRORCMETHODNLINEOENGINEALERTAfterRowColChange,��ErrorE��1q2�!22N�)$;��� ""�;%����U_T��C�OpenDBC�N��)%�C�
oStartFormb�O�C�
����D�B��
����
����U
OSTARTFORMSHOWTHISFORM
REFRESHSTATUSClick,��1r�AA��2�)"���� ����%byq�U<��T���a��UTHISFORMOENGINESTARTClick,��1q�28)�formText1�PROCEDURE InteractiveChange
* the cursor should always be open in the current work area
oEngine.HadError = .F.
oEngine.SetErrorOff = .T.
llResult = CURSORSETPROP('Buffering', this.value)

IF oEngine.HadError OR !llResult THEN
	this.value = CURSORGETPROP('Buffering')
	oEngine.SetErrorOff = .T.
	=MESSAGEBOX(CS_ERR_SET_BUFFERING, ICON_EXCLAMATION, CS_TITLE_TEXT)
ENDIF

* disable update scope,update options, update and revert for no buffering
this.parent.cmdUpdate.enabled = !(this.value = 1)
this.parent.cmdRevert.enabled = !(this.value = 1)
this.parent.opgUpdate.enabled = !(this.value = 1)
this.parent.opgUpdate.option1.enabled = !(this.value = 1)
this.parent.opgUpdate.option2.enabled = !(this.value = 1)
this.parent.opgUpdate.option3.enabled = !(this.value = 1)
this.parent.chkForce.enabled = !(this.value = 1)
this.parent.chkConflicts.enabled = !(this.value = 1)
this.parent.chkRules.enabled = !(this.value = 1)

oEngine.SetErrorOff = .F.

ENDPROC
�ButtonCount = 5
BorderStyle = 0
Value = 1
Height = 98
Left = 22
Top = 287
Width = 156
TabIndex = 2
Name = "opgBuffer"
Option1.Caption = "None"
Option1.Value = 1
Option1.Height = 17
Option1.Left = 5
Option1.Top = 5
Option1.Width = 103
Option1.Name = "Option1"
Option2.Caption = "Pessimistic Row"
Option2.Value = 0
Option2.Height = 17
Option2.Left = 5
Option2.Top = 24
Option2.Width = 139
Option2.Name = "Option2"
Option3.Caption = "Optimistic Row"
Option3.Value = 0
Option3.Height = 17
Option3.Left = 5
Option3.Top = 43
Option3.Width = 139
Option3.Name = "Option3"
Option4.Caption = "Pessimistic Table"
Option4.Value = 0
Option4.Height = 17
Option4.Left = 5
Option4.Top = 62
Option4.Width = 145
Option4.Name = "Option4"
Option5.Caption = "Optimistic Table"
Option5.Value = 0
Option5.Height = 17
Option5.Left = 5
Option5.Top = 81
Option5.Width = 138
Option5.Name = "Option5"
���� ���%Mb\�U

����UTHISFORMNEXTClick,��1�1)�headerRBorderStyle = 0
Margin = 0
OpenWindow = .T.
ForeColor = 0,0,0
Name = "Text1"
)sampleapp.Pageframe1.Page2.Grid1.Column17RBorderStyle = 0
Margin = 0
OpenWindow = .T.
ForeColor = 0,0,0
Name = "Text1"
)sampleapp.Pageframe1.Page2.Grid1.Column16textbox%Caption = "Notes"
Name = "Header1"
)sampleapp.Pageframe1.Page2.Grid1.Column16Header1headerheaderRBorderStyle = 0
Margin = 0
OpenWindow = .T.
ForeColor = 0,0,0
Name = "Text1"
)sampleapp.Pageframe1.Page2.Grid1.Column15textboxtextbox%Caption = "Photo"
Name = "Header1"
)sampleapp.Pageframe1.Page2.Grid1.Column15Header1headerheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
)sampleapp.Pageframe1.Page2.Grid1.Column14textboxtextbox)Caption = "Extension"
Name = "Header1"
)sampleapp.Pageframe1.Page2.Grid1.Column14Header1headerheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
)sampleapp.Pageframe1.Page2.Grid1.Column13Text1textboxtextbox*Caption = "Home_phone"
Name = "Header1"
)sampleapp.Pageframe1.Page2.Grid1.Column13Header1headerheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
)sampleapp.Pageframe1.Page2.Grid1.Column12Text1textboxtextbox'Caption = "Country"
Name = "Header1"
)sampleapp.Pageframe1.Page2.Grid1.Column12Header1headerheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
)sampleapp.Pageframe1.Page2.Grid1.Column11Text1textboxtextbox*Caption = "Postalcode"
Name = "Header1"
)sampleapp.Pageframe1.Page2.Grid1.Column11Header1headerheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
)sampleapp.Pageframe1.Page2.Grid1.Column10Text1textboxtextbox&Caption = "Region"
Name = "Header1"
)sampleapp.Pageframe1.Page2.Grid1.Column10Header1headerconflicts.grdConflicts.Column15conflicts.grdConflicts.Column16textboxheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
(sampleapp.Pageframe1.Page2.Grid1.Column9Text1textboxtextbox$Caption = "City"
Name = "Header1"
(sampleapp.Pageframe1.Page2.Grid1.Column9Header1headerheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
(sampleapp.Pageframe1.Page2.Grid1.Column8Text1textboxtextboxHeader1shapeopendbcShape3shapeshapeopendbc'Caption = "Address"
Name = "Header1"
(sampleapp.Pageframe1.Page2.Grid1.Column8headerheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
(sampleapp.Pageframe1.Page2.Grid1.Column7Text1textboxtextbox)Caption = "Hire_date"
Name = "Header1"
~Top = 290
Left = 172
Height = 24
Width = 125
Caption = "\<Modify Connection"
TabIndex = 8
Name = "cmdModifyConnection"
(sampleapp.Pageframe1.Page2.Grid1.Column7Header1headerheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
(sampleapp.Pageframe1.Page2.Grid1.Column6Text1textboxtextbox*Caption = "Birth_date"
Name = "Header1"
(sampleapp.Pageframe1.Page2.Grid1.Column6Header1headerheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
(sampleapp.Pageframe1.Page2.Grid1.Column5Text1textboxtextbox&Caption = "Salary"
Name = "Header1"
(sampleapp.Pageframe1.Page2.Grid1.Column5Header1headerheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
(sampleapp.Pageframe1.Page2.Grid1.Column4Text1textboxtextbox%Caption = "Title"
Name = "Header1"
(sampleapp.Pageframe1.Page2.Grid1.Column4Header1headerheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
Text1grid�Height = 360
Width = 470
DoCreate = .T.
AutoCenter = .T.
BorderStyle = 2
Caption = "Open Database"
MaxButton = .F.
WindowType = 1
Name = "opendbc"
headerheader(sampleapp.Pageframe1.Page2.Grid1.Column3textboxtextbox*Caption = "First_name"
Name = "Header1"
(sampleapp.Pageframe1.Page2.Grid1.Column3Header1headerheader@BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
Name = "Text1"
(sampleapp.Pageframe1.Page2.Grid1.Column2Text1textboxtextbox)Caption = "Last_name"
Name = "Header1"
(sampleapp.Pageframe1.Page2.Grid1.Column2Header1headerheaderhBackStyle = 0
BorderStyle = 0
Margin = 0
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
(sampleapp.Pageframe1.Page2.Grid1.Column1Text1textboxtextbox&Caption = "Emp_id"
Name = "Header1"
(sampleapp.Pageframe1.Page2.Grid1.Column1Header1headerheader
��� ��\�%����U.%�C�����
�������<��UOENGINESERVERISSTARTED
SERVERSTOPTHISFORMClick,��1�ARq2�)�)Caption = "Last_name"
Name = "Header1"
�PROCEDURE AfterRowColChange
LPARAMETERS nColIndex
ENDPROC
PROCEDURE Error
LPARAMETERS nError, cMethod, nLine
oEngine.Alert(message(), MB_ICONEXCLAMATION + MB_OK)

ENDPROC
�ColumnCount = 17
Height = 179
Left = 10
RecordSource = ""
RecordSourceType = 1
TabIndex = 1
Top = 80
Width = 492
Name = "Grid1"
Column1.Width = 50
Column1.Name = "Column1"
Column2.Width = 80
Column2.Name = "Column2"
Column3.Width = 80
Column3.Name = "Column3"
Column4.Width = 120
Column4.Name = "Column4"
Column5.Width = 80
Column5.Name = "Column5"
Column6.Width = 80
Column6.Name = "Column6"
Column7.Width = 80
Column7.Name = "Column7"
Column8.Width = 180
Column8.Name = "Column8"
Column9.Width = 80
Column9.Name = "Column9"
Column10.Width = 80
Column10.Name = "Column10"
Column11.Width = 80
Column11.Name = "Column11"
Column12.Width = 75
Column12.Name = "Column12"
Column13.Width = 90
Column13.Name = "Column13"
Column14.Width = 55
Column14.Name = "Column14"
Column15.Width = 40
Column15.Name = "Column15"
Column16.Width = 40
Column16.Name = "Column16"
Column17.Width = 70
Column17.Name = "Column17"
sampleapp.Pageframe1.Page2Grid1UTop = 276
Left = 10
Height = 120
Width = 177
SpecialEffect = 0
Name = "Shape1"
sampleapp.Pageframe1.Page2Shape1shapeshapeVTop = 276
Left = 200
Height = 120
Width = 144
SpecialEffect = 0
Name = "Shape2"
sampleapp.Pageframe1.Page2Shape2shapeshapeVTop = 276
Left = 357
Height = 120
Width = 145
SpecialEffect = 0
Name = "Shape3"
sampleapp.Pageframe1.Page2Shape3shapeshape|AutoSize = .T.
Caption = "Offline Views:"
Height = 17
Left = 247
Top = 280
Width = 76
TabIndex = 17
Name = "Label1"
sampleapp.Pageframe1.Page1Label1labellabelsampleapp.Pageframe1.Page1cmdHelpeTop = 230
Left = 12
Height = 92
Width = 445
BorderStyle = 1
SpecialEffect = 0
Name = "Shape1"
%Caption = "Notes"
Name = "Header1"
conflicts.grdConflicts.Column16���� ���%%CXR�U$I��	s*���UClick,��11')�/PROCEDURE Click
HELP ID HELP_SAMPLE
ENDPROC
eTop = 381
Left = 22
Height = 24
Width = 126
Caption = "\<Help"
TabIndex = 11
Name = "cmdHelp"

commandbutton
commandbuttonZTop = 220
Left = 315
Height = 27
Width = 84
Caption = "\<Revert"
Name = "cmdRevert"
iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
Text12PROCEDURE Click
thisform.RefreshStatus
ENDPROC
=AutoSize = .F.
ButtonCount = 3
Value = 1
DragMode = 0
Enabled = .T.
Height = 134
Left = 82
SpecialEffect = 0
Top = 86
Width = 459
TabIndex = 1
Visible = .T.
Name = "opgCursorType"
Option1.Picture = table.bmp
Option1.Caption = "Table"
Option1.Value = 1
Option1.Height = 130
Option1.Left = 2
Option1.SpecialEffect = 0
Option1.Style = 1
Option1.Top = 2
Option1.Width = 150
Option1.Name = "Option1"
Option2.Picture = lview.bmp
Option2.Caption = "Local View"
Option2.Value = 0
Option2.Height = 130
Option2.Left = 154
Option2.Style = 1
Option2.Top = 2
Option2.Width = 150
Option2.Name = "Option2"
Option3.Picture = rview.bmp
Option3.Caption = "Remote View"
Option3.Value = 0
Option3.Height = 130
Option3.Left = 306
Option3.Style = 1
Option3.Top = 2
Option3.Width = 150
Option3.Name = "Option3"
sampleapp.Pageframe1.Page1
opgCursorTypeoptiongroupoptiongroupjCaption = "label"
Height = 17
Left = 58
Top = 256
Width = 240
TabIndex = 16
Name = "lblCursorName"
sampleapp.Pageframe1.Page1
lblCursorNamelabellabelpTop = 381
Left = 334
Height = 24
Width = 126
Caption = "\<Database..."
TabIndex = 9
Name = "cmdDatabase"
Header1form��� sN%����Uj+%�C�emp_connection�
CONNECTION���C�/���emp_connection���c����emp_connection���UClick,��1����A2�)headerHeader1sampleapp.Pageframe1.Page1cmdDatabase
commandbutton
commandbuttonsampleapp.Pageframe1.Page1
edtCursorInfoeditboxeditboxP��� 77eO%����U����F��Q��emp_init��T��C�SAFETYv��G.��1��employee���(��employee��Q��1��employee��SET SAFETY &lcSave
ULCSAVEClick,��1q�Qa1!A!a2)7K��� 22t�%����U����7T��C�������	EXCLUSIVE�	�SHARED6��T������������
H�h������	�
�������F��USE "employee" &lcExclusive
T��
�CC`��T���������	�
�����9�F��&USE "emp_view_local"  &lcExclusive
T��
�CC`��T���������	�
�������F��'USE "emp_view_remote"  &lcExclusive
T��
�CC`��T�������%�CC�����B��T��	�����ULCEXCLUSIVETHISPARENTCHKEXCLVALUEPAGE2GRID1COLUMNCOUNTTHISFORM
PAGEFRAME1PAGE1
OPGCURSORTYPEOENGINECURSORALIAS
CURSORTYPE
ACTIVEPAGEClick,��1qr�������a��qA�BA22�)2=��� $$�R%����UJ%�����C���T����cs.dbc��T���-��
�����UOENGINEDATABASEISOPENEDDATABASENAMETHISFORM
REFRESHSTATUSClick,��1Qa��A1�)$header�PROCEDURE Click
* Create startup form to open DBC
oStartForm = createobj('OpenDBC')
IF TYPE('oStartForm')#'O' OR ISNULL(m.oStartForm)
	RETURN
ENDIF
oStartForm.Show

THISFORM.RefreshStatus

ENDPROC
�BackStyle = 1
BorderStyle = 0
Enabled = .F.
Height = 49
Left = 22
ReadOnly = .F.
ScrollBars = 0
SpecialEffect = 1
TabIndex = 15
Top = 16
Width = 566
DisabledForeColor = 0,0,0
Name = "edtCursorInfo"
sampleapp.Pageframe1.Page1cmdClose
commandbutton
commandbuttonconflicts.grdConflicts.Column17*Caption = "PostalCode"
Name = "Header1"
iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
&Caption = "Region"
Name = "Header1"
conflicts.grdConflicts.Column9conflicts.grdConflicts.Column1�PROCEDURE Click
* stop the middle-tire server, if active
IF oEngine.ServerIsStarted()
	oEngine.ServerStop
ENDIF

CLEAR EVENTS
RELEASE THISFORM

ENDPROC
hTop = 381
Left = 464
Height = 24
Width = 126
Caption = "\<Close"
TabIndex = 10
Name = "cmdClose"
hCaption = "Status:"
Height = 17
Left = 58
Top = 232
Width = 313
TabIndex = 14
Name = "lblStatus"
sampleapp.Pageframe1.Page1	lblStatuslabellabel*Caption = "Home_phone"
Name = "Header1"
conflicts.grdConflicts.Column11conflicts.grdConflicts.Column12'Caption = "Country"
Name = "Header1"
headerheaderheader4PROCEDURE Click
thisform.offline("drop")
ENDPROC
qTop = 328
Left = 246
Height = 24
Width = 125
Caption = "Dro\<p OffLine"
TabIndex = 6
Name = "cmdDropView"
cmdDropView*Caption = "Reports_to"
Name = "Header1"
sampleapp.Pageframe1.Page1
commandbutton
commandbutton&Caption = "Emp_id"
Name = "Header1"
conflicts.grdConflicts.Column2textboxtextboxconflicts.grdConflicts.Column4Header1headerconflicts.grdConflicts.Column36PROCEDURE Click
thisform.offline("create")
ENDPROC
sampleapp.Pageframe1.Page1
cmdCreateView�PROCEDURE Click
IF OEngine.DatabaseIsOpened
	CLOSE DATABASE
	OEngine.DatabaseName = CS_DATABASE
	OEngine.DatabaseIsOpened = .F.
	thisform.RefreshStatus
ENDIF
ENDPROC
Shape1uTop = 300
Left = 246
Height = 24
Width = 125
Caption = "Create O\<ffline"
TabIndex = 5
Name = "cmdCreateView"

commandbutton
commandbuttonsampleapp.Pageframe1.Page1	chkOnViewcheckboxcheckboxchkExclshapeshapetextboxoTop = 332
Left = 422
Height = 17
Width = 108
Caption = "Open On \<Line"
TabIndex = 8
Name = "chkOnView"
textboxtextbox*Caption = "First_name"
Name = "Header1"
iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
Header1textboxiBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
PROCEDURE Click
LOCAL lcSave

* check for CS_INITIALTABLE
* handle employee path
* check write access
SELECT 0
USE CS_INITIALTABLE
lcSave = SET('SAFETY')
SET SAFETY OFF
REMOVE TABLE CS_TABLE DELETE
COPY TO CS_TABLE
USE
ADD TABLE CS_TABLE
SET SAFETY &lcSave

ENDPROC
sTop = 300
Left = 68
Height = 24
Width = 125
Caption = "\<Reset Initial Data"
TabIndex = 3
Name = "cmdReset"
sampleapp.Pageframe1.Page1cmdReset
commandbutton
commandbutton$��� %%)�E8�UE#����������
�����T��C�emp_connection�f��
H�[������������T��CE����C��0�	�
��B�-�����������T��C��|1������C��0�	�
��B�-���$T���DROP TABLE �employee��T��C���i����C���z��%�������T��C����T��C����%���u������C��0�	�
��B�-����lT���
CREATE TABLE �employee�B (emp_id char(6) NULL, last_name char(20)NULL, first_name char(10)��oT����^ NULL, title char(30) NULL, salary int NULL, birth_date datetime NULL, hire_date datetime NULL��_T����N, address char(60) NULL, city char(15) NULL, region char(15) NULL, postalcode ��bT����Qchar(10) NULL, country char(15) NULL, home_phone char(24) NULL, extension char(4)��ST����B NULL, photo image NULL, notes text NULL, reports_to char(6) NULL)��T��C���i����C��g��%�������
H������������,���C���z��T��C����T��C���� %�����CC���
	��(�T��C��������������WT��C�<Upsizing cannot continue because a connection error occurred�|1CC�
ZA�����C��0�	�
���B�-���F��Q���employee��T��CC`��%�����)�1��C�Unable to open Employee table.�0�	�
��B�-���F��Q��emp_view_remote����C�	Buffering����APPEND FROM &lcAlias
T��Ca���%��
����O��C�<Upsizing cannot continue because a connection error occurred�0�	�
��
��Ca����#�)R,������Upsizing table succeeded.���Q�SELECT &lcAlias
Q�ULNCONNHANDLELCSQLLNRETVALLLRETVALLCERRMSG
LNSERVERERRORLCMSG	AERRARRAY
CONNHANDLEOENGINEALERTSQLCONN_FAIL_LOCLCDATASOURCENAMELNSERVERERRLCALIASLLRESULTClick,��11���!�Aq"rAqAC1�!AqAA���!12��"�A#qAAqA�!�qA����������AC1A2�	)iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
Text1headerconflicts.grdConflicts.Column2csdefs.h��lI$!Arial, 0, 9, 5, 15, 12, 21, 3, 0
	conflictscsdefs.hPixelseTop = 12
Left = 12
Height = 105
Width = 445
BorderStyle = 1
SpecialEffect = 0
Name = "Shape2"
nTop = 328
Left = 68
Height = 24
Width = 125
Caption = "\<Upsize Table"
TabIndex = 4
Name = "cmdUpsize"
sampleapp.Pageframe1.Page1	cmdUpsize
commandbutton
commandbuttonqTop = 303
Left = 422
Height = 17
Width = 120
Caption = "Open \<Exclusively"
TabIndex = 7
Name = "chkExcl"
sampleapp.Pageframe1.Page1checkboxcheckbox���� ggp�%�Uh���&T��CC�DBC�
File Name:�OK�@��T������T���C�����������U	LCOTHERDATABASEOENGINEDATABASEFILEDATABASENAME	JUSTFNAMETHISPARENTTXTDATABASEFILEREFRESHClick,��1qb�1�)g2PROCEDURE Click
HELP ID HELP_CONFLICTS
ENDPROC
	conflictsgrdConflictsheaderlabelHeader1textboxZTop = 220
Left = 211
Height = 27
Width = 84
Caption = "\<Update"
Name = "cmdUpdate"
	conflicts	cmdUpdate
commandbuttoncmdHelp)Caption = "Extension"
Name = "Header1"
TTop = 127
Left = 12
Height = 92
Width = 445
SpecialEffect = 0
Name = "Shape3"
eTop = 242
Left = 418
Height = 24
Width = 120
Caption = "\<Open"
TabIndex = 2
Name = "cmdOpen"
sampleapp.Pageframe1.Page1cmdOpen
commandbutton
commandbuttonShape1shapetextboxtextboxconflicts.grdConflicts.Column12headerheaderHeader1conflicts.grdConflicts.Column13%Caption = "Title"
Name = "Header1"
conflicts.grdConflicts.Column4iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
headerHeader1conflicts.grdConflicts.Column5&Caption = "Salary"
Name = "Header1"
textboxtextboxText1conflicts.grdConflicts.Column5iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
headerheaderHeader1conflicts.grdConflicts.Column6*Caption = "Birth_date"
Name = "Header1"
textboxtextboxText1conflicts.grdConflicts.Column6headerheaderHeader1ClassUTop = 288
Left = 230
Height = 76
Width = 156
SpecialEffect = 0
Name = "Shape1"
sampleapp.Pageframe1.Page1shapeyAutoSize = .T.
Caption = "Maintenance:"
Height = 17
Left = 69
Top = 280
Width = 75
TabIndex = 13
Name = "Label2"
sampleapp.Pageframe1.Page1Label2labellabeltextboxtextboxText1oengine
*refreshstatus 
Text1iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
conflicts.grdConflicts.Column17
commandbutton
commandbuttonText1Shape2shapetextbox	conflicts	conflictslblConflictslabellabel	conflictseditbox�Top = 187
Left = 240
Height = 24
Width = 84
Caption = "\<Close"
Enabled = .T.
TabIndex = 7
Visible = .T.
Name = "cmdCloseDatabase"
iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
conflicts.grdConflicts.Column7)Caption = "Hire_date"
Name = "Header1"
textboxtextboxText1conflicts.grdConflicts.Column7iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
headerheaderHeader1conflicts.grdConflicts.Column8'Caption = "Address"
Name = "Header1"
textboxtextboxText1eCaption = "Conflicts on row:"
Height = 17
Left = 10
Top = 84
Width = 170
Name = "lblConflicts"
�BorderStyle = 0
Enabled = .F.
Height = 49
Left = 10
ScrollBars = 0
SpecialEffect = 1
Top = 14
Width = 590
DisabledForeColor = 0,0,0
Name = "edtConflictsInfo"
edtConflictsInfoeditbox�PROCEDURE Click
IF INDBC(CS_CONNECTION, 'CONNECTION')
	MODIFY CONNECTION CS_CONNECTION
ELSE
	CREATE CONNECTION CS_CONNECTION
ENDIF

ENDPROC
textboxheaderheader)PROCEDURE Click
thisform.next
ENDPROC
XTop = 220
Left = 418
Height = 27
Width = 84
Caption = "\<Ignore"
Name = "cmdSkip"
	conflictscmdSkip
commandbutton
commandbuttonWCaption = "New value"
Height = 15
Left = 10
Top = 175
Width = 84
Name = "Label3"
	conflictsLabel3labellabel[Caption = "Current value"
Height = 15
Left = 10
Top = 155
Width = 96
Name = "Label2"
	conflictsLabel2labellabelWCaption = "Old value"
Height = 15
Left = 10
Top = 135
Width = 96
Name = "Label1"
PROCEDURE Click
LOCAL lcOtherDatabase

lcOtherDatabase = LOWER(GETFILE(DBC_TYPE,GETFILE_LOC,GETFILEBTN_LOC))
OEngine.DatabaseFile = lcOtherDatabase
OEngine.DatabaseName = OEngine.JustFName(lcOtherDatabase)
this.parent.txtDatabasefile.refresh
ENDPROC
Header1textbox�PROCEDURE Click
LOCAL lcExclusive

lcExclusive = IIF(this.parent.chkExcl.value = 1, 'EXCLUSIVE', 'SHARED')

* reset grid
This.Parent.Parent.Page2.Grid1.ColumnCount = -1

DO CASE
	CASE thisform.pageframe1.page1.opgCursorType.Value = 1
		* local table
		SELECT 0
		USE CS_TABLE &lcExclusive
		oEngine.CursorAlias = TRIM(ALIAS())
		oEngine.CursorType = TABLE_CURSOR
	CASE thisform.pageframe1.page1.opgCursorType.Value = 2
		*local view
		SELECT 0
		USE CS_LOCAL_VIEW  &lcExclusive
		oEngine.CursorAlias = TRIM(ALIAS())
		oEngine.CursorType = LOCAL_VIEW_CURSOR
	CASE thisform.pageframe1.page1.opgCursorType.Value = 3
		*remote view
		SELECT 0
		USE CS_REMOTE_VIEW  &lcExclusive
		oEngine.CursorAlias = TRIM(ALIAS())
		oEngine.CursorType = REMOTE_VIEW_CURSOR
ENDCASE

IF EMPTY(ALIAS())
	* Failed to open data source
	RETURN
ENDIF

thisform.pageframe1.ActivePage = 2

ENDPROC
TTop = 287
Left = 52
Height = 77
Width = 156
SpecialEffect = 0
Name = "Shape2"
sampleapp.Pageframe1.Page1�Top = 195
Left = 25
Height = 17
Width = 70
Caption = "\<Exclusive"
TabIndex = 9
DisabledForeColor = 128,128,128
Name = "chkExclDatabase"
conflicts.grdConflicts.Column13conflicts.grdConflicts.Column14textboxText1headerheaderiBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
YBorderStyle = 0
Margin = 0
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
shapevAutoSize = .T.
Caption = "Options:"
Height = 17
Left = 420
Top = 280
Width = 48
TabIndex = 12
Name = "Label3"
sampleapp.Pageframe1.Page1Label3labellabelUTop = 288
Left = 406
Height = 76
Width = 156
SpecialEffect = 0
Name = "Shape4"
sampleapp.Pageframe1.Page1Shape4shapeshapecTop = 76
Left = 22
Height = 298
Width = 567
BackStyle = 0
SpecialEffect = 0
Name = "Shape3"
sampleapp.Pageframe1.Page1Shape3shapeshapefErasePage = .T.
PageCount = 2
Top = -12
Left = 0
Width = 640
Height = 480
Tabs = .F.
TabIndex = 1
TabStop = .T.
RightToLeft = .T.
Name = "Pageframe1"
Page1.FontName = "MS Sans Serif"
Page1.FontSize = 8
Page1.Caption = ""
Page1.Name = "Page1"
Page2.FontName = "MS Sans Serif"
Page2.FontSize = 8
Page2.Caption = "Page2"
Page2.Name = "Page2"
	sampleapp
Pageframe1	pageframe	pageframe2oengine
*refreshstatus 
*getstatus 
*offline 
�Height = 400
Width = 615
ShowWindow = 0
DoCreate = .T.
AutoCenter = .T.
BorderStyle = 2
Caption = "Client/Server Application"
MaxButton = .F.
Movable = .T.
WindowState = 0
LockScreen = .F.
Name = "sampleapp"
(PROCEDURE Click
LOCAL llUpdate 

* force-update current row
oEngine.HadError = .F.
oEngine.SetErrorOff = .T.
llUpdate = TABLEUPDATE(.F., .T.)
IF oEngine.HadError
	=MESSAGEBOX(Oengine.cMessage, MB_ICONEXCLAMATION)
	llUpdate = .F.
ENDIF
oEngine.SetErrorOff = .F.

* Display whether update was successful or failed (e.g., primary key changed)
IF m.llUpdate
	wait window WAIT_UPDATEOK_LOC timeout CS_TIMEOUT
ELSE
	wait window WAIT_UPDATEFAIL1_LOC timeout CS_TIMEOUT
ENDIF

Ocsapp.pageframe1.page2.grid1.refresh
thisform.next
ENDPROC
Text1textboxtextboxCPROCEDURE next
PARAMETERS lnStartRow
LOCAL lnRow, lcEmployee, lcUserField, aUserValues, lnBuffering, nCursorType
DIMENSION aUserValues[1]

* default start row is current row
IF PARAMETERS() = 0
	lnStartRow = RECNO()
ENDIF

* close form after single row conflicts
lcEmployee = oEngine.CursorAlias
lnBuffering = CURSORGETPROP('Buffering')
IF (oEngine.RowConflict OR lnBuffering < 4) AND lnStartRow <> 0
	this.cmdClose.click
	RETURN
ENDIF

nCursorType = CURSORGETPROP("SourceType",oEngine.CursorAlias)

* for table buffering move to next row
IF !oEngine.RowConflict AND lnBuffering > 3
	lnRow = GETNEXTMODIFIED(lnStartRow, lcEmployee)
	this.lblConflicts.caption = CS_ROWCONFLICT_LOC + LTRIM(STR(lnRow,10 , 0))
	IF lnRow = 0
		this.cmdClose.click
		RETURN
	ENDIF
	GO lnRow IN (lcEmployee)
ENDIF

* load original values
SELECT (oEngine.ConflictAlias)
GO TOP
FOR m.i = 1 TO ALEN(THIS.aEmployee, 1)
	REPLACE (THIS.aEmployee[m.i,1]) WITH OLDVAL(THIS.aEmployee[m.i,1], lcEmployee)
ENDFOR

* load current values
* add error code here

IF m.nCursorType # 3	&& refresh if not a table
	REFRESH(1, 0, lcEmployee)
ENDIF

SKIP
FOR m.i = 1 TO ALEN(THIS.aEmployee, 1)
	REPLACE (THIS.aEmployee[m.i,1]) WITH CURVAL(THIS.aEmployee[m.i,1], lcEmployee)
ENDFOR

* load user values
SKIP
FOR m.i = 1 TO ALEN(THIS.aEmployee, 1)
	lcUserField = lcEmployee + '.' + THIS.aEmployee[m.i,1]
	REPLACE (THIS.aEmployee[m.i,1]) WITH EVALUATE(lcUserField)
ENDFOR

go top
this.grdConflicts.Refresh

SELECT (oEngine.CursorAlias)

ENDPROC
PROCEDURE Init
LOCAL aTmpEmp

DIMENSION aTmpEmp[1]
DIMENSION THIS.aEmployee[1]

this.edtConflictsInfo.value = CS_CONFLICTS_INFO_LOC

oEngine.CurrentPage = 3

* create conflict cursor
lcEmployee = oEngine.CursorAlias
AFIELDS(aTmpEmp)
ACOPY(aTmpEmp,THIS.aEmployee)
SELECT 0
CREATE CURSOR CS_CONFLICTS FROM ARRAY aTmpEmp
oEngine.ConflictAlias = TRIM(ALIAS())

* append conflict records
APPEND BLANK
APPEND BLANK
APPEND BLANK
this.grdConflicts.RecordSource = oEngine.ConflictAlias

* move on first conflict
thisform.next(0)
ENDPROC
conflicts.grdConflicts.Column8iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
headerheaderHeader1conflicts.grdConflicts.Column9$Caption = "City"
Name = "Header1"
textboxtextboxText1header�Height = 250
Width = 620
DoCreate = .T.
AutoCenter = .T.
Caption = "Resolve Conflicts"
ControlBox = .F.
MinButton = .F.
WindowType = 1
WindowState = 0
AlwaysOnTop = .T.
Name = "conflicts"
headerheaderHeader1conflicts.grdConflicts.Column3	conflictsLabel1*next 
^aemployee[1,0] 
qPROCEDURE Click
SELECT (oEngine.ConflictAlias)
USE
SELECT (oEngine.CursorAlias)
THISFORM.release

ENDPROC
XTop = 220
Left = 521
Height = 27
Width = 84
Caption = "\<Close"
Name = "cmdClose"
	conflictsiBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
	conflictswTop = 220
Left = 12
Height = 27
Width = 84
FontName = "Arial"
FontSize = 9
Caption = "\<Help"
Name = "cmdHelp"

commandbutton��� ����%����U+
F�����Q�
F�����
����UOENGINE
CONFLICTALIASCURSORALIASTHISFORMRELEASEClick,��1�A��2f)�GPROCEDURE Error
LPARAMETERS nError, cMethod, nLine
LOCAL  lcMsg
OEngine.DatabaseIsOpened = .F.
IF m.nError = 1705
	lcMsg = STRTRAN(CANT_OPEN_EXCLU_LOC, "|1", OEngine.DatabaseFile)
ELSE
	lcMsg = STRTRAN(CANT_OPENDB_LOC, "|1" , OEngine.DatabaseFile)
ENDIF
=MESSAGEBOX(lcMsg, MB_ICONEXCLAMATION)

ENDPROC
PROCEDURE Click
LOCAL lcExclusive, lcMsg

IF EMPTY(OEngine.DatabaseFile)
	RETURN
ENDIF

IF !FILE(OEngine.DatabaseFile)
	* should not occur
	=MESSAGEBOX(NO_SUCH_FILE_LOC, 48)
	RETURN
ENDIF

* set database properties on OEngine
OEngine.DatabaseIsOpened = .T.
lcExclusive = IIF(this.parent.chkExclDatabase.value = 1, "EXCLUSIVE", "SHARED")
OPEN DATABASE (OEngine.DatabaseFile) &lcExclusive

* Check if failed to open DBC
IF !OEngine.DatabaseIsOpened THEN
	RETURN
ENDIF

thisform.RefreshStatus

ENDPROC

PROCEDURE Click
LOCAL lnConnHandle, lcSQL, lnRetVal, llRetVal, lcErrMsg, lnServerError, lcMsg, aErrArray
DIMENSION aErrArray[6]

*connect to SQL Server 
ConnHandle = SQLCONNECT(CS_CONNECTION)

DO CASE
	CASE ConnHandle = -1
		* connection failure
		lcMsg = message()
		OEngine.Alert(lcMsg, MB_ICONEXCLAMATION + MB_OK)
		RETURN .F.

	CASE ConnHandle = -2
		* invalid conn. handle (rare)
		lcMsg = STRTRAN(SQLCONN_FAIL_LOC, "|1", lcDataSourceName)
		OEngine.Alert(lcMsg, MB_ICONEXCLAMATION + MB_OK)
		RETURN .F.
ENDCASE

* drop the table if it exists, ignore error if it doesn't exist
lcSQL = "DROP TABLE " + CS_TABLE
lnRetVal = SQLEXEC(ConnHandle, lcSQL)
=AERROR(aErrArray)
IF lnRetVal <>1
	lnServerError = aErrArray[5]
	lcErrMsg = aErrArray[2]
	IF lnServerError <> 3701
		OEngine.Alert(lcErrMsg, MB_ICONEXCLAMATION + MB_OK)
		RETURN .F.
	ENDIF
ENDIF

* create remote table
lcSQL = "CREATE TABLE " + CS_TABLE + " (emp_id char(6) NULL, last_name char(20)NULL, first_name char(10)"
lcSQL = lcSQL + " NULL, title char(30) NULL, salary int NULL, birth_date datetime NULL, hire_date datetime NULL"
lcSQL = lcSQL + ", address char(60) NULL, city char(15) NULL, region char(15) NULL, postalcode "
lcSQL = lcSQL + "char(10) NULL, country char(15) NULL, home_phone char(24) NULL, extension char(4)"
lcSQL = lcSQL + " NULL, photo image NULL, notes text NULL, reports_to char(6) NULL)"

lnRetVal = SQLEXEC(ConnHandle, lcSQL)
=SQLDISCONN(ConnHandle)
		
IF lnRetVal <> 1
	DO CASE
		* Server error occurred
		CASE lnRetVal = -1
			=AERROR(aErrArray)
			lnServerError = aErrArray[1]
			lcErrMsg = aErrArray[2]
				
			IF lnServerError = 1526 AND !ISNULL(aErrArray[5])THEN
			lnServerError = aErrArray[5]
			ENDIF

		* Connection level error occurred
		CASE lnRetVal = -2
			lcErrMsg = STRTRAN(CONNECT_FAILURE_LOC, "|1", LTRIM(STR(lnServerErr)))
			OEngine.Alert(lcErrMsg, MB_ICONEXCLAMATION + MB_OK)
	ENDCASE
	RETURN .F.
ENDIF

* open Employee table
SELECT 0
USE CS_TABLE SHARED
lcAlias = TRIM(ALIAS())

IF lcAlias = ''
	OEngine.Alert(ERR_NOOPENEMP_LOC, MB_ICONEXCLAMATION + MB_OK)
	RETURN .F.
ENDIF		

* open local view
SELECT 0
USE CS_REMOTE_VIEW
=CURSORSETPROP('Buffering', 5)

* upsize Employee table using remote view
APPEND FROM &lcAlias
llResult = TABLEUPDATE(.T.)
IF !llResult
	OEngine.Alert(CONNECT_FAILURE_LOC, MB_ICONEXCLAMATION)
	TABLEREVERT(.T.)
ELSE
	wait window WAIT_UPSIZEOK_LOC timeout CS_TIMEOUT
ENDIF

* clean up code
USE		&& view
SELECT &lcAlias
USE		&& table

ENDPROC
�PROCEDURE Click
LOCAL lnRows 

oEngine.HadError = .F.
oEngine.SetErrorOff = .T.
lnRows = TABLEREVERT(.F.)
IF oEngine.HadError
	=MESSAGEBOX(Oengine.cMessage, MB_ICONEXCLAMATION)
	lnRows = 0
ENDIF
oEngine.SetErrorOff = .F.

* no conflicts, no row or one row reverted
wait window IIF(lnRows = 0,WAIT_REVERTFAIL_LOC,WAIT_REVERT1_LOC) timeout CS_TIMEOUT
Ocsapp.pageframe1.page2.grid1.refresh

thisform.next
ENDPROC
��� ���%
�)=�U

����UTHISFORM
REFRESHSTATUS;7�������
�����;T�����(Information about updates functionality.��
H�p�2���	�
�����!T�����Table: �	�
����	�
�����2T�����Local View: �	�
� �	�����	�
���2�3T�����
Remote View: �	�
� �	����T���	���T�	�����%�����k�B��T�����	�
�
��T����C�	Buffering���%��	�
���T�T�����a��T�����a��T�����a��T��������
��T��������
��T�����	�
�
�����T�����-��T�����-��T�����-���T�������T����-��T����a��7T����C�oEngine.oServerb�O�	C�	��
��
�����T�����	�
��
���� �U!
LROWBUFFERINGLFORCELTABLEBUFFERINGNUPDATETYPEAERRORS
LNPREVPAGETHISEDTFUNCTIONSINFOVALUEOENGINE
CURSORTYPELBLCURSORACTIVECAPTIONCURSORALIASONLINESTATUSCURRENTPAGE
CMDREQUERYENABLED	OPGBUFFEROPTION1OPTION2OPTION4	CMDUPDATE	CMDREVERT	OPGUPDATECHKFORCECHKCONFLICTSCHKRULESOSERVERINTERACTIVECHANGEGRID1RECORDSOURCEREFRESHPage1.Activate,��Page2.ActivateV��1�3����AA"A2AAA��AAAA����AAAA3s�a�1QvK)�|��� cc�m%�
��U���������T���-��%��
�����r�:T��C� Unable to open '|1' exclusively.�|1��������T��C��|1��������C��0�x��UNERRORCMETHODNLINELCMSGOENGINEDATABASEISOPENEDDATABASEFILECANT_OPENDB_LOC����%�C�����!�B��%�C��0
��_�#��C�File does not exist.�0�x��B��T���a��7T��C�������	EXCLUSIVE�	�SHARED6��5OPEN DATABASE (OEngine.DatabaseFile) &lcExclusive
%���
����B��
��	�
�ULCEXCLUSIVELCMSGOENGINEDATABASEFILEDATABASEISOPENEDTHISPARENTCHKEXCLDATABASEVALUETHISFORM
REFRESHSTATUSError,��Click3��1�q�A���A�3�"AA22AA�qQAA�2/K<
)c���� ��<�%l�{�U����T���-��T���a��T��C-���%�����`���C���0�x��
T������T���-��=R,�����C����
Revert failed��1 row reverted6��������	�
��
��ULNROWSOENGINEHADERRORSETERROROFFCMESSAGEOCSAPP
PAGEFRAME1PAGE2GRID1REFRESHTHISFORMNEXTClick,��1q���!�A��1�1�)��PROCEDURE refreshstatus
LOCAL llOffline

this.edtDatabaseInfo.value = CS_DATABASE_INFO_LOC
this.edtDatabaseInfo1.value = CS_DATABASE_INFO1_LOC
this.edtDatabaseInfo2.value = CS_DATABASE_INFO2_LOC

IF OEngine.DatabaseIsOpened
	this.cmdBrowse.Enabled = .F.
	this.cmdOpenDatabase.Enabled = .F.
	this.chkExclDatabase.Enabled = .F.
	this.cmdCloseDatabase.Enabled = .T.
	this.cmdModifyConnection.Enabled = .T.
ELSE
	this.cmdBrowse.Enabled = .T.
	this.cmdOpenDatabase.Enabled = .T.
	this.chkExclDatabase.Enabled = .T.
	this.cmdCloseDatabase.Enabled = .F.
	this.cmdModifyConnection.Enabled = .F.
	this.cmdOpenDatabase.Setfocus
ENDIF

ENDPROC
PROCEDURE Init
LOCAL lcFile

IF EMPTY(OEngine.DatabaseFile)
	lcFile = LOWER(fullpath(CS_DATABASE))
	if (FILE(lcFile))
		OEngine.DatabaseFile = lcFile
	ENDIF
ENDIF

this.RefreshStatus

ENDPROC
PROCEDURE Load
IF TYPE("m.oEngine") # "O" OR ISNULL(m.oEngine)
	RETURN .F.
ENDIF
ENDPROC
���� ���%�l!*�U����T�����5CS.DBC is the database required by this sample. Make �:sure the full path to CS.DBC is displayed in the text box.�; If it isn't, choose the dialog button beside the text box �and locate CS.DBC.���T�����=Choose Open to open the CS.DBC database. Make sure Exclusive �His selected if you want to be able to modify the database in the sample.���T�����HIn order to upsize and view remote data you need to set up a connection �Hto a back end database. You only need to setup the connection the first �time you run this sample.��%�������T���	�-��T��
�	�-��T���	�-��T���	�a��T��
�	�a����T���	�a��T��
�	�a��T���	�a��T���	�-��T��
�	�-��
���
���U	LLOFFLINETHISEDTDATABASEINFOVALUEEDTDATABASEINFO1EDTDATABASEINFO2OENGINEDATABASEISOPENED	CMDBROWSEENABLEDCMDOPENDATABASECHKEXCLDATABASECMDCLOSEDATABASECMDMODIFYCONNECTIONSETFOCUSe���%�C�����T�T��CC�cs.dbc�@��%�C�0��P�T��������
����ULCFILEOENGINEDATABASEFILETHIS
REFRESHSTATUS6(%�C�	m.oEngineb�O�C�
����/�B�-���UOENGINE
refreshstatus,��Init��Load���1q�
�	A��A3q"qAA�3�qA1��Rm�%)��ColumnCount = 17
Height = 90
Highlight = .F.
HighlightRow = .F.
Left = 110
ReadOnly = .T.
RecordSource = ""
ScrollBars = 1
Top = 115
Width = 492
Name = "grdConflicts"
Column1.ControlSource = ""
Column1.ReadOnly = .T.
Column1.Name = "Column1"
Column2.ControlSource = ""
Column2.ReadOnly = .T.
Column2.Name = "Column2"
Column3.ControlSource = ""
Column3.ReadOnly = .T.
Column3.Name = "Column3"
Column4.ControlSource = ""
Column4.ReadOnly = .T.
Column4.Name = "Column4"
Column5.ControlSource = ""
Column5.Width = 80
Column5.ReadOnly = .T.
Column5.Name = "Column5"
Column6.ControlSource = ""
Column6.Width = 80
Column6.ReadOnly = .T.
Column6.Name = "Column6"
Column7.ControlSource = ""
Column7.Width = 80
Column7.ReadOnly = .T.
Column7.Name = "Column7"
Column8.ControlSource = ""
Column8.Width = 180
Column8.ReadOnly = .T.
Column8.Name = "Column8"
Column9.ControlSource = ""
Column9.Width = 80
Column9.ReadOnly = .T.
Column9.Name = "Column9"
Column10.ControlSource = ""
Column10.Width = 80
Column10.ReadOnly = .T.
Column10.Name = "Column10"
Column11.ControlSource = ""
Column11.Width = 80
Column11.ReadOnly = .T.
Column11.Name = "Column11"
Column12.ControlSource = ""
Column12.ReadOnly = .T.
Column12.Name = "Column12"
Column13.ControlSource = ""
Column13.Width = 90
Column13.ReadOnly = .T.
Column13.Name = "Column13"
Column14.ControlSource = ""
Column14.Width = 55
Column14.ReadOnly = .T.
Column14.Name = "Column14"
Column15.ControlSource = ""
Column15.Width = 40
Column15.ReadOnly = .T.
Column15.Name = "Column15"
Column16.ControlSource = ""
Column16.Width = 40
Column16.ReadOnly = .T.
Column16.Name = "Column16"
Column17.Width = 70
Column17.ReadOnly = .T.
Column17.Name = "Column17"
VPROCEDURE Page1.Activate
* refresh table and view info
thisform.RefreshStatus

ENDPROC
PROCEDURE Page2.Activate
PUBLIC lRowBuffering, lForce, lTableBuffering, nUpdateType, aErrors, lnPrevPage
DIMENSION aErrors[1]

this.edtFunctionsInfo.value = CS_FUNCTIONS_INFO_LOC
*set cursor name opened

DO CASE
	CASE oEngine.CursorType = 1
		* local table
		this.lblcursorActive.caption = CS_STATTBL_LOC  + oEngine.CursorAlias
	CASE oEngine.CursorType = 2
		*local view
		this.lblcursorActive.caption = CS_STATLV_LOC  + oEngine.CursorAlias + " " + oEngine.OnlineStatus
	CASE oEngine.CursorType = 3
		*remote view
		this.lblcursorActive.caption = CS_STATRV_LOC  + oEngine.CursorAlias + " " + oEngine.OnlineStatus
ENDCASE


* don't initialize after conflict resolution
lnPrevPage = oEngine.CurrentPage
oEngine.Currentpage = 2
IF lnPrevPage = 3
	RETURN
ENDIF

this.cmdRequery.enabled = !(oEngine.CursorType = TABLE_CURSOR)

* initialize buffering options
this.opgBuffer.value = CURSORGETPROP('Buffering')
IF Oengine.CursorType = TABLE_CURSOR
	this.opgBuffer.option1.enabled = .T.
	this.opgBuffer.option2.enabled = .T.
	this.opgBuffer.option4.enabled = .T.
	this.cmdUpdate.enabled = !(this.opgBuffer.value = 1)
	this.cmdRevert.enabled = !(this.opgBuffer.value = 1)
	this.cmdRequery.enabled = !(oEngine.CursorType = TABLE_CURSOR)
ELSE
	this.opgBuffer.option1.enabled = .F.
	this.opgBuffer.option2.enabled = .F.
	this.opgBuffer.option4.enabled = .F.
ENDIF


this.opgUpdate.value = 1		&& row update
this.chkForce.value = .F.		&& optimistic conflict resolution
this.chkConflicts.value = .T.	&& conflict resolution on

* local business rule checking
this.chkRules.value = !(TYPE('oEngine.oServer') <> 'O' OR ISNULL(oEngine.oServer))
this.opgBuffer.interactivechange
this.grid1.RecordSource = oEngine.CursorAlias
this.grid1.refresh
ENDPROC
���� wweh%E
���
�U����$T������٣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 �dtoggle between the online and offline modes. Then select the concurrency option and open the cursor.��
����
H�B��������������.T�����	��Table: C�employeef��T����
��-��T������-��T����
��-��*%����C�employee�TABLE�	����T������a��T������a��7T������C�emp_connection�
CONNECTION���,T������C�emp_init�TABLE������T������-��T������-��T������-��T������-��������������9T�����	��Local View: C�emp_view_localf��T������-��T������-��/%����C�emp_view_local�VIEW�	��X�T������a��T������a��6T��CC�emp_view_local�view�offlinepathꋡ
��T����
���
��T���������T����
��������T������-��T������-��T����
��-��T������-��T����
��-��������������;T�����	��
Remote View: C�emp_view_remotef��T������-��T������-��U%����C�emp_view_remote�VIEW�	�"C�emp_connection�
CONNECTION�	��c�T������a��T������a��7T��CC�emp_view_remote�view�offlinepathꋡ
��T����
���
��T���������T����
��������T������-��T������-��T����
��-��T������-��T����
��-����U	LLOFFLINETHIS
PAGEFRAME1PAGE1
EDTCURSORINFOVALUE	GETSTATUS
OPGCURSORTYPE
LBLCURSORNAMECAPTION
CMDCREATEVIEWENABLEDCMDDROPVIEW	CHKONVIEWOENGINEDATABASEISOPENEDCMDOPENCHKEXCL	CMDUPSIZECMDRESET�����
T�����T���a��T���-��%������	���
�Q���employee��%�������T���-��Q���employee��%�������T���OPEN  EXCLUSIVE�����T���OPEN  SHARED�����T���	NOT  OPEN���Q����HT��C�����	���emp_view_local��emp_view_remote6��'%�CC��view�offlinepathꋡ����T���ONLINE��T��
�������T���OFFLINE��T��
����Q�����%�����m�T���-��Q�����%�����<�(T���
��, �OPEN  EXCLUSIVE���i�%T���
��, �OPEN  SHARED������"T���
��, �	NOT  OPEN���Q���T���-��'T�������Status: �
���U
LCSTATUSLCVIEWOENGINESETERROROFFHADERRORTHIS
PAGEFRAME1PAGE1
OPGCURSORTYPEVALUEONLINESTATUS	LBLSTATUSCAPTION�4�����T���a��T���-��HT��C�����	���emp_view_local��emp_view_remote6��%���create������C����������C������%�������T���-���T���-��
���
�ULCMODELCVIEWOENGINESETERROROFFHADERRORTHIS
PAGEFRAME1PAGE1
OPGCURSORTYPEVALUE
REFRESHSTATUS��U��U9��UP7��
�����(%�C�	m.oEngineb�O�C�
����C�B�-���G_ �U	AERRARRAYOENGINE
refreshstatus,��	getstatus���offline]��QueryUnload���Destroy���Activate���Load���1qB����qqq�qqq��qqqqA��qq�qqa����qqqqqA��qqRqqq����qqqqqAA3�����"�!���A�aAA��q1�A�����QA�!AAAA�r2qq���q���A�A��3Q2Q2Q2q��qAb1�;�KHgi�zw��y$0�{OZ�}u�)w:��� !!�%����U���T���-��T���a��T��C-a���%�����_���C���0�x��T��-���T���-��%��
����� R,������Update succeeded�����:R,������*Update failed, the primary key has changed���������	�
��
��ULLUPDATEOENGINEHADERRORSETERROROFFCMESSAGEOCSAPP
PAGEFRAME1PAGE2GRID1REFRESHTHISFORMNEXTClick,��1q���!�A����A2�1)!#PROCEDURE refreshstatus
LOCAL llOffline

this.pageframe1.page1.edtCursorInfo.value = CS_CURSOR_INFO_LOC
this.getStatus

*refresh status for all three type of cursors
DO CASE
	CASE this.pageframe1.page1.opgCursorType.value = 1
		* refresh table info
		this.pageframe1.page1.lblCursorName.caption = CS_STATTBL_LOC + UPPER(CS_TABLE)
		this.pageframe1.page1.cmdCreateView.Enabled = .F.
		this.pageframe1.page1.cmdDropView.Enabled = .F.
		this.pageframe1.page1.chkOnView.Enabled = .F.

		IF oEngine.DatabaseIsOpened AND INDBC(CS_TABLE,'TABLE')
			this.pageframe1.page1.cmdOpen.Enabled = .T.
			this.pageframe1.page1.chkExcl.Enabled = .T.
			this.pageframe1.page1.cmdUpsize.Enabled = INDBC(CS_CONNECTION,'CONNECTION')
			this.pageframe1.page1.cmdReset.Enabled = INDBC(CS_INITIALTABLE,'TABLE')
		ELSE
			this.pageframe1.page1.cmdOpen.Enabled = .F.
			this.pageframe1.page1.chkExcl.Enabled = .F.
			this.pageframe1.page1.cmdUpsize.Enabled = .F.
			this.pageframe1.page1.cmdReset.Enabled = .F.
		ENDIF

	CASE this.pageframe1.page1.opgCursorType.value = 2 
		* refresh local view info
		this.pageframe1.page1.lblCursorName.caption = CS_STATLV_LOC + UPPER(CS_LOCAL_VIEW)
		this.pageframe1.page1.cmdUpsize.Enabled = .F.
		this.pageframe1.page1.cmdReset.Enabled = .F.

		IF oEngine.DatabaseIsOpened AND INDBC(CS_LOCAL_VIEW,'VIEW')
			this.pageframe1.page1.cmdOpen.Enabled = .T.
			this.pageframe1.page1.chkExcl.Enabled = .T.
			llOffline = !EMPTY(DBGETPROP(CS_LOCAL_VIEW, 'view', 'offlinepath'))
			this.pageframe1.page1.cmdCreateView.Enabled = !llOffline
			this.pageframe1.page1.cmdDropView.Enabled = llOffline
			this.pageframe1.page1.chkOnView.Enabled = llOffline
		ELSE
			this.pageframe1.page1.cmdOpen.Enabled = .F.
			this.pageframe1.page1.chkExcl.Enabled = .F.
			this.pageframe1.page1.cmdCreateView.Enabled = .F.
			this.pageframe1.page1.cmdDropView.Enabled = .F.
			this.pageframe1.page1.chkOnView.Enabled = .F.
		ENDIF

	CASE this.pageframe1.page1.opgCursorType.value = 3
		* refresh remote view info
		this.pageframe1.page1.lblCursorName.caption = CS_STATRV_LOC  + UPPER(CS_REMOTE_VIEW)
		this.pageframe1.page1.cmdUpsize.Enabled = .F.
		this.pageframe1.page1.cmdReset.Enabled = .F.

		IF oEngine.DatabaseIsOpened AND INDBC(CS_REMOTE_VIEW, 'VIEW') AND INDBC(CS_CONNECTION, 'CONNECTION')
			this.pageframe1.page1.cmdOpen.Enabled = .T.
			this.pageframe1.page1.chkExcl.Enabled = .T.
			llOffline = !EMPTY(DBGETPROP(CS_REMOTE_VIEW, 'view', 'offlinepath'))
			this.pageframe1.page1.cmdCreateView.Enabled = !llOffline
			this.pageframe1.page1.cmdDropView.Enabled = llOffline
			this.pageframe1.page1.chkOnView.Enabled = llOffline
		ELSE
			this.pageframe1.page1.cmdOpen.Enabled = .F.
			this.pageframe1.page1.chkExcl.Enabled = .F.
			this.pageframe1.page1.cmdCreateView.Enabled = .F.
			this.pageframe1.page1.cmdDropView.Enabled = .F.
			this.pageframe1.page1.chkOnView.Enabled = .F.
		ENDIF
ENDCASE

ENDPROC
PROCEDURE getstatus
LOCAL lcStatus, lcView

lcStatus = ""
oEngine.SetErrorOff = .T.
oEngine.HadError = .F.

IF this.pageframe1.page1.opgCursorType.value = 1
	* Table
	USE CS_TABLE EXCLUSIVE
	IF oEngine.HadError
		oEngine.HadError = .F.
		USE CS_TABLE SHARED
		IF oEngine.HadError
			lcStatus = CS_STATOPENEX_LOC 
		ELSE
			lcStatus = CS_STATOPENSH_LOC 
		ENDIF
	ELSE
		lcStatus = CS_STATNOOPEN_LOC 
	ENDIF
	USE
ELSE
	* View (local and remote)
	lcView = IIF(this.pageframe1.page1.opgCursorType.value = 2, CS_LOCAL_VIEW, CS_REMOTE_VIEW)
	IF EMPTY(DBGETPROP(lcView, 'view', 'offlinepath'))
		lcStatus = CS_STATONLINE_LOC
		oEngine.OnlineStatus = lcStatus
	ELSE
		lcStatus = CS_STATOFFLINE_LOC
		oEngine.OnlineStatus = lcStatus
		USE (lcView) EXCLUSIVE
		IF oEngine.HadError
			oEngine.HadError = .F.
			USE (lcView) SHARED
			IF oEngine.HadError
				lcStatus = m.lcStatus + ", " + CS_STATOPENEX_LOC 
			ELSE
				lcStatus = m.lcStatus + ", " + CS_STATOPENSH_LOC 
			ENDIF
		ELSE
		lcStatus = m.lcStatus + ", " + CS_STATNOOPEN_LOC 
		ENDIF
		USE
	ENDIF
ENDIF
oEngine.SetErrorOff = .F.

this.pageframe1.page1.lblStatus.caption = CS_STATUS_LOC  + m.lcStatus
ENDPROC
PROCEDURE offline
PARAMETERS lcMode
LOCAL lcView

oEngine.SetErrorOff = .T.
oEngine.HadError = .F.

lcView = IIF(this.pageframe1.page1.opgCursorType.value = 2, CS_LOCAL_VIEW, CS_REMOTE_VIEW)
IF lcMode = "create"
	=createoffline(lcView)
ELSE
	=dropoffline(lcView)
ENDIF

IF oEngine.HadError
	oEngine.HadError = .F.
ENDIF

oEngine.SetErrorOff = .F.
this.RefreshStatus

ENDPROC
PROCEDURE QueryUnload
CLEAR EVENTS
ENDPROC
PROCEDURE Destroy
CLEAR EVENTS
ENDPROC
PROCEDURE Activate
READ EVENTS
ENDPROC
PROCEDURE Load
PUBLIC aErrArray
DIMENSION aErrArray[5]

IF TYPE("m.oEngine") # "O" OR ISNULL(m.oEngine)
	RETURN .F.
ENDIF
*set multilocks on for buffering
SET MULTILOCK ON
ENDPROC
���� ���<%�-=��U�4����������
�����%�C����K�T��CO���T������T��C�	Buffering���'%���	���
���	����
��
���B�� T��C�
SourceType�����%���	
���	��m�T��C�����4T�
�
���Conflicts on row:  CC��
�ZA��%�����Y�
��
���B��#��������
F�����#)�!��
����(�C�
�������0>�C�
���
����CC�
���
���_����%��
��������C�������H�!��
����(�C�
�����V�0>�C�
���
����CC�
���
�������H�!��
����(�C�
�������#T����.C�
���
���>�C�
���
����C������#)�
��
���
F�����U
LNSTARTROWLNROW
LCEMPLOYEELCUSERFIELDAUSERVALUESLNBUFFERINGNCURSORTYPEOENGINECURSORALIASROWCONFLICTTHISCMDCLOSECLICKLBLCONFLICTSCAPTION
CONFLICTALIASI	AEMPLOYEEGRDCONFLICTSREFRESH���
�����������9T�����&Information about conflict resolution.��T������T��������C�������C�����
��F��h���	conflicts���T��	�CC`�����T��
����	����C���
��UATMPEMPTHIS	AEMPLOYEEEDTCONFLICTSINFOVALUEOENGINECURRENTPAGE
LCEMPLOYEECURSORALIAS
CONFLICTALIASGRDCONFLICTSRECORDSOURCETHISFORMNEXTnext,��Init���1q���A�q�AA�1A�AAA�QA5!ABAC1�AR��3q���1��SQQa1
,(8@)�