INSERT ASCII Character 0

E

Eric

Hi all, I'm am trying to insert some encrypted text into a record using the
INSERT statement. The problem is, the encrypted text may contain ASCII
character 0. Access doesn't like this much. Is there a way to escape this
character to get it to insert (or update) properly? Thanks for your help!!

Eric
 
P

Pieter Wijnen

if it is not to long (127 chars ... ) you can convert it to its numerical
value & store that (in a memo field will always work)

Function str2Hex(ByVal code As String) As String
Dim i As Long
Dim ret As String

For i = 1 To Len(code)
ret = ret & Format(Hex(Asc(Mid(code, i, 1))), "00")
Next
str2Hex = ret
End Function

The other way I leave as an exercise

hth
Pieter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top