forked from lucschulz/VBA_ORM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
c_QueryDesigner_Join.cls
59 lines (44 loc) · 1.22 KB
/
c_QueryDesigner_Join.cls
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
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "c_QueryDesigner_Join"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
Private p_LeftTable As String
Private p_RightTable As String
Private p_LeftValue As String
Private p_RightValue As String
Private p_JoinType As String
Public Enum JoinTypeEnum
Inner
Left
Right
End Enum
Public Property Let LeftTableName(value As String)
p_LeftTable = value
End Property
Public Property Let RightTableName(value As String)
p_RightTable = value
End Property
Public Property Let leftValue(value As String)
p_LeftValue = value
End Property
Public Property Let rightValue(value As String)
p_RightValue = value
End Property
Public Property Get JoinText() As String
JoinText = "(" & p_LeftTable & p_JoinType & p_RightTable & " ON " & p_LeftValue & " = " & p_RightValue & ")"
End Property
Public Sub SetJoinType(jt As JoinTypeEnum)
If jt = Inner Then
p_JoinType = " INNER JOIN "
ElseIf jt = Left Then
p_JoinType = " LEFT JOIN "
ElseIf jt = Right Then
p_JoinType = " RIGHT JOIN "
End If
End Sub