Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for a query to update document locations linked in a table 1

Status
Not open for further replies.

breezett93

Technical User
Jun 24, 2015
128
US
Every record in this table has a link that opens up a document about the record. The location for many of them has been changed; so I need to update the link in the table. All the links that need to updated have the same starting directory.

Here's what I'd like to do:

Example of a record link: \\server\Oldfolder\folder\document.pdf

While Not EOF
If field contains "\\server\Oldfolder" Then
Replace with "\\server\Newfolder" without overwriting the remaining part of the link

I could probably come up with an inefficient solution, but I was hoping someone that did this before had a good solution.


Thanks!
 
How about:

Update TableA
Set LinkField = Replace(LinkField, "\\server\Oldfolder", "\\server\Newfolder")
Where LinkField LIKE "\\server\Oldfolder*"


---- Andy

There is a great need for a sarcasm font.
 
breeezett93,

If it's "fantastic" you need to click the "Great Post!" link to mark the question as answered and give some credit to Andy.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top