1

I have a user trying to export data into an XML file from Access and is getting an invalid XML error. We are looking at how to remove the invalid characters and ran across this field: .

This field is not the pipe bar, |. When I try and paste this field into Notepad++ its shows ENQ. It does not seem to be an invalid XML character based on Invalid Characters in XML.

Edit: It doesn't appear to show up, so here is a link to how it looks in my editor:

enter image description here

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
ferensilver
  • 341
  • 2
  • 4
  • 17

2 Answers2

0

Sometimes I find it necessary to hunt for the needle in the haystack - a character that doesn't display. If you want to see what characters you may have in a string, you could try the following code. It allows you to skip characters that are common...

Dim YourString As String
Dim blnSkipNbr As Boolean
Dim blnSkipUC As Boolean
Dim blnSkipLC As Boolean
Dim blnSkipSpecial As Boolean
blnSkipNbr = True           ' Set to tru to not display numbers
blnSkipUC = True            ' Skip UC
blnSkipLC = True            ' Skip LC
blnSkipSpecial = True       ' Skip special

' 32-47 = Special (space, !, (), etc.)
' 48-57 = 0 to 9
' 65-90 = A to Z
' 97-122 = a to z

YourString = "Now is the time...!#$" & vbCrLf

For i = 1 To Len(YourString)
    char = Mid(YourString, i, 1)
    Do
    If blnSkipNbr = True And Asc(char) >= 48 And Asc(char) <= 57 Then Exit Do
    If blnSkipUC = True And Asc(char) >= 65 And Asc(char) <= 90 Then Exit Do
    If blnSkipLC = True And Asc(char) >= 97 And Asc(char) <= 122 Then Exit Do
    If blnSkipSpecial = True And Asc(char) >= 97 And Asc(char) <= 122 Then Exit Do
        Debug.Print "In position " & i & " of string: Char: " & ">" & char & "<" & vbTab & vbTab & "Asc(" & Asc(char) & ")"
        Exit Do
    Loop
Next i
Wayne G. Dunn
  • 4,282
  • 1
  • 12
  • 24
0

It looks like a pipe character.

http://www.computerhope.com/jargon/p/pipe.htm

Open your file in Notepad++ to see all kinds of interesting characters, including characters that are non-printable.

A hex viewer / editor plugin for Notepad++?

Community
  • 1
  • 1
ASH
  • 20,759
  • 19
  • 87
  • 200