Tip:
Highlight text to annotate it
X
I've made a copy
of odb14 form properties
and renamed this copy to odb15
embedding pictures. I've taken some pictures
of my employees and I want the pictures of the employees to show up
when I bring up his or her record to keep things simple
I've placed all the photos in a folder and I did take all these pictures myself so
although probably not the best quality they will work
for our database example we're going to
embed these pictures into our database meaning we want our photo
to be stored on the database table so the first thing I want to do
is going to our tables we need to
edit this, right click Edit
going to add a field
at the bottom we will call this
employee-picture
but we don't want this to have a type up text
we want this to have a type of
image long var binary
let's save this table and save our database
now we want to
edit our form so I'm going to forms I'm going to right click
and edit the first thing we notice is something's wrong here our background is
missing
that's because I updated Libra office
to version 4.1 and when I did
the background from the gallery is missing let's go back
and open our other form and this is the background that we created
with the form wizard and that one is okay
coming back for other form
I'm going to go back to the gallery and
re-add the background when I click and gallery
the first thing we noticed is some arrows
so it looks like in LibreOffice version
4.1 they added more themes. we've got arrows
we've got computers, diagrams,
finance, so they've added quite a bit more
to the gallery. let's go back to backgrounds and
I had light-sand actually I think was sand -light
this looks like it here
sand light I need to right click
insert background page
and its back
and it looks likely that it's more backgrounds in here too. I''m going to close
the gallery
now we're back to adding a photo
to do that I want to come over
and click on the more controls inside here if get
two buttons for image one says is image button
the other is image control we want the
image control I'm going to click that coming down to
one of the corners and I'm going to drag this up
and will make he available picture size:
right here. I'm going to right click and this
to bring up our properties dialog box
by clicking control first thing I want to do is change the name
I'm going to call this img employee picture
now I want to go over to the data tab
clicking the down-
arrow and selecting employee picture. going back to the General tab
a few other changes I want to make
are in the background color we're going to make this light gray
and I'm going to darken up to border just a little bit
by making that gray and one last thing I want to add
is some help text and am going to type in
"Right Click to Add a Picture" let's close this
I'm going to save the form
close it save our database
in now I'm going to open up our form
and here we see we don't have any pictures in here yet
when I put my arrow over our picture area
it says right click to add a picture in that help text
we couldn't help text all these fields
but I just didn't think of it, at the time
right click to add a picture. I'm going to right click
and it brings up a button "insert graphics from"
I'm going to left click the button
and it brings up our pictures
our first person in is Brian Adams
so I will click the picture open
and the picture gets added. let's go to our next record
Patricia Anderson and go in and to our
picture area right click in insert graphic from
Patricia Anderson open
adding one more third record in
We've got david Browne
so that's how we insert in embedded picture
I get three of them out there I'm going to save this record
going to close the form now I'm going to
save as the entire database with the same name but I'm calling this
backup
one. Now I'm going to
close the database and reopen
odb15 embeded pictures
opening up the form. Now I'm
going to add in our next three pictures and we've got nancy clark
Betty Garcia now
I'm adding these in, just a few at a time
because when I tried to add too many pictures at one time
my database crashed and it wiped out
the entire table. the we have found at all these in
is to add them two or three at a time and
you can in bed are you pictures. I've added
all the pictures I have, not every employee has a picture
but most do and I'm showing that
we can add multiple pictures without crashing the database
but remember how I did it I made backups every few pictures
here we see, we meet a copy of odb14
form properties which was 63 kilobytes
the we added our first three pictures and we made a backup
he became 6,000 kilobytes and I kept
making backups then closing and reopening
our database, until I got up to what we have here with the
forty thousand kilobytes so our file size:
is quite large I know most if you're thinking
will get plenty of disk space it's not a problem the problem becomes
when we open in close our table
we don't seem much difference
right here going back and forth between the records
closing the form shouldn't be a problem
but here even though we didn't make any changes
just closing the database will take
a lot more time than we're used to seeing so you need to have a little more
patience
when you're working with files have this size all
all cool