I have a database to record outputs of testing results, everything works fine, however when I copy and paste even one screen print into image box moving between records takes at least a minute.
Access is not good for storing images in the db. Keep your images in a folder and link it to the db.
Form with Linked Pictures thread702-1116048 might give you an example
________________________________________________________________________
Zameer Abdulla Visit Me A person who misses a chance and the monkey who misses its branch can't be saved.
Thank you for the link, however, I cannot use file link because there are no files. All of the images are not stored individually, each image is a screen capture.
When I did this, I used my own method for storing pictures in the database and for retrieving them. All this involved was using AppendChunk and GetChunk.
I had no database speed issues and I never knew there could be until your post. My main reason for doing it in my app was because I wanted to store compressed JPG's and not the full bitmap.
To use a method like mine, you will need to do a little bit of API work and grap some DLL's but to do it in a very basic way, you could do the following:
Save your bitmap to disk as a temporary name.
Read the saved file into a array of Byte
use appendchunk to store this in an OLE Object field in a database.
For retrieving:
use getchunk to retrieve the data into a byte array
save the byte array to disk
load the file into a picture object
It might be worth a test to see if it helps. Perhaps the speed issue is not so much to do with the amount of data in the field but the type. Perhaps binary data is better than a "real" OLE Object for storage..
PCLewis, thank you. I really helped to move from record to record, I am still having a delay between pasting an image in the field and next step. But it's already much better.
OK since you tuned a suggestion into code and seemed to get good results, you obviously know how to program. So I will let you know the rest of how I did it.
I used a class I got from the VBAccelerator site called cDIBSection (at least I am pretty sure it was form there). This nice little class is able to handle lots of useful features to turn things like the contents of a VB Picture control into a device independent bitmap. What I am thinking is, that the class which only needs a device context form which to obtain the image data, could be made to pull that from the clipboard instead. I'm guessing the delay in pasting is more to do with background windows stuff than Access per-se.
I think if you grab that class, you migth be able to use it well. I found this link - looks updated from my copy.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.