We help IT Professionals succeed at work.

How to convert a binary variant into text string.

che0089
che0089 asked
on
Medium Priority
200 Views
Last Modified: 2012-08-13
I have lots of Unix text files, and these files are viewed by Oracle 8.1.7 as BFILE, so when I use Oracle Objects for OLE to retrieve these UNIX text files, Oracle returned me a binary variant in my VB component. I can use Response.binarywrite to show the content. But I need to parse these files before displaying. I tries to use strconv in VB, but it does not work, so is there function or component that can convert the binary variant into a text string?

Thanks
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2012

Commented:
The StrConv funtion should have worked.  Did you try
StrConv(x, vbUnicode)?

Anthony

Commented:
You should deffinatly try StrConv Function and use VbUnicode.
CERTIFIED EXPERT
Top Expert 2012

Commented:
vb7guy,

You may have overlooked the following EE guidelines:
"An answer is a specific solution to a question and should be submitted if it will solve the questioner's problem and doesn't duplicate a previous comment."

Anthony
Commented:
My experience with Unix files is that lines are CR-delimited, whereas DOS/Windows lines are CR/LF-delimited.

To adjust for this, you can simply replace:

strMyWinData = Replace(strMyUnixData, vbCR, vbCRLF)

Commented:
Rejecting answer as it duplicates previous comments.  VB 7 guy, please note the guidelines in the following link.

http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp

Also, here in the VB topic area, the etiquette is comment only, unless there is no previous commentary and the question is completely cut and dried with no room for debate.  Even then most experts choose to use comments as the topic area is extremely busy and simultaneous posting is not unusual.  (It is awkward to propose an answer when someone else has proposed the exact same thing seconds earlier, only as a comment.)

Lunchy
Friendly Neighbourhood Community Support Moderator
CERTIFIED EXPERT
Author of the Year 2009

Commented:
Hi che0089,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept rspahitz's comment(s) as an answer.

che0089, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
Per recommendation, force-accepted by
Netminder
Community Support Moderator

Explore More ContentExplore courses, solutions, and other research materials related to this topic.