Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I convert binary to string?

Status
Not open for further replies.

Enea

Technical User
Feb 23, 2005
90
US
I am using a linked table to create a query.
One of the fields in the table is of binary datatype.

Is there a way to convert it to string?
 
Maybe. It depends on what the 'binary' is. If it is text stored as a number, you'd have to know the DBM's storing method to convert it. Perhaps you are interested in formatting a 0 or 1 as a yes or no? That would be the format function.
 
Thanks lameid.
The binary is a number like the following:
0047025756EF34BB4BC780965A31E9EBDBA5 but it displays something like: ?????????
 


That's hexadecimal not binary.

So is this data from a MAINFRAME?

If so, it may be EBCDIC rather than ASCII code.

Skip,

[glasses] [red]Be Advised![/red] A Last Will and Testament is...
A Dead Giveaway! [tongue]
 


could be something like this...
Code:
    Dim s As String, str As String, i As Integer
    s = "0047025756EF34BB4BC780965A31E9EBDBA5"
    For i = 1 To Len(s) Step 2
        str = str & Chr("&h" & Mid(s, i, 2))
    Next
but its gobbly gook.

Skip,

[glasses] [red]Be Advised![/red] A Last Will and Testament is...
A Dead Giveaway! [tongue]
 
It displays "?????" instead of the data? Either Access doesn't know how to display it or it isn't passing correctly.

What product is the database in? Maybe you can get updated drivers for connecting to the product?
I'm guessing you are using ODBC. If you are using SQL server try finding the latest MDAC for your version of SQL server and installing it.

In the case of "0047025756EF34BB4BC780965A31E9EBDBA5" do you want to see that value or use it? If using it, I suspect you are using it for something, what (is it a file a number)?

 
Thank you both for your kind reply. What is displayed is not a series of ? but strange characters which were converted into ? but the browser in this case.
Anyohow I will research about the latest MDAC. Indeed my connection is to an SQL Server db.

Thanks,

E...
 


That indicates unprintable characters -- gobbly gook

Skip,

[glasses] [red]Be Advised![/red] A Last Will and Testament is...
A Dead Giveaway! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top