-
Notifications
You must be signed in to change notification settings - Fork 3
/
M_omSQLObject.def
34 lines (31 loc) · 1.1 KB
/
M_omSQLObject.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
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Compare Database
Option Explicit
Public SQLSelect As String
Public SQLFrom As String
Public sqlWhere As String
Public SQLOrderBy As String
Public Sub SplitSQL(sql As String)
SQLSelect = omSQLFunctions.GetSelect(sql)
SQLFrom = omSQLFunctions.GetFrom(sql)
sqlWhere = omSQLFunctions.GetWhere(sql)
SQLOrderBy = omSQLFunctions.GetOrderBy(sql)
End Sub
Public Function BuildSQL(Optional selectClause As Variant = Null, Optional fromClause As Variant = Null, Optional whereClause As Variant = Null, Optional orderByClause As Variant = Null) As String
If Not IsNull(selectClause) Then
Me.SQLSelect = selectClause
End If
If Not IsNull(fromClause) Then
Me.SQLFrom = fromClause
End If
If Not IsNull(whereClause) Then
Me.sqlWhere = whereClause
End If
If Not IsNull(orderByClause) Then
Me.SQLOrderBy = orderByClause
End If
BuildSQL = omSQLFunctions.BuildSQL(SQLSelect, SQLFrom, sqlWhere, SQLOrderBy)
End Function