Avatar billede hjbe Nybegynder
29. august 2005 - 11:53 Der er 14 kommentarer og
1 løsning

Export af Ole-Object

Jeg har en Dtabel med billeder liggende i et OLE-Objekt felt, sammen med felt: Fornavn, og Efternavn.
Er der nogen der kender en måde hvorpå jeg kan exportere billederne ud så de kommer til at ligge som jpg filer med filnavnet sådan her: Fornavn_Efternavn.jpg.
Avatar billede terry Ekspert
29. august 2005 - 12:52 #1
If you dont get a solution with this then drop a comment and I will see if I can help you on the way.

Rather busy right now :o)
Avatar billede hjbe Nybegynder
30. august 2005 - 09:52 #2
I still don't have a solution.

Please help !!!
Avatar billede terry Ekspert
30. august 2005 - 10:08 #3
I think I have some code at home which may be able to extract the files from the database. The only problem is that it may be necessary to remove a number of bytes (characters) from the start of the file before it will be recoognised as a JPG file. This is if you have put the file in the database through an OLE object such as MS Paint (on a form).

How have you putthe files in the dB?
Avatar billede hjbe Nybegynder
30. august 2005 - 13:16 #4
Sorry, have been out a few hours.
The pictures have been imported from a Digital Camera. And are stored as BLOB's
Avatar billede terry Ekspert
30. august 2005 - 19:43 #5
Here is a link which explains how to extract a BLOB file from Access using DAO.
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q103257&

The code I have is very similar to this.
Avatar billede terry Ekspert
31. august 2005 - 14:04 #6
have you looked at this hjbe?
Avatar billede hjbe Nybegynder
31. august 2005 - 14:49 #7
Sorry not yet, I will look tomorrow :-)
Avatar billede hjbe Nybegynder
01. september 2005 - 10:34 #8
Have tried it now, but i am a little stuck.
I presume its the WriteBLOB I have to use.
When I put in the name of the table and the field in the sentance as :

=WriteBLOB([phototable];[photo];"d:\photo")
it comes up with an error ?

Have you tried it ?
Avatar billede terry Ekspert
01. september 2005 - 11:09 #9
If you look at the example (copyfile) further down the page, you will see that T (table name) is actually a recordset.

(Set T = db.OpenRecordset("BLOB", dbOpenTable))


Yes I have tried it!
Avatar billede terry Ekspert
01. september 2005 - 11:12 #10
But you will also need to make routine which loops through the recordset and for each record in the recordset call WriteBlob.´

I'm rather busy at the moment, but if you can send my your database (or a small example) I will try and put something together for you this evening.

eksperten@NOSPAMsanthell.dk

remove NOSPAM
Avatar billede hjbe Nybegynder
01. september 2005 - 11:37 #11
Hi Terry
I have sent you an example !
Thanks for now
Avatar billede terry Ekspert
02. september 2005 - 12:09 #12
hi hjbe
have you seen the eamil I sent yesterday?
Avatar billede hjbe Nybegynder
02. september 2005 - 12:19 #13
Yes, I am looking at right now.
It seems that the problem with getting to see the exported pictures is not there on the original db.
So thanks very much, you earned the points
Avatar billede terry Ekspert
02. september 2005 - 13:10 #14
So you can see the pictures OK?

and thnk you too
Avatar billede hjbe Nybegynder
02. september 2005 - 13:11 #15
Yes the pictures come out allright.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester