CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    picture in access database

    ok, what am I missing... I create an Access database succesfully in code. Now I need to insert pictures to the database.
    The picture comes from an SQL server database.
    I define the field as adLongVarBinary with a defined size of 1073741824. I use that since that's the type and defined size of an OLE Object field when I create manually with access a OLE field.
    I can fill it, that works fine, but as soon as I go to Access, and double-click on the field, it tells me that Access can't communicate with the OLE server and that I have to restart that OLE server, it doesn't tell me though which/what/why...
    Again, when I create it manually in Access and insert an ole object thru the insert-menu, it works fine...
    Has anyone any idea what I'm supposed to do with that error? And even better, how do I get rid of it so that it works the way I (and the customer...) want?
    Tnx in advance!

    Crazy D @ Work :-)

  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: picture in access database

    MSDN article Q194975 has all the source code for reading and writing BLOBs to and from a jet database.


  3. #3
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: picture in access database

    It still doesn't work... I keep getting the same error, "A problem occured while MS Access was communicating with the OLE server. Close the OLE server and restart it outside of MS Access. Then try the original operation again in MS Access".
    Since it does work if I use Insert Object within Access, I assume it has something to do with some sort of sign that Access knows what kind of OLE object it is. (if I insert a bitmap in Access, the field displays "Bitmap Image", when I use the code from the knowledge base, the field shows "Long binairy data")


    Crazy D @ Work :-)

  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: picture in access database

    you are right, there is something special about the way access deals with OLE objects. I just can't find the %$§@! MSDN article I read a few days ago about that subject.
    maybe you want to try your luck on MSDN yourself.



  5. #5
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: picture in access database

    I think I read the whole MSDN.. *LOL* ok almost :-) I can't even think of a subject to search for anymore... it drives me crazy...


    Crazy D @ Work :-)

  6. #6
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: picture in access database

    Little update...
    the sample code as in the mentioned knowledge base article works indeed, but, the saved picture (photo1.dat) can't be opened by any other program, and as soon as I replace that file with my picture, it doesn't work.
    Also, when I try the save code on my sql server, the picture is saved succesfully, but it still doesn't work when i load it into the northwind database... so this is just a piece of &(*&#@# ... OLE sucks *LOL*


    Crazy D @ Work :-)

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

Featured