|
|
#1 |
|
Lively Member
Join Date: Jun 05
Posts: 81
![]() |
Obtain the picture from an OLE field type of ACCESS database
Obtain the picture from an OLE field type of ACCESS database
I need to set a picture property of a commandbutton dinamically (at run-time) according to an OLE type field of ACCESS database. commandbutton1.Picture = recordset !Olefieldname 'ERROR TYPE MISMATCH plz help |
|
|
|
|
|
#2 |
|
PowerPoster
Join Date: Mar 04
Location: New Amsterdam
Posts: 21,118
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Obtain the picture from an OLE field type of ACCESS database
Search through my posts - I have two procedures posted: one to store files and one to read them back.
|
|
|
|
|
|
#3 |
|
Banned
Join Date: Jun 04
Location: Center of it all
Posts: 17,901
![]() ![]() ![]() ![]() ![]() ![]() |
Re: Obtain the picture from an OLE field type of ACCESS database
Try this. I'm not sure if you can load any type of picture onto a command button. Why don't you use a Picturebox, and use it's click event as a button?
VB Code:
|
|
|
|
|
|
#4 | |
|
Super Moderator
Join Date: Apr 01
Location: LA, Calif. Raiders #1 AKA:Gangsta Yoda™
Posts: 58,875
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Obtain the picture from an OLE field type of ACCESS database
Quote:
__________________
VB/Office Guru™ (AKA: Gangsta Yoda™ I dont answer coding questions via PM. Please post a thread in the appropriate forum. ![]() ![]() Microsoft MVP 2006, 2007, 2008, 2009, 2010 Office Development FAQ (VBA, VB 6, VB.NET, C#) Software Engineer MCP (VB 6 & .NET), BSEE, CET If a post has helped you then Please Rate it! • Star Wars Gangsta Rap • Reps & Rating Posts • VS.NET on Vista (New) • Multiple .NET Framework Versions (New) • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility • System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007 |
|
|
|
|
|
|
#5 |
|
PowerPoster
Join Date: Mar 04
Location: New Amsterdam
Posts: 21,118
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Obtain the picture from an OLE field type of ACCESS database
You have to extract file first, store it on the hard disk and then use LoadPicture() to actually load image into whatever control ...
|
|
|
|
|
|
#6 |
|
Lively Member
Join Date: Jun 05
Posts: 81
![]() |
Re: Obtain the picture from an OLE field type of ACCESS database
it doesnt work:
commandbutton1.Picture = LoadPicture(recordset !Olefieldname) ok, i have to save the pic to hdd, but how can I do this? plz, help, im very new in VB. |
|
|
|
|
|
#7 |
|
PowerPoster
Join Date: Mar 04
Location: New Amsterdam
Posts: 21,118
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Obtain the picture from an OLE field type of ACCESS database
Here is a "ready-to-go" logic to extract image from database and load it into the Image control or Picturebox (your choice - read my comments):
VB Code:
|
|
|
|
|
|
#8 |
|
Lively Member
Join Date: Jun 05
Posts: 81
![]() |
Re: Obtain the picture from an OLE field type of ACCESS database
ERROR: invalid picture
i just put the pic into the access as ole object.. |
|
|
|
|
|
#9 |
|
PowerPoster
Join Date: Mar 04
Location: New Amsterdam
Posts: 21,118
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Obtain the picture from an OLE field type of ACCESS database
I have no clue how you do it so if you want then take a look at my replies in this thread .
|
|
|
|
|
|
#10 |
|
New Member
Join Date: Nov 05
Posts: 1
![]() |
Re: Obtain the picture from an OLE field type of ACCESS database
hi, i wanted to use the ole pictures stored to be displayed in php. but all i get is gibberish after i convert the hex to string. is it my header wrong? my header is content-type : image/jpeg (this is done in separate file called test.php). then, another php content is <img src="test.php?id=123"> calling test.php
still no image.. please help :-( |
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|