-
Notifications
You must be signed in to change notification settings - Fork 3
/
M_omDynamicRecordStateTest.def
75 lines (62 loc) · 1.83 KB
/
M_omDynamicRecordStateTest.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Option Compare Database
Option Explicit
Dim drec As New omDynamicRecordState
Public Sub Test()
Dim rsSrc As New ADODB.Recordset
rsSrc.Open "T_Auto", CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly
drec.SetupFieldsFromRecordset rsSrc, "ID_Auto,DAflevering,SAflevering,upsize_ts"
drec.SetupFields
Dim rs As ADODB.Recordset
' start record ophalen
'drec.SetOldRecord (rs)
Set rs = drec.rsOriginal
rs("ID_Auto") = 101
rs("upsize_ts") = 0
rs("DAflevering") = "01/01/2022"
rs("SAflevering") = 1
' verschillen updaten
'drec.InputRecord("ID_Auto") = 1
'drec.InputRecord("DAflevering") = Date
'drec.InputRecord("SAflevering") = 1
' db record ophalen
'drec.SetDbRecord (rs)
Set rs = drec.rsDatabase
rs("ID_Auto") = 101
rs("upsize_ts") = 1
rs("DAflevering") = "01/01/2022"
rs("SAflevering") = 1
' geef verschillen
drec.Compare
Set rs = drec.rsChangedFields
'rs.RecordCount
End Sub
Public Sub TestFromRecordset()
Dim rsSrc As New ADODB.Recordset
Dim rs As ADODB.Recordset
rsSrc.Open "T_Auto", CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly
drec.SetupFieldsFromRecordset rsSrc, "ID_Auto,DAflevering,SAflevering,upsize_ts"
rsSrc.Close
rsSrc.Open "T_Auto", CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly
drec.SetDatabaseRecord rsSrc
rsSrc.Close
' geef verschillen
drec.Compare
Set rs = drec.rsChangedFields
Debug.Print rs.RecordCount
End Sub
Public Sub TestAutoClass()
'Dim auto As New auto
'auto.LoadMetDR (dr)
'rs
'DR.SetFIeldFromReceord(RS,"velden")
'AUTO.SaveMetDR (dr)
'rs
'dr.SetDatabaseRecord (rs)
'dr.Compare
'Set rs = drec.rsChangedFields
'If rs.RecordCount <> 0 Then
' Fields Updated
' Exit Function
'End If
'-- SaveAuto
End Sub