Binary To Decimal Conversion

  • Thread starter Thread starter JohnV
  • Start date Start date
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
 
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
 
Back
Top