ByteArray Object Problem

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default ByteArray Object Problem

    Hi,

    I have a binary field that contains SessionId. Iam retriving the sessionid
    from the database and trying to pass that value in the <cflocation> tag. It is
    giving errro as "ByteArray Object cannot be converted to Strings". Any solution
    for this error?

    Thanks in Advance

    Regards
    Rauf Khan

    BIZ_CF Guest

  2. Similar Questions and Discussions

    1. SharedObject - ByteArray
      Dear all, I have a problem with a SharedObject remote and flash media server (I'm using Flex obviously :-D). I have to store a custom class in a...
    2. Put String into a ByteArray
      Hi: I have a String variable with the result of an SQL 2005 varbinary field. Can anybody tell me how to put this information into a ByteArray...
    3. ByteArray object to string
      Hi, I am trying to connect to an AS400 database. The query runs fine and returns values . But when I try and display some of the values ,I get an...
    4. Issue with AS/400 DB2 query | ByteArray object error
      We are running MX6.1 and just came across an error from data retrieved from our AS/400 (iSeries). We are receiving the 'ByteArray objects cannot be...
    5. Custom Control Problem :: Object reference not set to an instance of an object
      Hi All! I have the following Custom Control file... '########### WebUserControl1.ascx ############# <%@ Control Language="vb"...
  3. #2

    Default Re: ByteArray Object Problem

    you'll need to encode the data before you can pass it on a url.

    Why may I ask are you using Binary data for a sesison ID?
    david_h Guest

  4. #3

    Default Re: ByteArray Object Problem

    Our product is in Coldfusion 5, right now iam upgrading it to Coldfusion
    MX7. Here we r storing the generated sessionid in the database and we are
    verifying this as we proceed further by retriving the value from the database.
    Also we are passing the si value in the URL by using <CFLOCATION> tag. This si
    value is in binary form.

    For coldfusion 5 as we pass the binary value in <CFLOCATION> tag, it was
    not a problem. But in Coldfusion MX it is giving problem as
    "================================================= ==
    Error Occurred While Processing Request
    ByteArray objects cannot be converted to strings.

    Please try the following:
    Enable Robust Exception Information to provide greater detail about the source
    of errors. In the Administrator, click Debugging & Logging > Debugging
    Settings, and select the Robust Exception Information option.
    Check the ColdFusion documentation to verify that you are using the correct
    syntax.
    Search the Knowledge Base to find a solution to your problem.
    ================================================== ========================"

    I have tried by using the following encodes,"BinaryEncode,BinaryDecode,
    BinaryEncode, CharsetDecode" again it is giving the same problem.

    Any solution?



    BIZ_CF Guest

  5. #4

    Default Re: ByteArray Object Problem

    Hi,

    Got the solution after a great R&D.

    If ur getting an error "ByteArray Object cannot be converted to String"
    Follow this procedure. Here #id# is a ByteArray Object

    <cfset aAbcArray = ArrayNew(1)>
    <cfset aAbcArray[1] = #id#>
    <cfset ArrayAppend(aAbcArray, "")>
    <cfset one = aAbcArray>
    <cfset one = #BinaryEncode(#id#,'Hex')#>
    <cfoutput>#one<cfoutput>

    Remember ByteArray Object is a complex data type and cannot be
    converted to simple data type. If u find this problem then use the array value
    directly instead of #one# value. Like this 'aAbcArray.value'

    Rauf

    BIZ_CF Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139