 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Michael Corby Guest
|
Posted: Wed Oct 11, 2006 10:13 pm Post subject: Images in Microsoft Access |
|
|
Hi
I am loading Jpeg images to a OLE Object field in Access using
LoadFromStream in my code.
When I then examine the table in Access, the information displayed
in the field column has changed from "Package" to "Long Binary Data",
and double clicking on the column no longer displays the image, but
gives a message "A problem occurred while communicating with the
OLE Server or ActiveX control".
The following is the code for updating the Database :-
TField *field = (wDataModule->tPlants->FieldByName("JPGImage"));
TBlobField *blobField = dynamic_cast<TBlobField*>(field);
String pictureName;
TMemoryStream *stream = new TMemoryStream;
pictureName = "C:\\MC\\Images\\Tulips.jpg";
stream->LoadFromFile(pictureName);
wDataModule->tPlants->Edit();
blobField->LoadFromStream(stream);
wDataModule->tPlants->Post();
delete stream;
delete field;
Any help appreciated
Michael Corby |
|
| Back to top |
|
 |
Antonio Felix Guest
|
Posted: Wed Oct 11, 2006 10:39 pm Post subject: Re: Images in Microsoft Access |
|
|
"Michael Corby" <mcorby (AT) indigo (DOT) ie> wrote:
| Quote: | Hi
I am loading Jpeg images to a OLE Object field in Access using
LoadFromStream in my code.
When I then examine the table in Access, the information displayed
in the field column has changed from "Package" to "Long Binary Data",
and double clicking on the column no longer displays the image, but
gives a message "A problem occurred while communicating with the
OLE Server or ActiveX control".
|
Hi Michael,
Try to use
....
wDataModule->tPlants->Edit();
stream->Position = 0; // <-----------
blobField->LoadFromStream(stream);
wDataModule->tPlants->Post();
....
HTH
Antonio |
|
| Back to top |
|
 |
Michael Corby Guest
|
Posted: Thu Oct 12, 2006 6:18 pm Post subject: Re: Images in Microsoft Access |
|
|
Hi Antonio
Inserting this line
| Quote: | stream->Position = 0;
makes no difference to attempting to display when Access |
is loaded, but I am now able to display the images
on my form, which is what I wanted.
Thanks for the help.
Michael Corby
"Antonio Felix" <nomail (AT) nm (DOT) pt> wrote in message
news:452d2c3c$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
"Michael Corby" <mcorby (AT) indigo (DOT) ie> wrote:
Hi
I am loading Jpeg images to a OLE Object field in Access using
LoadFromStream in my code.
When I then examine the table in Access, the information displayed
in the field column has changed from "Package" to "Long Binary Data",
and double clicking on the column no longer displays the image, but
gives a message "A problem occurred while communicating with the
OLE Server or ActiveX control".
Hi Michael,
Try to use
...
wDataModule->tPlants->Edit();
stream->Position = 0; // <-----------
blobField->LoadFromStream(stream);
wDataModule->tPlants->Post();
...
HTH
Antonio |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|