Re: More elegant code
- From: "Mike Painter" <mddotpainter@xxxxxxxxxxxxx>
- Date: Fri, 31 Oct 2008 14:43:28 -0700
I used Dir to do something similar.
I just didn't move duplicates but it would be easy to add a -something after
the file name to show it is a duplicate.
I used code rather than queries because I wanted to add the name of the file
to both a field that referenced it and a field that contained a name for the
picture.
C:\someFolder\FredSmith.jpg was stored as is and used to point to the
picture.
FredSmith (more likely 12234566) was added as the picture name.
The user could then leave it or make it meaningful.
bhammer wrote:
Jeff,
Thanks for the interest. It's an image database. One database per
(unrelated) Project. The user needs to be able to copy new image
files (as they periodically become available) to a destination folder
containing the images previously cataloged for this particular
project. The copying is done via a wizard I am creating.
BrowseForSourceFolder creates the New Images list. A Destination
folder is browsed to to find the collection folder for the project.
The new images files will be added to it. A CopyImages function does
the file copy work. Another button will catalog the filenames into
the database Images table.
The problem to solve is this: It is possible that sometimes the image
filenames will be identical to those already in the database (and the
collection folder), so I need to have a button the check for
duplicates prior to copying the files and prior to appending the
Images table. The result of the check is simply a display of the
duplicate filenames (or none, and emplty list) to let the user have
feedback. If duplicates exist, then the user is directed to rename
the offending files.
I have this wizard working already, but it seems clunky to me. It
feels like I'm missing a more elegant solution to the whole thing.
.
- References:
- More elegant code
- From: bhammer
- Re: More elegant code
- From: Jeff Boyce
- Re: More elegant code
- From: bhammer
- More elegant code
- Prev by Date: Re: More elegant code
- Next by Date: Re: 2003 Code Not Working in 2007
- Previous by thread: Re: More elegant code
- Next by thread: Re: More elegant code
- Index(es):
Relevant Pages
|