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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binary to text

Status
Not open for further replies.

NGee

Technical User
Mar 30, 2006
7
US
I have a program that was created using Gupta Team Builder. We are using SQL Server 2000. They are storing some text fields in as Binary data. The printed Data Dictionary says that this filed called BITS is of LONGVAR type DESCRIPTION Binary Data. I can look at the properties of the table in SQL Server and it shows that fields as image with a size of 16. There is also a field called BITS_LENGTH which is an Integer. When I look at the BITS_LENGTH field it has varying numbers. I need to be able to extract the data back into text in order to use it in an Access Database. This company has an Access Database that is creating reports external from system. Or I can create a VB.NET Report program if necessary. There is a stored procedure on the system that puts the text into the table apparently storing it as binary. I have no clue about this procedure other than to determine that is what is happening. We asked the developers of this program to help..we pay a hugh support contract..they tell us to buy the data dictionary which we did. Doesn't help. Any help will be great!
 
Ok... out on a limb without the data here..

Image fileds are great for storing any type of data.. Text, image, documents, etc.... there is no limit on the size and you just pull the data back into a stream.

The key is knowing what "format" the data is in.

The description seems to indicate that is is just straight text (varchar) on unknown lenght (but the Bits_lenght) probably tells you just how big.

In dotnet, I would read the "image" into a bit array and then try to reassemble the data. The bit array needs to be as long as the data stored there. (bits lenght)

then you should be able to just convert your bit array into a string..

HTH

Rob


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top