Replacing Text in a table (1 Viewer)

jeffreyccs

New member
Local time
Today, 03:14
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
 

cheekybuddha

AWF VIP
Local time
Today, 11:14
Joined
Jul 21, 2014
Messages
2,280
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.
 

jeffreyccs

New member
Local time
Today, 03:14
Joined
Nov 10, 2012
Messages
29
Hi

Thanks for the feedback, much appreciated.

Regards

Jeff
 

Users who are viewing this thread

Top Bottom