Results 1 to 7 of 7

Thread: Binary

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Binary

    I have a field in a database that is stored as binary.
    I retrieve it into a string variable. How can I read it?
    Don't anthropomorphize computers -- they hate it

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    Most binary data is the memory representation of a datatype, like double, for example, or a UDT

    What datatype(s) is this supposed to be?

  3. #3

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    It is a datatype.

    I want to know how I can read it from a string as oppose to from a file. If I use the open statement I get a file not found error.

    Thanks,
    Don't anthropomorphize computers -- they hate it

  4. #4
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    You should use a byte array to read it.

    VB Code:
    1. Dim ByteAry() as Byte
    2. Dim strRet as String
    3.  
    4. 'todo: read into ByteAry
    5.  
    6. 'use Str Conversion to turn ACSii, into unicode(B-STR)
    7. strRet = Strconv(ByteAry, vbUnicode)

  5. #5

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    But how do I read it into a bytearray?
    I have the value in a string variable.
    Don't anthropomorphize computers -- they hate it

  6. #6
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Originally posted by vbgladiator
    But how do I read it into a bytearray?
    I have the value in a string variable.
    Uhm. If you're inputing a string into a database it's going to take twice the space.

    You do it like you use a string. It's easy.

  7. #7

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    No, I have the value in a memo field in an access database.
    I retrieve the value into a string variable.

    now, I need to be able to read it. It is used to pass it into a C dll but I need to read it in VB

    Thanks,
    Don't anthropomorphize computers -- they hate it

Posting Permissions

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



Click Here to Expand Forum to Full Width