Discussion Locked

Changing path of Linked Object in Access

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am using Access 97 and have a field with the data type of OLE Object. In that field there has been put a Microsoft Word Document which is linked. We want to move the database and those linked word documents to a different directory. However, I do not see a way to change the path of that linked document. I see no place to edit it in the Access Table and have not found a VBA method to interact with the objects path. The best solution would be a VBA option or a search and replace options asthere are 1000+ records for this particular field.

5 replies

by sl-campbell

The only way I know how to do this is to create a form and put a OLE control on it.
Create a DataControl using the table and Ole field as the source. Set the DataSource of the OLE control to the DataControl and the OLE DataField the the OLE field name.

Now, use a loop to go through all the records. At each record, check the OLE controls' SourceDoc setting a variable to it, parse it seperating the path from the file name, add the new path to the file name, and set it back to the SourceDoc and then update the record and move to the next record.
Because the OLE control is bound and the SourceDoc was change, the Jet updates the record with the needed change that is otherwise hidden from viewers of the tables.

Any more questions then send me a comment.

Hope you get it to work!

by jammin

I have looked at sourcedoc before, can you clarify "OLE Control" and "Data Control"? I tried using object frames but there was no information in the sourcedoc. Where to I find those controls you mentioned?

This discussion is closed to new replies.