summaryrefslogtreecommitdiff
path: root/wizards/source/access2base/Utils.xba
diff options
context:
space:
mode:
Diffstat (limited to 'wizards/source/access2base/Utils.xba')
-rw-r--r--wizards/source/access2base/Utils.xba15
1 files changed, 12 insertions, 3 deletions
diff --git a/wizards/source/access2base/Utils.xba b/wizards/source/access2base/Utils.xba
index 16f73cd636cd..6f9135cce559 100644
--- a/wizards/source/access2base/Utils.xba
+++ b/wizards/source/access2base/Utils.xba
@@ -615,7 +615,7 @@ Dim lChar As Long, sByte1 As String, sByte2 As String, sByte3 As String
_PercentEncode = psChar
Case Asc("-"), Asc("."), Asc("_"), Asc("~")
_PercentEncode = psChar
- Case Asc("!"), Asc("$"), Asc("&"), Asc("'"), Asc("("), Asc(")"), Asc("*"), Asc("+"), Asc(","), Asc(";"), Asc("=") ' Reserved characters used as delimiters in query strings
+ Case Asc("!"), Asc("$"), Asc("&"), Asc("'"), Asc("("), Asc(")"), Asc("*"), Asc("+"), Asc(","), Asc(";"), Asc("=") ' Reserved characters used as delimitors in query strings
_PercentEncode = psChar
Case Asc(" "), Asc("%")
_PercentEncode = "%" & Right("00" & Hex(lChar), 2)
@@ -722,13 +722,22 @@ End Sub ' SetCalledSub
REM -----------------------------------------------------------------------------------------------------------------------
Public Function _Surround(ByVal psName As String) As String
' Return [Name] if Name contains spaces
+' Return [Name1].[Name2].[Name3] if Name1.Name2.Name3 contains dots
+
Const cstSquareOpen = "["
Const cstSquareClose = "]"
- If InStr(psName, " ") > 0 Then
+Const cstDot = "."
+Dim sName As String
+
+ If InStr(psName, ".") > 0 Then
+ sName = Join(Split(psName, cstDot), cstSquareClose & cstDot & cstSquareOpen
+ _Surround = cstSquareOpen & sName & cstSquareClose
+ ElseIf InStr(psName, " ") > 0 Then
_Surround = cstSquareOpen & psName & cstSquareClose
Else
_Surround = psName
End If
+
End Function ' Surround
REM -----------------------------------------------------------------------------------------------------------------------
@@ -851,4 +860,4 @@ Private Function _UTF8Encode(ByVal psChar As String) As String
End Function ' _UTF8Encode V1.4.0
-</script:module>
+</script:module> \ No newline at end of file