Retrieving Image data type and converting to string

Posted on 2003-03-06
Medium Priority
Last Modified: 2007-12-19

I'm using ASP to extract data from Microsoft Project 2002 which uses SQL2000 as its back end.  In one particular table, inputted text is stored in a column with Image as the data type.  An entry will look something like this:


I'm using real simple code to extract the data:

          Dim rs
          Dim con
          Dim strCon
          Dim strSQL


          strSQL = "select msp_projects.proj_name, msp_tasks.Task_Name, msp_tasks.Task_rtf_Notes from msp_projects, msp_tasks WHERE msp_projects.PROJ_ID = msp_tasks.PROJ_ID and msp_tasks.PROJ_ID = " & Request.querystring("ProjID")

          strCon = "Driver={SQL SERVER}; server=SQL2000; uid=sa; pwd=portia; database=ProjectServer"
          Set con = Server.createObject("ADODB.Connection")
          con.cursorLocation = adUseClient
          con.open strCon
          Set rs = con.execute(strSQL)
          Do Until rs.EOF          

          Set rs = Nothing
          Set con = Nothing


How do I convert the binary value into the string value?  Initially, the users only need to view the data.  I would like for them to be able to update these fields (I imagine I would have to convert the user-inputted data to binary).  Thanks for your help.

Question by:kmhs
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 28

Accepted Solution

sybe earned 400 total points
ID: 8084111
Function Byte2String(s)
    Dim i
    For i = 1 to LenB(s)
        Byte2String = Byte2String & CHR(AscB(MidB(s,i,1)))
End Function

Function String2Byte(s)
    Dim sChar, i
    For i = 1 to Len(s)
        sChar = Mid(s, i, 1)
        String2Byte = String2Byte & ChrB(Asc(sChar))
End Function


Author Comment

ID: 8195727
Thanks for the help!

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question