advertisement
from the IT department...
How to save and image to msaccess using vb 6 code?
Programming languages. topic
Posted by Allan on 19 April, 2005 - 3:18 pm
Can anyone give a source code on how to save and retrive a image to msaccess database using vb 6 code?

Thanks in advance..


Posted by Anonymous on 27 April, 2005 - 6:53 pm
http://www.vbcity.com/forums/topic.asp?tid=78778

try that link
does this make sense also:
(a) Create a database file (MS ACCESS) having a DATAFIELD name (say image1).

(b) Place a DATA component (say DATA1) in main vb form. Select this DATA1 component and then select database name property and browse for above MS ACCESS file and select to open the file. This will save the file path.

(c) Place a text box (say text8) in vb form and set it's visible property to false. Also, select DATASOURCE property
(say DATA1) and DATAFIELD(say image1).

(d) Place a common dialog box in your form (say commondialog1).

(e) Place an image box component in your form (say image1)

(f) Now, this simple code will load and save any image present in your hard disk:

Private Sub Command4_Click()
Form1.CommonDialog1.Filter = "JPG Files|*.jpg|BMP Images|*.bmp|GIF Images|*.gif"
On Error Resume Next
Form1.CommonDialog1.ShowOpen
On Error Resume Next
Form1.CommonDialog1.CancelError = True
Form1.Text8.Text = Form1.CommonDialog1.FileName
a = Form1.Text8.Text
Form1.Image1.Picture = LoadPicture(a)

End Sub

Where, command4 button is under the caption" BROWSE" in my database project.


Posted by Anonymous on 18 September, 2007 - 10:42 pm
Hai...

Thanks for the code. That code is working to load image, but it's not working to save image in database. Can you show me the code to save image?


Posted by Machoka on 11 July, 2011 - 10:51 am
This only works to load a photo to the Picture control but not saving!!! How can we save it to the database please?! Thank you...


Posted by Doit on 3 December, 2011 - 5:07 am
Go through this link
http://msdn.microsoft.com/en-us/library/aa260858(v=vs.60).aspx

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2013 Nerds in Control, LLC. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.


Fortune
Don't let people drive you crazy when you know it's in walking
distance.
Advertise here
Advertisement
our advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive