1

I inherited a database with about 5000 records in it. Each record as an embedded OLE with a picture. I want to move all of the pictures out of the database and replace them with a filepath. What would be the best way to go about doing this?

DasPete
  • 831
  • 2
  • 18
  • 37
  • This may help: http://stackoverflow.com/questions/3398437/store-byte-in-access-2010/3398696#3398696 – Fionnuala Jan 14 '13 at 20:13
  • Thanks @Remou that looks promising, I gave it a go but got an error. It simply said "Write to file failed", error god 3004. Any thoughts? – DasPete Jan 14 '13 at 20:32
  • do I need to loop through the recordset? Does the your example assume the query will return only one item? – DasPete Jan 14 '13 at 20:35
  • I have just been testing and you can forget that link, there is a problem with the wrapper. Give me a few minutes. – Fionnuala Jan 14 '13 at 20:40
  • 1
    Try http://www.lebans.com/oletodisk.htm I have not tested, but it is by Lebans. – Fionnuala Jan 14 '13 at 20:59
  • What are your picture types? If they are bmp, you are probably better off than if they are jpg or mixed. – Fionnuala Jan 15 '13 at 00:22
  • @Remou taht lebans code is working great. However, once I get through about 150 of the 5000 records I get an error that says "out of memory" I have 80 gigs free at the target, so I don't think that's it. I also tried clearing the clipboard every 50 records but that didn't do it either. Any thoughts? – DasPete Jan 17 '13 at 20:05
  • @Remou, yes, thankfully they are bmp – DasPete Jan 17 '13 at 20:10
  • No, I am afraid not. I cannot use Lebans on my current 64 bit set up. See if this helps http://computer-programming-forum.com/1-vba/ec07ca179dc9768b.htm – Fionnuala Jan 17 '13 at 20:27
  • Thanks, that's how I went about clearing the clipboard every 50th record. I tried moving it to every record but still not having any luck. – DasPete Jan 17 '13 at 20:43
  • It seems like a peculiar problem. I added a text box to the form so that I could easily resume from where I left off after access crashes. So I saved 148 pictures then closed access and opened it again and tried to resume from record 149 but still got the same error as before "out of memory." I know it's not disk space, I've still got almost 80 gigs left after saving the first 148 records. just not sure what would be causing this. – DasPete Jan 17 '13 at 20:53
  • Is there anything in task manager? Perhaps your db remains in memory? – Fionnuala Jan 17 '13 at 21:06
  • No, task manager was clear. I thought maybe it was some sort of strange restriction on number bmp's per folder or something. So I set the code up to make a new folder every 100 records and put the next 100 in a new folder and that still stops my at 148. It is the strangest thing. I am not sure what the problem is. – DasPete Jan 17 '13 at 21:24
  • I am sorry, but it is late here and I am not up to considering this any further. I will see if I can think of anything tomorrow. – Fionnuala Jan 17 '13 at 21:30
  • @Remou no worries! You have been very helpful. Thanks so much! – DasPete Jan 17 '13 at 21:37

0 Answers0