Retrieving Binary data from a database using ASP

I have information stored in a table with the coloumn set to binary data. What I need to know is how to retrieve it and print it on an ASP page. I have tried the response.BinaryWrite with no result. What should I do?
The binary data is URL encoded. Is there any funktion in ASp for URLDecoding?
Who is Participating?
sybeConnect With a Mentor Commented:
URLDecoding in ASP can be done. The following 2 functions each do the job:

<script language=JavaScript RUNAT=Server>
function JSUrlDecode(str) {
      return unescape(str):

Function URLDecode(str)
   strInput = str
   If strInput = null Then strInput = ""
   ' First convert the + to space
   strOutput = REPLACE(strInput, "+", " ")
   ' Then convert the %number to normal code
   strSplit = Split(strOutput, "%")
   If ubound(strSplit) > 0 Then
      i = 0
      strOutput = strSplit(i)
      Do While i < ubound(strSplit)
         HexCode =  "&H" & Left(strSplit(i+1),2)
         Letter = CHR(HexCode)
         strOutput = strOutput & Letter & Right(strSplit(i+1),len(strSplit(i+1))-2)
         i = i + 1
   End If
   URLDecode = strOutput
End Function

' Call the functions by:
NewString = URLDecode(OldString)
'or by
NewString = JSUrlDecode(OldString)

By the way, urldecoded data should not be binary, it is normal text, using a minimal set of ASCII values.

MHQAuthor Commented:
I can extract almost all data using a simpe <% = database("text") %> It is still URL encoded though. And, for some reason, I ca'nt retrieve two of the fields.
MHQAuthor Commented:
Don't bother about the two fields, found THAT error...
MHQAuthor Commented:
That did the trick. I apreciate the help!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.