Re: How to Link a file instead of embeding in Access Table

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Gary,

I almost never use OLE fields to store files (whether linking or
embedding). It's usually simpler just to store the names and locations
of the files in text or hyperlink fields (if the latter, the user can
just click on the hyperlink and Windows will open the file in its parent
application).

But as far as I know the sample code at
http://support.microsoft.com/?id=198466 will do what you want if you
just change these lines

[OLEFile].OLETypeAllowed = acOLEEmbedded
[OLEFile].SourceDoc = [OLEPath]
[OLEFile].Action = acOLECreateEmbed
to
[OLEFile].OLETypeAllowed = acOLELinked
[OLEFile].SourceDoc = [OLEPath]
[OLEFile].Action = acOLECreateLink

If you examine the sample code you'll see that it uses the Dir()
function to get the file names, and then stores them in the text field
OLEPath. You can use Dir() in the same way to get the file names and
locations and store them in a hyperlink field.

On Wed, 29 Mar 2006 10:32:01 -0800, Gary
<Gary@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I have seen searching and posting for help for the last 7+ days. I have not
recieved any help so far.

I hope this isn't a dumb question!!! I also tried the knowledge base, etc
with on information on reconnecting links. Could I use that if I put a OLE
object with a broken link and reconnect???

I am trying to link a folder with individual files into a table record by
record using code. There is an OLE Object defined in the table to take the
object. I have did it with embed objects by making a record and copying it
into each of the record of the OLE Field. I wish to change over to an Linked
system, and need help in putting a link of file into the field with the OLE
Object defined on each record.

I deeply appreicated any help that you can give!!!!


Thanks,

Gary

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.

.



Relevant Pages

  • Re: Error Message: The OLe Server Isnt registered.
    ... Don't store the images in your table. ... I am> trying to store .BMP and .TIFF Files in those fields. ... > Sometimes the file could not be pasted and I receive> the Error Message: The OLE Server isn't registered. ... I> would like to convert the whole system over to where you> give the Picture Control a File Name that is external to> the data base. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: How to Link a file instead of embeding in Access Table
    ... I'd store the information about the network share ... separately from the folder and filename. ... It's probably worth taking a look at the DocMgr sample database here: ... Could I use that if I put a OLE ...
    (microsoft.public.access.externaldata)
  • RE: Bloat with Linked OLE/Best Practice for OLE Links
    ... I'm using an OLE field to store the link, as we need to be able to include ... Storing the files in a directory isn't the problem - ... These OLE images (typically Visio diagrams, Word Docs, or Excel ...
    (microsoft.public.access.tablesdbdesign)
  • Re: retrieving binary data
    ... I suspect you may find it simpler not to bother with the OLE wrapping ... and instead just store the contents of the image files in a blob ... >array index by index? ...
    (microsoft.public.access.queries)
  • Using OLE
    ... I'd like to add OLE like WordPad has. ... That is allow packages to be embedded or linked and thereby changed. ... I'm reading the doc but would like to have some sample code to study. ...
    (microsoft.public.dotnet.languages.csharp)