|
-
Nov 22nd, 2010, 12:16 PM
#1
Thread Starter
New Member
Embedding a file in a Access DB
Hello everyone,
I new in programming, and I thought I should start with VB6.
I have an Access DB with a table (Updates) that contains a OLE field (Attachment).
I need the code to let me insert a file (no matter what type, it can be a picture, an Outlook mail or any other Office document) from within the program, and then to open it from the RecordSet with a double click on a OLE object for example.
Is that even possible with VB6?
In case it is, I would appreciate very much some code examples for updating and retrieving the object.
Thanks in advance to all readers and posters.
-
Nov 22nd, 2010, 12:22 PM
#2
Re: Embedding a file in a Access DB
Have a look at few samples linked to my signature.
-
Nov 22nd, 2010, 01:06 PM
#3
Thread Starter
New Member
Re: Embedding a file in a Access DB
thanks RB, but I had already checked the links in your signature.
I was hoping to get a different answer, with a more global code, since I don't see the way to display the "attachment".
But thanks a lot anyway.
-
Nov 22nd, 2010, 02:03 PM
#4
Re: Embedding a file in a Access DB
Those samples demonstrate how to save/retrieve file to/from database.
What you do with your file (any type btw) after retrieving is entirely up to you so I am not quite sure I understand your concern about "displaying the attachment".
-
Nov 23rd, 2010, 03:21 AM
#5
Thread Starter
New Member
Re: Embedding a file in a Access DB
Well, I printed your code, kept reading it for many minutes, and finally figured out that you were actually creating a temporary file, using a windows API ( I guess), and then loading it on a picture.
I know, I'm a little slow 
With displaying I mean launching, using the explorer Double Click.
I suppose all I have to do is Embed the temporary file on a OLE object and a double click will do the rest.
Thank you again Mr. MVP
-
Nov 23rd, 2010, 04:53 AM
#6
Re: Embedding a file in a Access DB
You can simulate a double-click on a file (or a right-click followed by "open"/"print"/etc) by using the ShellExecute API.
For more information about it, see the article How do I open a file/web-page in its default application? from our Classic VB FAQs (in the FAQ forum)
-
Nov 23rd, 2010, 07:12 AM
#7
Thread Starter
New Member
Re: Embedding a file in a Access DB
Thanks!!! I really appreciate your help!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|