Results 1 to 4 of 4

Thread: inserting byte array to a blob field-RESOLVED

  1. #1

    Thread Starter
    Hyperactive Member gtilles's Avatar
    Join Date
    Dec 2004
    Location
    Planet Earth
    Posts
    394

    inserting byte array to a blob field-RESOLVED

    This is a simple version of what I am trying to do, yet my query is underlined with the following:
    Operator '&' is not defined for types 'String' and 'one-dimentional array of byte'
    Code:
    "insert into Sculptures (SCULPTURE_IMAGE) values(" & Me.ImageData & ");"
    Anyone tell me another way to accommplish this? This is a ACCESS Database
    Last edited by gtilles; May 15th, 2008 at 12:22 PM.
    Truly, you have a dizzying intellect.

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    Toronto, ON
    Posts
    1,093

    Re: inserting byte array to a blob field

    The problem is that you're trying to concatenate the byte array into a string before putting it into the database. Since byte arrays and strings are different things, it won't let you do this.

    I'd suggest putting the ImageData into a parameter of type BLOB and adding that parameter to a command object and inserting it that way.
    (VB/C#) is clearly superior to (C#/VB) because it (has/doesn't have) <insert trivial difference here>.

  3. #3
    Frenzied Member
    Join Date
    May 2006
    Location
    Toronto, ON
    Posts
    1,093

    Re: inserting byte array to a blob field

    (VB/C#) is clearly superior to (C#/VB) because it (has/doesn't have) <insert trivial difference here>.

  4. #4

    Thread Starter
    Hyperactive Member gtilles's Avatar
    Join Date
    Dec 2004
    Location
    Planet Earth
    Posts
    394

    Re: inserting byte array to a blob field-RESOLVED

    Thanks,
    As you suggested I ended up using Queries like a Stored Procedure to get the image in to the DB.
    I am familiar with sequel server sprocs to insert images but never Access.
    I previously did years ago a classic ASP where I inserted the image with inline sql to the db after an insert using update. I'm glad my classic asp days are mostly over...
    Truly, you have a dizzying intellect.

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