how can i use a sql insert statement to insert a picture?
i know i need to use a binary field in my database, and its called blob, but i'm not sure how to insert pictures.
thanks
Printable View
how can i use a sql insert statement to insert a picture?
i know i need to use a binary field in my database, and its called blob, but i'm not sure how to insert pictures.
thanks
Look up AppendChunk and GetChunk.... they are the methods by which one moves data into (AppendChunk) and out of (GetChunk) binary fields.
-tg
would that work with an access database + classic ado?
yes on both accounts.
-tg
ok thanks i'll look it up
See our FAQs & Tutorials at the top of this forum - there is a tutorial specifically about this. ;)
[My Two Cents] unless you need to secure your pictures in a database, I think you would be better off saving the pictures as JPegs and then store the path to the picture in the database. Much more efficient usage of disk space.[/My Two Cents]
In most cases, I would agree.... but we use BLOBs in our app for convience as well.... when ever we have to roll out a new report, or modify an existing one, we stuff it into our DB, then run a script that create a script that inserts the bits... and ship the script off to the necessary client(s). We wouldn't be able to easily deploy things like that other wise. We thought about network shares bvut some of our clients have some extremely strict rules that don't make that a viable option. Plus we also do it to store incoming data that we can later extract for auditing purposes (to get back to the original).
-tg
i reconsidered and decided to save the filenames.
the pictures might be quite large.
thanks for all your help