Access newbie picture question

  • Thread starter Thread starter Pete Davis
  • Start date Start date
P

Pete Davis

I have to store some pictures in the database. Storing them in the
filesystem is unacceptable for various reasons.

I have done very little access programming, but I'm trying to help a client
get this set up.

What I need s a simple way to add a new image to the database. I have a
field for placing the filename and then a button that I want them to press
to import the data, and that's where I'm stuck. How, in access, do I read in
the file and place the data into the appropriate field?

My table is called Picture and has the following:

PictureID: Autonumber
PropertyDetailsID: Number (reference to the record the picture is
associated with)
PictureNumber: Number (used to number the pictures associated with the
property, beginning at 1.
PictureData : OleObject (The actual picture data).

So, after pressing the button, how do I move the data from the file to the
database?

The second question is, is there a way to display the FileOpen dialog from
within access instead of requiring the user to type in the filename?

Thanks.

Pete
 
There's an article and example download here:
http://jamiessoftware.tk/articles.html
See an example of the code for the FileOpen dialog in the getBinary
download.

Storing the images as BLOBs will work fine but images can only be displayed
on single view forms not continuous. See also
http://www.mvps.org/access/bugs/bugs0044.htm for info on the GPF fault bug
encountered when moving to the next image too quickly.

If you want to use continuous forms/reports to display images then consider
the DBPix control (starts at $99 and is easier for a novice to use):
http://www.ammara.com/

Jamie
www.jamiessoftware.tk
 
Jamie,

Thanks for the information. Another newbie question, what's a "continuous
form"?

I have three forms. It's for a real estate company. They have a Rental
Form and a For Sale form. Both of these forms use a Property Details form as
a sub form for the data they share in common. The pictures would go on the
Property Details form.

Pete

--
http://www.petedavis.net
Jamie said:
There's an article and example download here:
http://jamiessoftware.tk/articles.html
See an example of the code for the FileOpen dialog in the getBinary
download.

Storing the images as BLOBs will work fine but images can only be displayed
on single view forms not continuous. See also
http://www.mvps.org/access/bugs/bugs0044.htm for info on the GPF fault bug
encountered when moving to the next image too quickly.

If you want to use continuous forms/reports to display images then consider
the DBPix control (starts at $99 and is easier for a novice to use):
http://www.ammara.com/

Jamie
www.jamiessoftware.tk


Pete Davis said:
I have to store some pictures in the database. Storing them in the
filesystem is unacceptable for various reasons.

I have done very little access programming, but I'm trying to help a client
get this set up.

What I need s a simple way to add a new image to the database. I have a
field for placing the filename and then a button that I want them to press
to import the data, and that's where I'm stuck. How, in access, do I
read
 
While the DBPix control is an excellent reccomendation your statement
that it supports forms in Continuous view is incorrect. Yes I have seen
the example on the DBPix control Web site but it is not a form in
Continuous view.

Another solution to allow for the storage of the original Image directly
within a table without the OLE object overhead is here:
http://www.lebans.com/loadsavejpeg.htm
LoadSaveJpeg.zip contains a database demonstrating how to use the Intel
Jpeg library with Access. Jpeg files are stored in their original
compressed state within a Binary OLE avoiding the Ole object "bloat"
issue.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Pete Davis said:
Jamie,

Thanks for the information. Another newbie question, what's a "continuous
form"?

I have three forms. It's for a real estate company. They have a Rental
Form and a For Sale form. Both of these forms use a Property Details form as
a sub form for the data they share in common. The pictures would go on the
Property Details form.

Pete

--
http://www.petedavis.net
Jamie said:
There's an article and example download here:
http://jamiessoftware.tk/articles.html
See an example of the code for the FileOpen dialog in the getBinary
download.

Storing the images as BLOBs will work fine but images can only be displayed
on single view forms not continuous. See also
http://www.mvps.org/access/bugs/bugs0044.htm for info on the GPF fault bug
encountered when moving to the next image too quickly.

If you want to use continuous forms/reports to display images then consider
the DBPix control (starts at $99 and is easier for a novice to use):
http://www.ammara.com/

Jamie
www.jamiessoftware.tk


a
client
to
I
file to
the dialog
 
Thanks Stephen for setting me straight on this - admittedly I just scanned
the page and didn't really look closely at what it said. (shame on me!)

I've updated the links at the foot of the article to point to your
LoadSaveJpeg page - hope you don't mind :-) (I already had your Image FAQ
link there anyway)

Jamie
www.jamiessoftware.tk
 
Back
Top