Replacing Text in a table

jeffreyccs

New member
Local time
Yesterday, 21:04
Joined
Nov 10, 2012
Messages
29
Hi

I have a table that contains the directory information for a number of images and is used to link to the images, this can easily be updated locally using find and replace. When passing the file to another user I would like to be able to automate the process in VBA, I can easily create the directory address using Path but I am unsure of the next step to replace the partial string.

Should I be using an Update query or is another method more appropriate.

Regards

Jeff
 
Yes, use an update query.

Something like:
SQL:
UPDATE YourTable
SET
  YourField = Replace(YourField, "C:/old/path", "C:/new/path")
;

Alternatively, don't store the path at all, just create it in code in the requisite controls when the db opens.
 
Hi

Thanks for the feedback, much appreciated.

Regards

Jeff
 

Users who are viewing this thread

Back
Top Bottom