Binary To Decimal Conversion

J

JohnV

I am reposting this question:

I have a DB2 table that I am linking to and there is a
field that is a Binary Data Type. This field contains a
customer ID. I would like to convert this field to
something I can view, most preferably a text field as I am
unsure if there are any hyphens ("-"), etc, in the field.

Regards,
JohnV
 
I

Ivar Svendsen

Hello.

The binary data is stored as a variant/byte array. To
convert this to characters, you can use this code:


dim txt as string
dim i as long

for i = lbound(bin) to ubound(bin)
txt = txt & chr(bin(i))
next
 

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