-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathSQLStaticQuery.cls
More file actions
46 lines (40 loc) · 1.1 KB
/
SQLStaticQuery.cls
File metadata and controls
46 lines (40 loc) · 1.1 KB
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
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "SQLStaticQuery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
' Class: SQLStaticQuery
' A class to reuse an SQL query with multiple values.
Option Explicit
Implements iSQLQuery
Private sQuery As String
Private oSQL As SQLQuery
' Constructor: Class_Initialize
' Initializes the object.
Private Sub Class_Initialize()
Set oSQL = New SQLQuery
End Sub
' Property: Query
' Sets the SQL Query.
Public Property Let Query(sValue)
sQuery = sValue
End Property
' Function: ToString
' Implements the interfaced ToString function
Public Function iSQLQuery_ToString() As String
iSQLQuery_ToString = oSQL.ReplaceArguments(sQuery)
End Function
' Function: AddArgument
' Adds a value to the SQL query
Public Sub AddArgument(sName As String, vValue)
oSQL.AddArgument sName, vValue
End Sub
' Sub: ClearArguments
' Clears the values of any query arguments.
Public Sub ClearArguments()
oSQL.ClearArguments
End Sub