blanks were not removed

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Is there something piculiar about referencing fields via
RecordsetClone such that builtin functions are ignored
in A2K? There were several instances printed via
Debug.Print where the trailing blanks were not removed,
as you can see in the "Ratto" example.

strTemp = strTemp & "<" & RTrim(Me.RecordsetClone![EmailHome]) & ">;"

"Ratto"<[email protected] >;

Thanks,
Bill
 
Is there a way to hex-dump or ASCI-dump the
troublesome character string? I suspect that the
trailing characters are not blanks??????
 
You can do something like:

Sub DumpCharValue(StringToDump As String)
Dim intLoop As Integer
Dim strCurrChar As String

For intLoop = 1 To Len(StringToDump)
strCurrChar = Mid(StringToDump, intLoop, 1)
Debug.Print "Pos " & intLoop & ": " & _
strCurrChar & _
" ==> " & Asc(strCurrChar)
Next intLoop

End Sub

Here's what the results of that look like in the Immediate window:

DumpCharValue "Doug Steele"
Pos 1: D ==> 68
Pos 2: o ==> 111
Pos 3: u ==> 117
Pos 4: g ==> 103
Pos 5: ==> 32
Pos 6: S ==> 83
Pos 7: t ==> 116
Pos 8: e ==> 101
Pos 9: e ==> 101
Pos 10: l ==> 108
Pos 11: e ==> 101

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Bill said:
Is there a way to hex-dump or ASCI-dump the
troublesome character string? I suspect that the
trailing characters are not blanks??????




Bill said:
Is there something piculiar about referencing fields via
RecordsetClone such that builtin functions are ignored
in A2K? There were several instances printed via
Debug.Print where the trailing blanks were not removed,
as you can see in the "Ratto" example.

strTemp = strTemp & "<" & RTrim(Me.RecordsetClone![EmailHome]) & ">;"

"Ratto"<[email protected] >;

Thanks,
Bill
 
Doug,
The characters that are not "trimming" with the use of
the Trim and/or RTrim are ASC 160. The default code
page (character set) on my Windows XP system define
that as [space], as it does with ASC 32, what I normally
think of when considering ASC codes.

Anyway, The only thing I can think of to clean up the
database is to loop through all the e-mail addresses and
remove the offending characters.

I suspect that since the data originated on a Mac that
the Mac normally uses the 160 code for its rendering
of a space?

Comments please.

Thanks,
Bill


Douglas J Steele said:
You can do something like:

Sub DumpCharValue(StringToDump As String)
Dim intLoop As Integer
Dim strCurrChar As String

For intLoop = 1 To Len(StringToDump)
strCurrChar = Mid(StringToDump, intLoop, 1)
Debug.Print "Pos " & intLoop & ": " & _
strCurrChar & _
" ==> " & Asc(strCurrChar)
Next intLoop

End Sub

Here's what the results of that look like in the Immediate window:

DumpCharValue "Doug Steele"
Pos 1: D ==> 68
Pos 2: o ==> 111
Pos 3: u ==> 117
Pos 4: g ==> 103
Pos 5: ==> 32
Pos 6: S ==> 83
Pos 7: t ==> 116
Pos 8: e ==> 101
Pos 9: e ==> 101
Pos 10: l ==> 108
Pos 11: e ==> 101

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Bill said:
Is there a way to hex-dump or ASCI-dump the
troublesome character string? I suspect that the
trailing characters are not blanks??????




Bill said:
Is there something piculiar about referencing fields via
RecordsetClone such that builtin functions are ignored
in A2K? There were several instances printed via
Debug.Print where the trailing blanks were not removed,
as you can see in the "Ratto" example.

strTemp = strTemp & "<" & RTrim(Me.RecordsetClone![EmailHome]) & ">;"

"Ratto"<[email protected] >;

Thanks,
Bill
 
Sorry, I don't know what Macs use.

Are you getting a bunch of 160s after the address, or only one (possibly
with something else after the 160)?

In either case, you could replace your

strTemp = strTemp & "<" & RTrim(Me.RecordsetClone![EmailHome]) & ">;"

with

Dim intEnd As Integer

intEnd = InStr(Me.RecordsetClone![EmailHome], Chr(160))
If intEnd > 0 Then
strTemp = strTemp & "<" & Left(Me.RecordsetClone![EmailHome], intEnd -
1) & ">;"
Else
strTemp = strTemp & "<" & Me.RecordsetClone![EmailHome] & ">;"
End If

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


Bill said:
Doug,
The characters that are not "trimming" with the use of
the Trim and/or RTrim are ASC 160. The default code
page (character set) on my Windows XP system define
that as [space], as it does with ASC 32, what I normally
think of when considering ASC codes.

Anyway, The only thing I can think of to clean up the
database is to loop through all the e-mail addresses and
remove the offending characters.

I suspect that since the data originated on a Mac that
the Mac normally uses the 160 code for its rendering
of a space?

Comments please.

Thanks,
Bill


Douglas J Steele said:
You can do something like:

Sub DumpCharValue(StringToDump As String)
Dim intLoop As Integer
Dim strCurrChar As String

For intLoop = 1 To Len(StringToDump)
strCurrChar = Mid(StringToDump, intLoop, 1)
Debug.Print "Pos " & intLoop & ": " & _
strCurrChar & _
" ==> " & Asc(strCurrChar)
Next intLoop

End Sub

Here's what the results of that look like in the Immediate window:

DumpCharValue "Doug Steele"
Pos 1: D ==> 68
Pos 2: o ==> 111
Pos 3: u ==> 117
Pos 4: g ==> 103
Pos 5: ==> 32
Pos 6: S ==> 83
Pos 7: t ==> 116
Pos 8: e ==> 101
Pos 9: e ==> 101
Pos 10: l ==> 108
Pos 11: e ==> 101

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


Bill said:
Is there a way to hex-dump or ASCI-dump the
troublesome character string? I suspect that the
trailing characters are not blanks??????




Is there something piculiar about referencing fields via
RecordsetClone such that builtin functions are ignored
in A2K? There were several instances printed via
Debug.Print where the trailing blanks were not removed,
as you can see in the "Ratto" example.

strTemp = strTemp & "<" & RTrim(Me.RecordsetClone![EmailHome]) & ">;"

"Ratto"<[email protected] >;

Thanks,
Bill
 
Anyway, The only thing I can think of to clean up the
database is to loop through all the e-mail addresses and
remove the offending characters.

An Update query will do the trick with no looping and no code:

UPDATE yourtable
SET = Replace([Email], Chr(160), Chr(32))
WHERE Email LIKE "*" & Chr(160) & "*";

John W. Vinson[MVP]
 
Some addresses had 5 or 6 trailing 160's. I just issued a
trim(replace(str,chr(160),chr(32)) and let the functions
clean off the un-wanted 160's. Sort of like what Vinson
suggested only I just inserted the code in a loop that is
part of the code-sheet anyway.

And no, I don't know what the Mac's use either.

Thanks Doug and John,
Bill


Douglas J. Steele said:
Sorry, I don't know what Macs use.

Are you getting a bunch of 160s after the address, or only one (possibly
with something else after the 160)?

In either case, you could replace your

strTemp = strTemp & "<" & RTrim(Me.RecordsetClone![EmailHome]) & ">;"

with

Dim intEnd As Integer

intEnd = InStr(Me.RecordsetClone![EmailHome], Chr(160))
If intEnd > 0 Then
strTemp = strTemp & "<" & Left(Me.RecordsetClone![EmailHome],
intEnd - 1) & ">;"
Else
strTemp = strTemp & "<" & Me.RecordsetClone![EmailHome] & ">;"
End If

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


Bill said:
Doug,
The characters that are not "trimming" with the use of
the Trim and/or RTrim are ASC 160. The default code
page (character set) on my Windows XP system define
that as [space], as it does with ASC 32, what I normally
think of when considering ASC codes.

Anyway, The only thing I can think of to clean up the
database is to loop through all the e-mail addresses and
remove the offending characters.

I suspect that since the data originated on a Mac that
the Mac normally uses the 160 code for its rendering
of a space?

Comments please.

Thanks,
Bill


Douglas J Steele said:
You can do something like:

Sub DumpCharValue(StringToDump As String)
Dim intLoop As Integer
Dim strCurrChar As String

For intLoop = 1 To Len(StringToDump)
strCurrChar = Mid(StringToDump, intLoop, 1)
Debug.Print "Pos " & intLoop & ": " & _
strCurrChar & _
" ==> " & Asc(strCurrChar)
Next intLoop

End Sub

Here's what the results of that look like in the Immediate window:

DumpCharValue "Doug Steele"
Pos 1: D ==> 68
Pos 2: o ==> 111
Pos 3: u ==> 117
Pos 4: g ==> 103
Pos 5: ==> 32
Pos 6: S ==> 83
Pos 7: t ==> 116
Pos 8: e ==> 101
Pos 9: e ==> 101
Pos 10: l ==> 108
Pos 11: e ==> 101

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


Is there a way to hex-dump or ASCI-dump the
troublesome character string? I suspect that the
trailing characters are not blanks??????




Is there something piculiar about referencing fields via
RecordsetClone such that builtin functions are ignored
in A2K? There were several instances printed via
Debug.Print where the trailing blanks were not removed,
as you can see in the "Ratto" example.

strTemp = strTemp & "<" & RTrim(Me.RecordsetClone![EmailHome]) & ">;"

"Ratto"<[email protected] >;

Thanks,
Bill
 
Back
Top