Preps multiple type values used by an SQL String for insertion into a database field
Preps multiple type values used by an SQL String for insertion into a database field
API Declarations
Public Enum utFieldSuffix
utQuotes = 1
utQuoteComma = 2
End Enum
Rate Preps multiple type values used by an SQL String for insertion into a database field
(2(2 Vote))
varBefore As Variant, _
Optional AddQuote As utFieldSuffix = 0) As String
If IsNull(varBefore) Then
Var2Fld = " NULL "
ElseIf VarType(varBefore) = vbString Then
Var2Fld = Trim$(Replace(CStr("" & varBefore), "'", "''"))
If AddQuote = 2 Then
Var2Fld= " '" & Var2Fld & "', "
Else
Var2Fld = " '" & Var2Fld & "' "
End If
Else
If AddQuote = 2 Then
Var2Fld = " " & CStr(varBefore) & ", "
End If
End If
End Function
Preps multiple type values used by an SQL String for insertion into a database field Comments
No comments yet — be the first to post one!
Post a Comment